Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port setuptools options to declarative config #40

Merged
merged 2 commits into from
Mar 18, 2021

Conversation

eli-schwartz
Copy link
Contributor

No description provided.

@FelixSchwarz
Copy link
Member

LGTM

some potential follow-up improvements (not sure what @hodgestar thinks about these):

  • Do we need to list the "tests" packages? I think this ensures they are present in the final wheel which is not ideal (though they should be present in sdist!).
  • How about also referencing the license text? (license_file = COPYING)

@eli-schwartz
Copy link
Contributor Author

I thought about adding license_files = COPYING, but it's a bit extraneous. bdist_wheel already defaults to

if 'license_file' not in metadata and 'license_files' not in metadata:
    patterns = ('LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*')

However, now that I check again, it is only done for wheel, not for sdist, and the real reason COPYING is even in the sdist is due to MANIFEST.in, so... we can move it from MANIFEST.in to setup.cfg

@eli-schwartz
Copy link
Contributor Author

I agree that tests should not really be included in the final wheel, but that's a separate topic. It should be sufficient to distribute them via MANIFEST.in, but you might also want to move them to a top-level tests/ directory.

@@ -1,8 +1,7 @@
include ChangeLog
include COPYING
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put just this line back? I actually prefer if files are explicitly listed in MANIFEST.in rather than having to guess what other logic elsewhere is including files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine if it is also listed in setup.cfg -- for me that's actually separate information, i.e. "this is a file containing the license" while MANIFEST.in is "please include this file in the source distribution".

Copy link
Contributor Author

@eli-schwartz eli-schwartz Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a file specifically called out in the metadata, just like py_modules or packages. But instead of declaring it as an importable source file, it's declared as a dist-info file which must be installed as wheel metadata. Since it must be installed as wheel metadata, it also must be included in the source dist in order to guarantee it makes its way into the wheel, and is thus guaranteed to be collected during the dist creation.

I disagree with your analysis -- I don't view this as guessable logic -- but if you still want it I'll put it back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still like it back -- I have been bitten so often by files not being included in the source distribution that I just want one place that I can look.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Apologies for being a pain about it. :|

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, I wish every PR review was this simple to solve.

"Looks good, just please include this minor nitpicky line that I really like even though it's a no-op."

(I mean, it's lots better than "I disagree with the functionality and would rather you write your own separate program to do X". I've gotten that once or twice for stuff I thought was a no-brainer bugfix.)

@hodgestar
Copy link
Contributor

Other than the small change I requested, looks good to me too.

I agree that moving tests into a tests/... folder would be good but is a separate topic (and should not happen in this PR :).

@FelixSchwarz
Copy link
Member

I thought about adding license_files = COPYING, but it's a bit extraneous.

My main reason for requesting was that the license file would be present in the dist-info all the time. Also it potentially helps distro tooling which can automate python packaging better (at least in Fedora we require that the license file is declared separately so we can ensure it is always installed even if the operator chooses not to install documentation files).

'Topic :: Text Processing :: Markup :: XML'
],
keywords = ['python.templating.engines'],
packages = packages,
test_suite = 'genshi.tests.suite',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall if it's been discussed in this project yet, but the test command is deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should really be its own issue, and actually this coincides very well with the other mention here about reorganizing into a tests/ directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed -- let's leave messing with the test suite out of things for now.

This is not needed for wheels, since the default license files pattern
already finds the current name of this file. However, it is needed for
sdist in order to guarantee the file gets disted.

Currently, that file gets disted anyway... but only because MANIFEST.in
forces it to be.

So adding the license_files metadata lets us drop the info from
MANIFEST.in; however, as the project maintainer finds it easier to look
in only one file for this information, this is being left in despite its
redundancy.
Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will merge as soon as CI has finished running (assuming it runs successfully, although hard to see why it wouldn't).

@eli-schwartz
Copy link
Contributor Author

It's been two days but the CI finally passed. ;)

@hodgestar hodgestar merged commit ff582cb into edgewall:master Mar 18, 2021
@hodgestar
Copy link
Contributor

Merged!

@eli-schwartz Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants