REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.19 KB
Close
/proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py
Text
Base64
from inspect import cleandoc import pytest from jaraco import path from setuptools.config.pyprojecttoml import apply_configuration from setuptools.dist import Distribution from setuptools.warnings import SetuptoolsWarning def test_dynamic_dependencies(tmp_path): files = { "requirements.txt": "six\n # comment\n", "pyproject.toml": cleandoc( """ [project] name = "myproj" version = "1.0" dynamic = ["dependencies"] [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [tool.setuptools.dynamic.dependencies] file = ["requirements.txt"] """ ), } path.build(files, prefix=tmp_path) dist = Distribution() dist = apply_configuration(dist, tmp_path / "pyproject.toml") assert dist.install_requires == ["six"] def test_dynamic_optional_dependencies(tmp_path): files = { "requirements-docs.txt": "sphinx\n # comment\n", "pyproject.toml": cleandoc( """ [project] name = "myproj" version = "1.0" dynamic = ["optional-dependencies"] [tool.setuptools.dynamic.optional-dependencies.docs] file = ["requirements-docs.txt"] [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" """ ), } path.build(files, prefix=tmp_path) dist = Distribution() dist = apply_configuration(dist, tmp_path / "pyproject.toml") assert dist.extras_require == {"docs": ["sphinx"]} def test_mixed_dynamic_optional_dependencies(tmp_path): """ Test that if PEP 621 was loosened to allow mixing of dynamic and static configurations in the case of fields containing sub-fields (groups), things would work out. """ files = { "requirements-images.txt": "pillow~=42.0\n # comment\n", "pyproject.toml": cleandoc( """ [project] name = "myproj" version = "1.0" dynamic = ["optional-dependencies"] [project.optional-dependencies] docs = ["sphinx"] [tool.setuptools.dynamic.optional-dependencies.images] file = ["requirements-images.txt"] """ ), } path.build(files, prefix=tmp_path) pyproject = tmp_path / "pyproject.toml" with pytest.raises(ValueError, match="project.optional-dependencies"): apply_configuration(Distribution(), pyproject) def test_mixed_extras_require_optional_dependencies(tmp_path): files = { "pyproject.toml": cleandoc( """ [project] name = "myproj" version = "1.0" optional-dependencies.docs = ["sphinx"] """ ), } path.build(files, prefix=tmp_path) pyproject = tmp_path / "pyproject.toml" with pytest.warns(SetuptoolsWarning, match=".extras_require. overwritten"): dist = Distribution({"extras_require": {"hello": ["world"]}}) dist = apply_configuration(dist, pyproject) assert dist.extras_require == {"docs": ["sphinx"]}
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
downloads
DIR
-
drwxr-xr-x
2026-02-06 08:01:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2026-02-06 08:01:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
setupcfg_examples.txt
1.87 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_apply_pyprojecttoml.py
28.13 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_expand.py
8.72 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_pyprojecttoml.py
12.12 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_pyprojecttoml_dynamic_deps.py
3.19 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_setupcfg.py
32.64 KB
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2026-01-20 13:01:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).