-
-
Notifications
You must be signed in to change notification settings - Fork 30
Move setup.py and setup.cfg into pyproject.toml #144
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
Conversation
The py39-no_extras environment doesn't have tomli installed, so we have to keep settings out of pyproject.toml that are needed for running tests.
@kurtmckee @webknjaz Anything I missed here, or any improvements? |
Makefile
Outdated
.DEFAULT_GOAL := help | ||
|
||
# For opening files in a browser. Use like: $(BROWSER)relative/path/to/file.html | ||
BROWSER := python -m webbrowser file://$(CURDIR)/ | ||
|
||
# This runs a Python command for every make invocation, but it's fast enough. | ||
# Is there a way to do it only when needed? | ||
VERSION := $(shell python -c "import build.util as bu; print(bu.project_wheel_metadata('.')['Version'])") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://pypi.org/p/pyproject-hooks might make more sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how I would use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that'd be more involved. You won't want to inline it.
It might be using an outdated jsonschema that doesn't know of PEP 639. |
I don't understand what tool outputs that error, though. |
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Oh, it's |
Nope, I've run |
That's weird. Could you check what (or maybe |
I seem to have an older version of setuptools: 75.8.2. I don't know why that version is installed. I'm using the latest tox, etc. What do you get when you run tox on your machine? |
@nedbat I think Try doing |
https://tox.wiki/en/4.24.2/faq.html#customizing-virtual-environment-creation and https://tox.wiki/en/4.24.2/faq.html#customizing-virtual-environment-creation imply that you can also force |
https://virtualenv.pypa.io/en/latest/user_guide.html#wheels says it auto-fetches wheels every 14 days, but only uses them once 28 days passed since their release. |
I would like to find a self-contained way to get the right setuptools. I tried |
I never tried that setting. Another way to get out of this could be installing But dragging |
It seems to have been problematic in the past. I've found at least two issues. Both closed. Here's one: tox-dev/tox#1768. Running |
Using VIRTUALENV_DOWNLOAD=1 on the tox command line solves the problem, but I can't seem to set it in the tox.ini. My inclination is to fix the license setting later when everything has time to be current. |
Yeah, I figured we may need to postpone. I think you'd have to use |
pyproject.toml
Outdated
authors = [ | ||
{name = "Ned Batchelder", email = "[email protected]"}, | ||
] | ||
license.text = "Apache-2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the warning you referenced when running tox -re quality
against the current branch; changing this line subsequently resolved the warning:
license.text = "Apache-2.0" | |
license = "Apache-2.0" |
For reference, when I run pip list
in the tox environment that was created, this is what I see:
pip list
output
$ /home/kurt/.cache/tox-workdir/3ce88997e1055c6623836ec649406804/quality/bin/python -m pip list
Package Version
----------------------------- ---------------
alabaster 0.7.16
astroid 3.3.9
attrs 25.3.0
babel 2.17.0
backports.tarfile 1.2.0
black 25.1.0
build 1.2.2.post1
certifi 2025.1.31
cffi 1.17.1
charset-normalizer 3.4.1
check-manifest 0.50
click 8.1.8
click-log 0.4.0
cogapp 3.4.1
coverage 7.7.0
cryptography 44.0.2
dill 0.3.9
doc8 1.1.2
docutils 0.21.2
exceptiongroup 1.2.2
freezegun 1.5.1
id 1.5.0
idna 3.10
imagesize 1.4.1
importlib_metadata 8.6.1
iniconfig 2.1.0
isort 6.0.1
jaraco.classes 3.4.0
jaraco.context 6.0.1
jaraco.functools 4.1.0
jedi 0.19.2
jeepney 0.9.0
Jinja2 3.1.6
keyring 25.6.0
markdown-it-py 3.0.0
MarkupSafe 3.0.2
mccabe 0.7.0
mdurl 0.1.2
more-itertools 10.6.0
mypy 1.15.0
mypy-extensions 1.0.0
nh3 0.2.21
packaging 24.2
parso 0.8.4
pathspec 0.12.1
pbr 6.1.1
pip 25.0.1
platformdirs 4.3.7
pluggy 1.5.0
pudb 2024.1.3
pycodestyle 2.12.1
pycparser 2.22
pydocstyle 6.3.0
Pygments 2.19.1
pylint 3.3.6
pylint-pytest 1.1.8
pyproject_hooks 1.2.0
pytest 8.2.0
pytest-mock 3.14.0
python-dateutil 2.9.0.post0
PyYAML 6.0.2
readme_renderer 44.0
requests 2.32.3
requests-toolbelt 1.0.0
responses 0.25.7
restructuredtext_lint 1.4.0
rfc3986 2.0.0
rich 13.9.4
scriv 1.5.1
SecretStorage 3.3.3
setuptools 77.0.3
six 1.17.0
snowballstemmer 2.2.0
Sphinx 7.4.7
sphinx-rtd-theme 3.0.2
sphinxcontrib-applehelp 2.0.0
sphinxcontrib-devhelp 2.0.0
sphinxcontrib-htmlhelp 2.1.0
sphinxcontrib-jquery 4.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 2.0.0
sphinxcontrib-serializinghtml 2.0.0
stevedore 5.4.1
tomli 2.2.1
tomlkit 0.13.2
twine 6.1.0
types-freezegun 1.1.10
types-PyYAML 6.0.12.20241230
types-requests 2.32.0.20250306
types-toml 0.10.8.20240310
typing_extensions 4.12.2
urllib3 2.3.0
urwid 2.6.16
urwid_readline 0.15.1
wcwidth 0.2.13
zipp 3.21.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I see that there was a lot of discussion above re: tox using venv vs virtualenv. Apologies -- I'm using the tox-uv
plugin to speed up creation of the tox virtual environments, which means that my tox workflow doesn't use venv or virtualenv.
Therefore I doubt that this comment is imminently helpful for the discussion. 😓
python -Im build | ||
twine check --strict dist/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ Nice! This matches my own build workflow, but I've now learned about the -I
option!
The .pkg set_env is needed to force use of the latest setuptools.
That's the solution! I've added that to the tox.ini and fixed the license spec. |
Thanks for all the help, if there's more to do, we can do it from main. |
I've moved to a real pyproject.toml file.
This needs some testing, especially with real distributions installed elsewhere to make sure the packaging is all correct.
Building a distribution produces a deprecation warning:
but if I change pyproject.toml as they suggest (
license = "Apache-2.0"
), thenmake quality
fails with an even scarier message:This makes me think there's a version skew in the packaging tools, but everything is up to date. Suggestions welcome.