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

fix: Specify Python version for some deps #116

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

nchz
Copy link
Contributor

@nchz nchz commented Sep 28, 2024

hi @danihodovic ,

i came across this issue when trying to contribute with some translations (there's a separate PR for them).

Context

when running poetry install i got:

pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock [--no-update]` to fix the lock file.

so i ran poetry lock, and i got this error (output truncated for readability):

Updating dependencies
Resolving dependencies... (5.5s)

The current project's supported Python range (>=3.8) is not compatible with some of the required packages Python requirement:
  - djlint requires Python <4.0,>=3.8, so it will not be satisfied for Python >=4.0
  - ... some more lines pretty similar

Because no versions of djlint match >1.34.1,<1.34.2 || >1.34.2,<1.35.0 || >1.35.0,<1.35.1 || >1.35.1,<1.35.2 || >1.35.2,<2.0.0
 and djlint (1.34.1) requires Python >=3.8.0,<4.0.0, djlint is forbidden.
... some more lines with "And because" then "djlint is forbidden".

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties

    For djlint, a possible solution would be to set the `python` property to ">=3.8,<4.0"
   ..... etc

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

i think the issue was introduced in the latest release 1.4.1, since i could validate it's not present in 1.4.0.

Solution

  • i first fixed the djlint dependency by specifying the Python version >=3.8,<4.0,
  • and then the fido2 library (seems it's a django-allauth dependency) thrown an equivalent error as above.
  • so i fixed it as well, and it made poetry happy.

please let me know if i should take any extra step to contribute in your project.

thanks a lot for creating this! really cool.

@nchz
Copy link
Contributor Author

nchz commented Sep 28, 2024

forgot to mention:

i tested this in Linux and MacOS, same issue on both.

@nchz nchz mentioned this pull request Oct 7, 2024
@nchz
Copy link
Contributor Author

nchz commented Oct 7, 2024

@danihodovic could you please re-run actions? i think my latest commit will pass all steps.

also, if you're ok with the fix, feel free to push a commit bumping the project's version if you want to use this same PR.

thanks.

@danihodovic danihodovic merged commit d6c8062 into danihodovic:master Oct 8, 2024
3 checks passed
@danihodovic
Copy link
Owner

Resolve conflicts in #117 (comment) and let's merge it

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 this pull request may close these issues.

2 participants