You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a package for which i have a setup.py in order to cythonize all my modules. This works fine.
Now I have a tox entry in my pyproject.toml which looks like :
[tool.tox]
requires = ["tox>4", "tox-uv>=1.11.3"]
isolated_build = true
env_list = ["py311", "py312", "fix", "dev", "type", "build"]
# === testenv to run pytest over all your environment ===
[tool.tox.env_run_base]
description = "Invoke pytest to run automated tests under {env_name} with coverage"
passenv = ["USERNAME"]
changedir = "{toxinidir}"
allowlist_externals = ["pytest", "uv"]
dependency_groups = ["dev"]
commands = [["pytest"]]
[tool.tox.env.build]
description = "Build the package using uv"
changedir = "{toxinidir}"
commands = [["uv", "build"]]
allowlist_externals = ["uv"]
If i run tox r -e py311 everything runs fine: a py311 env is created, the cythonized package is installed (pyd files) and the unit test are run.
The problem is, if i add a py312 entry, the py312 environment created installs the pyd files build with python 311, and therefore the unit tests fail. The contents of the py312 directory for my package is :
Directory: \.tox\py312\Lib\site-packages\mypackage
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/29/2025 10:20 AM 51712 errors.cp311-win_amd64.pyd
-a---- 3/29/2025 10:20 AM 110080 qchecks.cp311-win_amd64.pyd
-a---- 3/29/2025 10:20 AM 49152 weak_crypto.cp311-win_amd64.pyd
-a---- 3/29/2025 10:20 AM 34816 __init__.cp311-win_amd64.pyd
so the cp311 (python311) version is installed.
How can i make sure that also for the building step, the python version is changed to python 312 when i am running py312?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a package for which i have a setup.py in order to cythonize all my modules. This works fine.
Now I have a tox entry in my pyproject.toml which looks like :
If i run
tox r -e py311
everything runs fine: a py311 env is created, the cythonized package is installed (pyd files) and the unit test are run.The problem is, if i add a py312 entry, the py312 environment created installs the pyd files build with python 311, and therefore the unit tests fail. The contents of the py312 directory for my package is :
so the cp311 (python311) version is installed.
How can i make sure that also for the building step, the python version is changed to python 312 when i am running py312?
Any hints appreciated!
Beta Was this translation helpful? Give feedback.
All reactions