How to resolve a variable that has a dependency #2341
Unanswered
waterworthd-cim
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a python project that uses uv and we use aws codeartifact as a private pypi repository. In my pyproject.toml I have an entry that sets the codeartifact repo, i.e.
A side-effect of this is any use of uvx to run other build tools requires codeartifact authentication.
I'm trying to build a docker image tagged with the current project version
Here
codeartifact:login
is an imported taskfile that auth's with codeartifact and updates a .env file with the various vars required.My issue is because I'm using
DOCKER_TAG: sh: uvx --from commitizen cz version -p
appears to execute beforedeps
but it's dependent oncodeartifact:login
A secondary issue is I have various other imported taskfiles (commitizen, pre-commit etc) and in each I've used
uvx
to invoke the tool. But then in each of these I have to import my codeartifact taskfile again (as internal) and make each imported task also depend on codeartifact:login - so it gets called multiple timesI have two questions:
How can I set {{.DOCKER_TAG}} by running
uvx --from commitizen cz version -p
such that I can ensurecodeartifact:login
has been run first?Can I set
codeartifact:login
to be some sort of global dependency that's always run before any task is excecuted and any variable resolved?Finally is there a better/canonical approach to this issue?
(what I really wanted to do is create a
cz:version
task that's depended oncodeartifact:login
that executesuvx --from commitizen cz version -p
and "returns" the output to{{.DOCKER_TAG}}
but taskfile doesn't appear to work that wayBeta Was this translation helpful? Give feedback.
All reactions