Skip to content
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

Improve optional dependencies #172

Open
masklinn opened this issue Jan 7, 2024 · 1 comment
Open

Improve optional dependencies #172

masklinn opened this issue Jan 7, 2024 · 1 comment

Comments

@masklinn
Copy link
Contributor

masklinn commented Jan 7, 2024

Since master was migrated to pyproject.toml it has access to the much richer optional-dependencies system1, this is currently only used for the yaml dependency so tox and GHA must explicitly install other dependencies.

The following optional dependencies should be added:

  • all, should install all the non-dev optional dependencies (currently just yaml), this should be doable via self dependencies
  • test, should install pytest and all
  • check, should install the various checkers
  • dev should install both test and check, as well as tox since that is the dev runner

Thus:

  • it should be easier to maintain & test the dependency graph if new dependencies are added (e.g. consider switching to google-re2 and Filter #149, regex-based parser #166)
  • the GHA checker jobs can install check before running
  • the GHA test jobs can install test before running
  • the corresponding tox jobs can do the same
  • in the event of a contributor, it's easier to document what they can do, and easier for them to work it out or use it

Footnotes

  1. technically that was already available in setup.py via extras_require but it was never used

@masklinn
Copy link
Contributor Author

masklinn commented Jan 7, 2024

Issue: turns out you can't ask pip to install just the dependencies (yet?). This makes the addition a lot less useful for the primary use cases of GHA and tox, as they don't want to install the package itself via those means (especially not GHA where the package source — src, wheel, sdist — is part of the test matrix).

The solution until pypa/pip#11440 is implemented would be to compile the dependencies to a (bunch of) requirement files, or to install pip-tools and use that to compile requirements following jazzband/pip-tools#1681.

Neither option is great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant