-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add dynamic versioning #25
Conversation
I can only test this (I think) after merging the PR and creating a new project. The code itself I'm assuming is tested in linkml via linkml/linkml#1048 ? |
I have marked this as a draft for now and will update it once linkml/linkml#1053 is confirmed to work. |
{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml
Outdated
Show resolved
Hide resolved
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
run: pip install poetry poetry-dynamic-versioning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This installs poetry into the same env as the project env which can become a problem if poetry´s dependencies contradict the ones in your project. In this pipeline this is no problem because you don't need to install to build.
However, in the other pipelines where you do install
- https://github.com/linkml/linkml-project-cookiecutter/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/.github/workflows/main.yaml
- https://github.com/linkml/linkml-project-cookiecutter/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/.github/workflows/deploy-docs.yaml
I would suggest to use pipx to achieve isolation between poetry and the project. For pipx (which is available by default) the poetry-install section would look like:
- name: Install Poetry
run: |
pipx install poetry
pipx inject poetry poetry-dynamic-versioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that different workflows in this project (main.yaml
, deploy-docs.yaml
) are contained in independent environments. Isn't that true?
I have made changes but without pipx
and seems to work with linkml. I'm hesitant using another package (in addition to pip
and poetry
). I hope you understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I would also pip install here. I just wanted to show the alternative.
Yes, the other workflows are isolated from this one. That is why I thought using pipx here has no advantage. It would only make sense in the other two workflows. But everyone weights the arguments pro/contra pipx that is better isolation vs. using yet another tool, differently.
Fixes linkml/linkml#1051 (comment)