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'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
install .whl file in </install/prefix> using installer module
run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-hatch-requirements-txt-0.4.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-hatch-requirements-txt-0.4.1-2.fc37.x86_64/usr/lib/python3.10/site-packages+ /usr/bin/pytest -ra -m 'not network'============================= test session starts ==============================platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0Test session started at 11:20:00rootdir: /home/tkloczko/rpmbuild/BUILD/hatch-requirements-txt-0.4.1configfile: tox.iniplugins: datadir-1.5.0, regressions-2.5.0, timeout-2.3.1timeout: 300.0stimeout method: signaltimeout func_only: Falsecollected 58 itemstests/test_errors.py ....FFFF................ [ 41%]tests/test_metadata.py .................................. [100%]=================================== FAILURES ===================================_______________ test_not_dynamic_but_files_defined[build_wheel] ________________tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-205/test_not_dynamic_but_files_def0')build_func = <function build_wheel at 0x7fbfb2736d40> @pytest.mark.parametrize("build_func", [build_wheel, build_sdist]) def test_not_dynamic_but_files_defined(tmp_pathplus: PathPlus, build_func: Callable): dist_dir = tmp_pathplus / "dist" dist_dir.maybe_make() (tmp_pathplus / "pyproject.toml").write_clean(pyproject_toml.replace('dynamic = ["dependencies"]', '')) (tmp_pathplus / "requirements.txt").write_lines(["Foo", "bar", "# fizz", "baz>1"]) (tmp_pathplus / "README.md").touch() (tmp_pathplus / "LICENSE").touch() (tmp_pathplus / "demo").maybe_make() (tmp_pathplus / "demo" / "__init__.py").touch()
> with in_directory(tmp_pathplus), pytest.raises(ValueError, match=( r"^Cannot specify 'files' in \[tool.hatch.metadata.hooks.requirements_txt\] " r"when 'dependencies' is not listed in 'project.dynamic'.$" )):E Failed: DID NOT RAISE <class 'ValueError'>tests/test_errors.py:82: Failed_______________ test_not_dynamic_but_files_defined[build_sdist] ________________tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-205/test_not_dynamic_but_files_def1')build_func = <function build_sdist at 0x7fbfb2736c20> @pytest.mark.parametrize("build_func", [build_wheel, build_sdist]) def test_not_dynamic_but_files_defined(tmp_pathplus: PathPlus, build_func: Callable): dist_dir = tmp_pathplus / "dist" dist_dir.maybe_make() (tmp_pathplus / "pyproject.toml").write_clean(pyproject_toml.replace('dynamic = ["dependencies"]', '')) (tmp_pathplus / "requirements.txt").write_lines(["Foo", "bar", "# fizz", "baz>1"]) (tmp_pathplus / "README.md").touch() (tmp_pathplus / "LICENSE").touch() (tmp_pathplus / "demo").maybe_make() (tmp_pathplus / "demo" / "__init__.py").touch()
> with in_directory(tmp_pathplus), pytest.raises(ValueError, match=( r"^Cannot specify 'files' in \[tool.hatch.metadata.hooks.requirements_txt\] " r"when 'dependencies' is not listed in 'project.dynamic'.$" )):E Failed: DID NOT RAISE <class 'ValueError'>tests/test_errors.py:82: Failed______________ test_not_dynamic_but_filename_defined[build_wheel] ______________tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-205/test_not_dynamic_but_filename_0')build_func = <function build_wheel at 0x7fbfb2736d40> @pytest.mark.parametrize("build_func", [build_wheel, build_sdist]) def test_not_dynamic_but_filename_defined(tmp_pathplus: PathPlus, build_func: Callable): dist_dir = tmp_pathplus / "dist" dist_dir.maybe_make() new_pyproject_toml = pyproject_toml.replace('dynamic = ["dependencies"]', '').replace( 'files = ["requirements.txt"]', 'filename = "requirements.txt"' ) (tmp_pathplus / "pyproject.toml").write_clean(new_pyproject_toml) (tmp_pathplus / "requirements.txt").write_lines(["Foo", "bar", "# fizz", "baz>1"]) (tmp_pathplus / "README.md").touch() (tmp_pathplus / "LICENSE").touch() (tmp_pathplus / "demo").maybe_make() (tmp_pathplus / "demo" / "__init__.py").touch()
> with in_directory(tmp_pathplus), pytest.raises(ValueError, match=( r"^Cannot specify 'filename' in \[tool.hatch.metadata.hooks.requirements_txt\] " r"when 'dependencies' is not listed in 'project.dynamic'.$" )):E Failed: DID NOT RAISE <class 'ValueError'>tests/test_errors.py:105: Failed______________ test_not_dynamic_but_filename_defined[build_sdist] ______________tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-205/test_not_dynamic_but_filename_1')build_func = <function build_sdist at 0x7fbfb2736c20> @pytest.mark.parametrize("build_func", [build_wheel, build_sdist]) def test_not_dynamic_but_filename_defined(tmp_pathplus: PathPlus, build_func: Callable): dist_dir = tmp_pathplus / "dist" dist_dir.maybe_make() new_pyproject_toml = pyproject_toml.replace('dynamic = ["dependencies"]', '').replace( 'files = ["requirements.txt"]', 'filename = "requirements.txt"' ) (tmp_pathplus / "pyproject.toml").write_clean(new_pyproject_toml) (tmp_pathplus / "requirements.txt").write_lines(["Foo", "bar", "# fizz", "baz>1"]) (tmp_pathplus / "README.md").touch() (tmp_pathplus / "LICENSE").touch() (tmp_pathplus / "demo").maybe_make() (tmp_pathplus / "demo" / "__init__.py").touch()
> with in_directory(tmp_pathplus), pytest.raises(ValueError, match=( r"^Cannot specify 'filename' in \[tool.hatch.metadata.hooks.requirements_txt\] " r"when 'dependencies' is not listed in 'project.dynamic'.$" )):E Failed: DID NOT RAISE <class 'ValueError'>tests/test_errors.py:105: Failed============================= slowest 25 durations =============================0.02s call tests/test_metadata.py::test_build_files_in_subdirectory[build_sdist]0.02s call tests/test_metadata.py::test_build_files_in_subdirectory[build_wheel]0.02s call tests/test_errors.py::test_missing_requirements_txt[build_wheel]0.02s call tests/test_errors.py::test_not_dynamic_but_files_defined[build_wheel]0.01s call tests/test_metadata.py::test_optional_dependencies[build_sdist]0.01s call tests/test_metadata.py::test_build_with_files[build_sdist]0.01s call tests/test_metadata.py::test_build_unspecified[build_wheel]0.01s call tests/test_metadata.py::test_optional_dependencies[build_wheel]0.01s call tests/test_metadata.py::test_build_pip_compile_style[build_sdist]0.01s call tests/test_metadata.py::test_build_with_filename[build_wheel]0.01s call tests/test_metadata.py::test_build_unspecified[build_sdist]0.01s call tests/test_metadata.py::test_using_project_deps_and_optional_deps[build_sdist]0.01s call tests/test_metadata.py::test_build_with_files[build_wheel]0.01s call tests/test_metadata.py::test_build_comments[build_wheel]0.01s call tests/test_metadata.py::test_build_with_filename[build_sdist]0.01s call tests/test_metadata.py::test_build_comments[build_sdist]0.01s call tests/test_errors.py::test_no_files_or_filename_deprecation[build_wheel]0.01s call tests/test_metadata.py::test_build_pip_compile_style[build_wheel]0.01s call tests/test_errors.py::test_filename_deprecation[build_wheel]0.01s call tests/test_errors.py::test_filename_deprecation[build_sdist]0.01s call tests/test_metadata.py::test_using_project_deps_and_optional_deps[build_wheel]0.01s call tests/test_errors.py::test_not_dynamic_but_files_defined[build_sdist]0.01s call tests/test_errors.py::test_no_files_or_filename_deprecation[build_sdist]0.01s call tests/test_errors.py::test_not_dynamic_but_filename_defined[build_wheel]0.01s call tests/test_errors.py::test_not_dynamic_but_filename_defined[build_sdist]=========================== short test summary info ============================FAILED tests/test_errors.py::test_not_dynamic_but_files_defined[build_wheel] - Failed: DID NOT RAISE <class 'ValueError'>FAILED tests/test_errors.py::test_not_dynamic_but_files_defined[build_sdist] - Failed: DID NOT RAISE <class 'ValueError'>FAILED tests/test_errors.py::test_not_dynamic_but_filename_defined[build_wheel] - Failed: DID NOT RAISE <class 'ValueError'>FAILED tests/test_errors.py::test_not_dynamic_but_filename_defined[build_sdist] - Failed: DID NOT RAISE <class 'ValueError'>========================= 4 failed, 54 passed in 0.64s =========================
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesinstaller
modulecut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
List of installed modules in build env:
Please let me know if you need more details or want me to perform some diagnostics.
The text was updated successfully, but these errors were encountered: