Skip to content

Move entry_points and setup_requires to setup.cfg #176

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

Closed
FlorianWilhelm opened this issue Jun 13, 2018 · 5 comments
Closed

Move entry_points and setup_requires to setup.cfg #176

FlorianWilhelm opened this issue Jun 13, 2018 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@FlorianWilhelm
Copy link
Member

Version 3.0 of PyScaffold still has two parameters (entry_points and setup_requires) in setup.py instead of setup.cfg due to historical reasons and limitations of setuptools at that point. It seems now possible according to this stackoverflow question. We should thus make use of this possibility in PyScaffold version 3.1 and also move setup_requires to setup.cfg to completely get rid of any configuration in setup.py with the exception of Cython extensions. These will hopefully be supported in future setuptools version by some syntax in setup.cfg.

@FlorianWilhelm FlorianWilhelm added this to the v3.1 milestone Jun 13, 2018
@FlorianWilhelm FlorianWilhelm added the enhancement New feature or request label Jun 13, 2018
@abravalheri
Copy link
Collaborator

options.entry_points documentation can be found in setuptools/docs/setuptools.txt#L2442, and if we check the blame of the file, this option was added to the docs in Dec 10, 2016, which seems to correspond to version 38.2.5.

So we would have to change the setuptools dependency version (currently at 30.3.0)

@abravalheri
Copy link
Collaborator

@FlorianWilhelm, I am trying to implement this, but I am not sure how to proceed about setup_requires, specially because of the conditional sphinx...

Any hints? Just require sphinx anyway?

@FlorianWilhelm
Copy link
Member Author

@abravalheri, thanks for giving this a try!

I think we might not even need sphinx in setup_requires anymore. I took this approach from the official Sphinx documentation or somewhere else quite a while ago. What we do right now in the module integration.py is to register the docs command anyway. If Sphinx is not available we register the dummy NoSphinx class and if a user calls python setup.py docs this class is called and it outputs a nice message that Sphinx is not installed. This is explicit and fine. I don't think any more that we should pull a large package like Sphinx with the help of setup_requires automatically. Explicit is better than implicit.

BTW, we map the docs command to build_sphinx. In order to also show a nice error message that Sphinx is missing one would also have to register the commands build_sphinx and upload_docs to the same NoSphinx class with the help of a command similar to build_cmd_docs. So for build_sphinx it would actually be build_cmd_docs as it is for docs but for upload docs (which I have never used actually) one would need to check which class Sphinx normally registers that to.

@abravalheri
Copy link
Collaborator

It seems that upload_docs is part of setuptools directly, and it's being deprecated. So I might not touch it.

@FlorianWilhelm
Copy link
Member Author

@abravalheri, thanks. I think we can close this now. We should keep in mind though that we need to remove the setup_requires and entry_points parameters from setup(...) during an update from version 3.0 to 3.1. Let's discuss this in another issue.

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

No branches or pull requests

2 participants