Skip to content

Pass python_requires argument to setuptools #5739

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 11, 2018
Merged

Pass python_requires argument to setuptools #5739

merged 1 commit into from
Jan 11, 2018

Conversation

jdufresne
Copy link
Contributor

@jdufresne jdufresne commented Jan 10, 2018

Helps pip decide what version of the library to install.

https://packaging.python.org/tutorials/distributing-packages/#python-requires

If your project only runs on certain Python versions, setting the
python_requires argument to the appropriate PEP 440 version specifier
string will prevent pip from installing the project on other Python
versions.

https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords

python_requires

A string corresponding to a version specifier (as defined in PEP 440)
for the Python version, used to specify the Requires-Python defined in
PEP 345.

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

First thought on this is "Yep, 👍, why not?"

Then I think:

  • I need to check the syntax, but is an opt-in list not shorter, especially as we go on?
  • Blue-skies: can we combine this somehow with maintaining the list of trove classifiers below.

I have a pet peeve with forgetting to update the supported versions in ≈3 or 4 different places; it would be nice to do something about that. (As I say "Blue-skies")

@rpkilby
Copy link
Member

rpkilby commented Jan 10, 2018

Blue-skies: can we combine this somehow with maintaining the list of trove classifiers below.

Writing some code here seems like it would be overly complicated. Maybe we can just add it to the release process checklist? eg,

  • Update supported versions:
    • setup.py python_requires list
    • setup.py Python & Django version trove classifiers
    • README Python & Django versions
    • docs Python & Django versions
    • ...

@carltongibson
Copy link
Collaborator

...would be overly complicated...

Well, would it? (Maybe, yes.)

I use bumpversion on django-filter and it's great. At the back of my mind I have the thought that something similar would be good here (and for the README, and anywhere we maintain the exact same list of supported versions — Oh, yes, I see you covered those in your checklist @rpkilby 🙂)

I think updating the Release Process checklist with this would be a good addition pending any super code solution.

Helps pip decide what version of the library to install.

https://packaging.python.org/tutorials/distributing-packages/#python-requires

> If your project only runs on certain Python versions, setting the
> python_requires argument to the appropriate PEP 440 version specifier
> string will prevent pip from installing the project on other Python
> versions.

https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords

> python_requires
>
> A string corresponding to a version specifier (as defined in PEP 440)
> for the Python version, used to specify the Requires-Python defined in
> PEP 345.
@jdufresne
Copy link
Contributor Author

I made the suggested docs edits. Please let me know if I interpreted the intentions correctly, that the change is in the right place, and is acceptable wording. Thanks.

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

OK. That's great. Lets have it! 👍

@carltongibson carltongibson added this to the 3.8 Release milestone Jan 11, 2018
@carltongibson carltongibson merged commit b2ec681 into encode:master Jan 11, 2018
axnsan12 added a commit to axnsan12/drf-yasg that referenced this pull request Jan 11, 2018
@jdufresne jdufresne deleted the python-requires branch January 26, 2018 02:07
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
Helps pip decide what version of the library to install.

https://packaging.python.org/tutorials/distributing-packages/#python-requires

> If your project only runs on certain Python versions, setting the
> python_requires argument to the appropriate PEP 440 version specifier
> string will prevent pip from installing the project on other Python
> versions.

https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords

> python_requires
>
> A string corresponding to a version specifier (as defined in PEP 440)
> for the Python version, used to specify the Requires-Python defined in
> PEP 345.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants