%pyproject_wheel with test dependencies
Hi, I wanted to update python-pydyf to current version. The project has switched from setup.py to pyproject.toml. I run into an error while testing: pytest-3.8: error: unrecognized arguments: --flake8 --numprocesses=auto as probably some dependencies are not installed Is there a way to automate this. like in pip install pydyf[test] ? Thanks Axel
Hi Axel, Am 16.08.22 um 09:56 schrieb Axel Braun:
Hi,
I wanted to update python-pydyf to current version. The project has switched from setup.py to pyproject.toml. I run into an error while testing: pytest-3.8: error: unrecognized arguments: --flake8 --numprocesses=auto as probably some dependencies are not installed
Is there a way to automate this. like in pip install pydyf[test] ?
1. There is no guarantee that an upstream defines their test dependencies in an extra `[test]`. 2. Fedora has an automatic generator wich also works with extras [1], but we generally don't even use the generator for standard runtime dependencies in openSUSE [2]. 3. For packages where I know that it is used by consuming packages I manually define meta-subpackages for extras like python-jupyter-server-test which mirrors `jupyter-server[test]` [3]. 4. Unless we get the automatic buildtime dep generator mentioned in [2], runtime deps won't help you with buildtime test deps in a non-multibuild package. 5. Blindly pulling in `[dev]` or `[test]` dependencies will also pull in stuff we don't need in obs packaging like coverage and linters. 6. In your case: Remove the `--isort` and `--flake8` addopts from the pytest section in pyproject.toml and provide python-pytest-xdist for the `--numprocesses` flag.
Thanks Axel
- Ben [1] https://src.fedoraproject.org/rpms/pyproject-rpm-macros [2] https://lists.opensuse.org/archives/list/python@lists.opensuse.org/thread/WP... [3] https://build.opensuse.org/package/view_file/devel:languages:python:jupyter/...
participants (2)
-
Axel Braun
-
Ben Greiner