Repository navigation
Move project configuration to pyproject.toml - #157
TOMASEZARATE wants to merge 1 commit into
Conversation
|
Hi Tomas, thanks for your contribution! I'm actually not sure if we can accept a PR made with AI assistance, though. Let me see if there are any relevant policies yo consider. |
|
Thanks for taking a look, and no problem, I'll wait to hear what you decide about the AI policy. About the failing jobs, there are two separate things:
|
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest-localserver maintainers; I prompted it, it did the work, I read it.
Thanks for picking up #126 and for disclosing the AI use. The mapping from setup.py into [project] is correct, and your read of the CI failures is right. Rather than falling back to the old license form, let's go forward: drop the old Pythons and modernise the setuptools-scm config in this PR.
1. Drop Python 3.7, 3.8 and 3.9 (requires-python = ">=3.10").
All three are EOL, setup-python no longer ships 3.9 for ubuntu-26.04 (that's the unrelated 3.9 failure, main fails the same way), current setuptools needs 3.10, and setuptools-scm 10.0.x needs 3.10. That means touching:
pyproject.toml:requires-python, remove the 3.7/3.8/3.9 classifiers,[tool.black] target-version = ['py310']tox.ini: envlistpy{310,311,312,313,314,315,py3}{,-smtp},lint, and drop the now-deadpytest >=4.6, <10; python_version <'3.10'line.github/workflows/tests.yml: remove the 3.7/3.8/3.9 and pypy-3.7/3.8/3.9 matrix entries (that also removes the lastubuntu-22.04pins and thepytest==4.6min-deps runs).pre-commit-config.yaml: pyupgrade--py37-plus→--py310-plus
2. Keep the PEP 639 license as you have it. setuptools>=77 and license = "MIT" are right once 3.7–3.9 are gone. Please don't switch to license = {text = "MIT"}: it drops License-Expression from the published wheel and setuptools (84.2.1) deprecates the table form, with removal due 2027-02-18.
3. Update the setuptools-scm config.
setuptools_scm[toml] >=3.4.1→setuptools-scm>=10. Thetomlextra is empty in current releases, and 10 is what the config below needs.write_to→version_file. The current docs only documentversion_file;write_tois the legacy spelling.- Set
write_to_source = trueexplicitly. Without it, setuptools-scm 10 emits a DeprecationWarning on every build, and its default flips in the next major to not writing into the source tree.pytest_localserver/__init__.pyimportspytest_localserver._version, so editable installs and source checkouts would lose that file.
[build-system]
requires = ["setuptools>=77", "setuptools-scm>=10"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
version_file = "pytest_localserver/_version.py"
write_to_source = true4. Description and CHANGES.
- The description says the metadata matches apart from formatting, but there are two real differences:
readme = "README.rst"now emitsDescription-Content-Type: text/x-rst(setup.pyset none), andtests_requireis dropped (it had no effect). Please list both. - Please add a
CHANGESentry, e.g. "Drop Python 3.7, 3.8 and 3.9 support" and "Move project metadata from setup.py to pyproject.toml".
Generated by Claude Code
|
Thanks, I pushed the requested changes |
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
looks good to me, thanks
@diazona please take a look if you see anything amiss
| [tool.setuptools_scm] | ||
| write_to = "pytest_localserver/_version.py" | ||
| version_file = "pytest_localserver/_version.py" | ||
| write_to_source = true |
There was a problem hiding this comment.
optional nitpick - we may not need write_to_source
| @@ -1,5 +1,5 @@ | |||
| [tox] | |||
| envlist = py{37,38,39,310,311,312,313,314,315,py3}{,-smtp},lint | |||
| envlist = py{310,311,312,313,314,315,py3}{,-smtp},lint | |||
There was a problem hiding this comment.
followup note - i am under the impression no need to do the smpt thing for all python versions, maybe this can be reduced
|
I'll take a look at the PR as soon as I have a chance, but it might not be until tomorrow or Saturday since I'm having a particularly busy week at work. So if you don't hear from me before then, don't worry, I haven't forgotten. |
|
Hey Tomas, thanks for your patience. I've been extremely busy the past couple weeks so I'm only getting around to this now. First things first, I've proposed an LLM policy in #161 which would require an The other thing is that our policy is to keep listing old Python versions as supported until we have a strong reason to get rid of them. I don't think using a modern way of expressing the license expression in |
Closes pytest-dev#126 Assisted-by: Cursor Agent with Grok 4.7
6ea1eb3 to
d868cc6
Compare
|
Thanks @diazona, the policy in #161 sounds good to me. I added an Assisted-by trailer to the commit and force-pushed. I also rebased onto main and reverted the changes that dropped Python 3.7-3.9: requires-python is back to >=3.7, the license uses the table form, and the setuptools-scm config stays with write_to, since version_file and write_to_source need setuptools-scm versions that don't run on 3.7. The build and tests pass on 3.8 and 3.12. @RonnyPfannschmidt this undoes part of what you asked for in your review, so I wanted to let you know. Happy to adjust if you two settle on something different. |
|
My opinion is secondary in this repo |
Closes #126
The package metadata now lives in the [project] table in pyproject.toml, so setup.py and setup.cfg are removed. Supported Python versions are unchanged (requires-python is >=3.7).
The license uses the table form (license = {text = "MIT"}) and the build requirements stay compatible with Python 3.7, so the setuptools-scm config still uses write_to.
Two real metadata differences from setup.py:
Written with some help from AI. The commit has an Assisted-by trailer.