Skip to content

Commit e510d39

Browse files
authored
simplify python requirements (#261)
i was inspired to do this while working on #245 specifying both project.requires-python and tool.poetry.dependencies.python comes from #242 where we wanted to specify requires-python to get nice features from the PR description like: > - Removed the version specific classifiers. Those are added by poetry-core automatically based on `requires-python`. > - Removed `tool.black.target-version` since black is able to infer the value from `project.requires-python`. the [initial version of that PR](b366342) removed both tool.poetry.dependencies.python and the upper bound on the python version. ohemorange correctly noted [here](#242 (comment)) that we need the upper bound on the python version for poetry's locking algorithm. this was fixed by following the suggestion from poetry's docs of specifying the python version in both places using slightly different values poetry's docs make this recommendation for folks who want to avoid to avoid specifying an upper bound in their package's metadata, but i don't think that's something we need to do. as you can see by the metadata diff from the [PR description](#242 (comment)), we previously were defining an upper bound: > ```diff > ... > -License: Apache-2.0 > +License-Expression: Apache-2.0 > License-File: LICENSE.txt > ... > -Requires-Python: >=3.9.2,<4.0 > +Requires-Python: >=3.9.2 > ... > -Classifier: License :: OSI Approved :: Apache Software License > ... > ``` to my knowledge, no one ever complained. not only does that approach duplicate information that we need to keep in sync, but project.requires-python and tool.poetry.dependencies.python take slightly different syntax with the ^3.10 [caret requirement](https://python-poetry.org/docs/dependency-specification/#caret-requirements) suggested in the comment above project.requires-python not being a valid value there because of these downsides, this PR takes a slightly different approach and unifies everything in one place to hopefully make things a little simpler and cleaner for us
1 parent 29bb4cb commit e510d39

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ readme = "README.rst"
1414
authors = [{ name = "Certbot Project"}]
1515
# python 3.9.2 is used as a lower bound here because newer versions of
1616
# cryptography dropped support for python 3.9.0 and 3.9.1. see
17-
# https://github.com/pyca/cryptography/pull/12045. when we drop support for
18-
# python 3.9 altogether, this line can be changed to the simpler 'python = "^3.10"'.
19-
# This should be kept in sync with the value of tool.poetry.dependencies.python below.
20-
requires-python = ">=3.9.2"
17+
# https://github.com/pyca/cryptography/pull/12045
18+
requires-python = ">=3.9.2,<4.0"
2119
dynamic = ["classifiers", "dependencies"]
2220

2321
[project.urls]
@@ -43,8 +41,6 @@ include = [
4341
]
4442

4543
[tool.poetry.dependencies]
46-
# This should be kept in sync with the value of project.requires-python above.
47-
python = ">=3.9.2,<4.0"
4844
# load_pem_private/public_key (>=0.6)
4945
# rsa_recover_prime_factors (>=0.8)
5046
# add sign() and verify() to asymetric keys (RSA >=1.4, ECDSA >=1.5)

0 commit comments

Comments
 (0)