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

Change --min-py-version behavior & always set python_requires #179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mxr
Copy link
Sponsor Contributor

@mxr mxr commented Dec 11, 2022

  • Replace --min-py3-version with --min-py-version
  • Change how the min version is determined; use --min-py-version as the source of truth if supplied, otherwise infer it
  • Always set python_requires

Resolves #178

@asottile
Copy link
Owner

sorry it's been a while -- haven't gotten around to this. at the very least we'll need to keep the old option and have it be an alias to the new option (perhaps with a warning?)

README.md Outdated Show resolved Hide resolved
setup_cfg_fmt.py Outdated Show resolved Hide resolved
@mxr
Copy link
Sponsor Contributor Author

mxr commented Dec 15, 2022

at the very least we'll need to keep the old option and have it be an alias to the new option (perhaps with a warning?)

Perhaps we split this into multiple releases

Release 1: Add a --min-py-version flag which is used to override every other setting. That flag is exclusive with --min-py3-version
Release 2: Add a warning when --min-py3-version is used
Release 3: Drop --min-py3-version entirely, change the logic to act like what's in this PR
Release 4: Ensure --min-py-version>2, delete py2 code? Too heavy-handed?

@asottile
Copy link
Owner

I think simpler would be to just remove the py2 code and make --min-py3-version an alias to --min-py-version and disallow anything less than 2 -- and release that as a major version (then later remove the --min-py3-version option)

@mxr
Copy link
Sponsor Contributor Author

mxr commented Dec 15, 2022

OK, so in cases where python_requires >= 2.7 - would the tool just promote that to the version in --min-py-version, regardless of whether or not it's set explicitly?

@asottile
Copy link
Owner

yep! intentionally removing any support for python 2.x packages

@mxr
Copy link
Sponsor Contributor Author

mxr commented Dec 15, 2022

OK. Same for tox.ini envlist & classifiers too?

@asottile
Copy link
Owner

yep yep

@mxr
Copy link
Sponsor Contributor Author

mxr commented Dec 15, 2022

Dropping py2 support and enforcing that --min-py-version takes precedence is kind of complicated so let me split up the PRs

@mxr mxr changed the title Change --min-py3-version behavior Change --min-py-version behavior Dec 16, 2022
@mxr mxr force-pushed the parse-min branch 2 times, most recently from 0ba5e64 to 9bf3653 Compare December 16, 2022 21:38
@mxr mxr requested a review from asottile December 16, 2022 21:38
@mxr mxr changed the title Change --min-py-version behavior Change --min-py-version behavior & always set python_requires Jan 6, 2023
@mxr mxr requested a review from asottile January 6, 2023 22:47
Comment on lines 774 to 786
'classifiers =\n'
' Programming Language :: Python :: 3\n'
' Programming Language :: Python :: 3 :: Only\n'
' Programming Language :: Python :: 3.7\n'
' Programming Language :: Python :: 3.8\n'
' Programming Language :: Python :: 3.9\n'
' Programming Language :: Python :: 3.10\n'
' Programming Language :: Python :: 3.11\n'
' Programming Language :: Python :: Implementation :: CPython\n'
'\n'
'[options]\n'
'python_requires = >=3.10\n'
'python_requires = >=3.7\n'
)
Copy link
Owner

Choose a reason for hiding this comment

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

I think this one is not quite right -- I think the defaulting is happening too early so it's ignoring all the tox / etc. settings?

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

Ah you're right the logic I have is "specify nothing: minimum is min(3.7, python_requires minimum, tox minimum, ...)" not "[...] max(3.7, [...]"

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.

python_requires not written when only --min-py3-version is specified
2 participants