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

Define block setup_requires_interior #149

Merged
merged 5 commits into from
Sep 28, 2019

Conversation

dHannasch
Copy link
Collaborator

@dHannasch dHannasch commented Sep 26, 2019

…that includes both pytest-runner and setuptools_scm as appropriate.

Resolves #147.

Note that this still has two Travis failures on ENV=pure-private (due to #146) and ENV=matrix-cext (that will be fixed by #145).

@ionelmc
Copy link
Owner

ionelmc commented Sep 27, 2019

Oooof ... good catch. I don't really remember why I put it in setup.cfg.

@ionelmc
Copy link
Owner

ionelmc commented Sep 27, 2019

@dHannasch I'm thinking now about moving that tests_require in setup.py as well - but with a briefer comment - what do you think?

@dHannasch
Copy link
Collaborator Author

@dHannasch I'm thinking now about moving that tests_require in setup.py as well - but with a briefer comment - what do you think?

Hrm. It looks like they generally recommend using setup.cfg when possible, or rather, they want to recommend that but are worried about older versions before setup.cfg was supported. pypa/packaging.python.org#378
As long as we're using setup.cfg at all, it seems like it probably makes sense to prefer leaving settings in setup.cfg rather than setup.py.

(Of course setup_requires can't be in setup.cfg because setup.cfg isn't sophisticated enough to handle things like "require CFFI but only sometimes." But tests_require can be in setup.cfg.)

To be honest I'm not sure why they recommend that, but if I had to guess it's because setup.cfg is easier to read, because there's usually some "mess" in setup.py to handle all kinds of oddball problems.

@ionelmc
Copy link
Owner

ionelmc commented Sep 28, 2019

Seems they are still talking about it (pypa/sampleproject#57 and the mostly empty https://github.com/pypa/sampleproject/blob/master/setup.cfg). The license_files = LICENSE.txt is strange and out of place. They added that redundant thing (LICENSE* is already included) but didn't make a move on the other metadata.

I wouldn't trust them on anything regarding best practices tho, packaging.python.org is more of a cookbook that tries to give some overview on packaging.

Give then fact that duplicated metadata in setup.py and setup.cfg ain't merged I'm thinking it's a bad practice to spread it across the two files, and it's impossible to have everything in setup.cfg. Therefore it's logical to conclude that the best practice is ... the opposite of pypa/packaging.python.org#378 :)

@ionelmc ionelmc merged commit 0143d09 into ionelmc:master Sep 28, 2019
@ionelmc
Copy link
Owner

ionelmc commented Sep 28, 2019

I'll merge this for now to avoid brokenness and we deal with the tests_require later maybe.

@dHannasch
Copy link
Collaborator Author

To clarify, you're talking about deleting setup.cfg entirely, right? Or maybe not.

I can see the logic of, when multiple places might hold settings, keeping the settings only in the highest-priority place. That applies to pretty much everything in setup.cfg, because setup.cfg is never the highest-priority place. E.g. pytest.ini overrides setup.cfg, and the settings are not merged. http://doc.pytest.org/en/latest/customize.html

I guess I had been wondering whether we might want separate files .flake8, pytest.ini, etc.

@dHannasch dHannasch deleted the move-setuptools-scm-to-setup-py branch September 28, 2019 00:27
@dHannasch
Copy link
Collaborator Author

dHannasch commented Sep 28, 2019

Incidentally, is your computer clock two days slow?
The "Latest commit" 0bee7f3 says it's from two days ago.
https://travis-ci.org/ionelmc/cookiecutter-pylibrary/builds/590801237?utm_source=github_status&utm_medium=notification

@ionelmc
Copy link
Owner

ionelmc commented Sep 28, 2019

Oooof ... ntp service was hosed :\

@ionelmc
Copy link
Owner

ionelmc commented Sep 28, 2019

Well I put what I could in setup.cfg to avoid dozens of root-level files. Coveragerc wasn't moved there because pytest-cov doesn't work nice with non-default file (it's messy and can't be fixed). I was suggesting moving out just the tests_require. Maybe we could move out all to separate files - don't know what to say - it's a try it and see how it looks thing.

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.

CHANGELOG.rst is not found by setup.py when testing on Travis
2 participants