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

feat: Allow copier-templates-extensions as an extra #1633

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented May 8, 2024

This allows pipx users to use this:

pipx install copier[templates-extensions]

Or this:

pipx run copier[templates-extensions] <args>

Instead of this:

pipx install copier
pipx inject copier copier-templates-extensions

I think this was mentioned a while back, but never added.

I'm not very familiar with non-PEP 621 backends (Poetry. Just Poetry.), so hopefully I got the syntax correct. Also not sure if you want a min version here.

Copy link
Member

@sisp sisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! But the poetry.lock file needs to be updated:

poetry lock --no-update

@henryiii
Copy link
Contributor Author

henryiii commented May 8, 2024

The current project's supported Python range (>=3.8) is not compatible with some of the required packages Python requirement:
  - copier-templates-extensions requires Python >=3.6.1,<3.10, so it will not be satisfied for Python >=3.10
  - copier-templates-extensions requires Python >=3.6.1,<3.10, so it will not be satisfied for Python >=3.10
  - copier-templates-extensions requires Python >=3.6.2,<3.11, so it will not be satisfied for Python >=3.11

Because no versions of copier-templates-extensions match <0.1.0 || >0.1.0,<0.1.1 || >0.1.1,<0.2.0 || >0.2.0,<0.3.0 || >0.3.0
 and copier-templates-extensions (0.1.0) requires Python >=3.6.1,<3.10, copier-templates-extensions is forbidden.
And because copier-templates-extensions (0.1.1) requires Python >=3.6.1,<3.10, copier-templates-extensions is forbidden.
And because copier-templates-extensions (0.2.0) requires Python >=3.6.2,<3.11
 and copier-templates-extensions (0.3.0) depends on copier (>=6), every version of copier-templates-extensions requires copier (>=6).
So, because copier depends on copier-templates-extensions (*)
 and copier is 0.0.0, version solving failed.

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

    For copier-templates-extensions, a possible solution would be to set the `python` property to ">=3.8,<3.10"
    For copier-templates-extensions, a possible solution would be to set the `python` property to ">=3.8,<3.10"
    For copier-templates-extensions, a possible solution would be to set the `python` property to ">=3.8,<3.11"

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

@henryiii
Copy link
Contributor Author

henryiii commented May 8, 2024

(The stuff about limits is bogus, because older versions used to have Python caps, that's not the correct solution and would result in the wrong solve)

@henryiii
Copy link
Contributor Author

henryiii commented May 8, 2024

I could probably just change the dummy version number, not sure if there's a better way to fix this with the poetry-dynamic-versioning hack. Edit: I did that, can try something else if someone has a different suggestion.

@sisp
Copy link
Member

sisp commented May 8, 2024

I assume you installed the poetry-dynamic-versioning plugin, right? If so, it seems that Poetry's dependency resolver does not consider the version computed by the plugin but instead simply uses the version from the metadata. I wonder whether the plugin could be extended to let Poetry use the computed version during dependency resolution. Then, hardcoding a sufficiently high though arbitrary version in our metadata would not be necessary.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
Copy link
Contributor Author

henryiii commented May 8, 2024

I assume you installed the poetry-dynamic-versioning plugin, right?

Ah, no, I was just using my brew-installed poetry, which doesn't support adding plugins. I just unlinked my poetry with brew, then installed poetry with pipx and injected the plugin. That fixed it. Other tools (like PDM or Hatch) usually respect your build-system.requires, but Poetry plugins apparently don't.

Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.39%. Comparing base (4ffd143) to head (db24619).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1633      +/-   ##
==========================================
+ Coverage   97.20%   97.39%   +0.19%     
==========================================
  Files          48       48              
  Lines        4728     4728              
==========================================
+ Hits         4596     4605       +9     
+ Misses        132      123       -9     
Flag Coverage Δ
unittests 97.39% <ø> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sisp
Copy link
Member

sisp commented May 8, 2024

Nice! The RTD build is failing because poetry-dynamic-versioning is not installed there. This should be fixed by adding poetry self add "poetry-dynamic-versioning[plugin]" to .readthedocs.yml after Poetry is installed. I'm not sure why the two CI / flake-check ... checks are failing though.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
Copy link
Contributor Author

henryiii commented May 9, 2024

Okay, fixed readthedocs. On the nix jobs (CI / flake-check), it's still giving:

Run copier --version
/Users/runner/work/_temp/ede4b13e-8f0d-4491-9ff7-7771f5b39c64.sh: line 1: copier: command not found

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.

None yet

2 participants