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

Bug / question: why tomli dependency? #85

Closed
jamesbraza opened this issue Feb 20, 2024 · 4 comments
Closed

Bug / question: why tomli dependency? #85

jamesbraza opened this issue Feb 20, 2024 · 4 comments

Comments

@jamesbraza
Copy link
Contributor

0e3b5fc added toml as a dependency, which was later updated to tomli in 978e205.

Since flake8 itself doesn't integrate with TOML, why is toml/tomli a dependency of flake8-requirements? It seems unused:

git clone [email protected]:arkq/flake8-requirements.git
cd flake8-requirements
pip install -e .
pip uninstall -y tomli
python setup.py pytest
# All tests pass
@arkq
Copy link
Owner

arkq commented Feb 20, 2024

TOML support is required for pyproject.toml parsing. This library is required for python < 3.11

python setup.py pytest
# All tests pass

pytest setups test environment so it installs all missing packages (in that case tomli in case of python < 3.11)

@jamesbraza
Copy link
Contributor Author

jamesbraza commented Feb 20, 2024

TOML support is required for pyproject.toml parsing

This is true in general, but there's no pyproject.toml in this repo, and there's no pyproject.toml support for flake8 unless Flake8-requirements was installed (in which case, Flake8-requirements manages its own TOML dependency).

Also, pytest is a development-time dependency, and thus it's not needed to be installed as a required dependency of flake8-requirements.

Also, when one runs python setup.py pytest, fwiw it actually does not install toml/tomli.

@arkq
Copy link
Owner

arkq commented Feb 20, 2024

(in which case, Flake8-pyproject manages its own TOML dependency)

Yes, but flake8-requirements uses libtoml:
https://github.com/arkq/flake8-requirements/blob/master/src/flake8_requirements/checker.py#L15
https://github.com/arkq/flake8-requirements/blob/master/src/flake8_requirements/checker.py#L552

So, it HAS TO be a direct dependency of flake8-requirements. It also shall be a direct dependency of flake8-pyproject. Dependencies are not transitive, every project shall define its own direct dependencies.

@jamesbraza
Copy link
Contributor Author

Oh ha you're right it's actually used, nevermind to this.

We should run flake8-requirements on itself in CI, it could have prevented me from opening that PR. See: #87

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

Successfully merging a pull request may close this issue.

2 participants