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

First poetry install does not include dynamic version #47

Closed
uSpike opened this issue May 7, 2021 · 4 comments
Closed

First poetry install does not include dynamic version #47

uSpike opened this issue May 7, 2021 · 4 comments
Labels
question Further information is requested

Comments

@uSpike
Copy link

uSpike commented May 7, 2021

Using Poetry version 1.1.5, poetry-dynamic-versioning 0.12.6, my pyproject.toml contains:

[tool.poetry]
name = "mylib"
version = "0"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
format = "0.1.2+{commit}"

[tool.poetry.dependencies]
poetry-dynamic-versioning = "^0.12.6"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=0.12.6"]
build-backend = "poetry.core.masonry.api"

When I first clone my repository and poetry install, the installed version of mylib is 0.

Installing the current project: mylib (0)

If I run poetry install again, then the version is correctly set to 0.1.2+<hash>.

No dependencies to install or update                                                                                                      
                                                                                                                                          
Installing the current project: mylib (0.1.2+b0703a2)     
@mtkennerly mtkennerly added the question Further information is requested label May 10, 2021
@mtkennerly
Copy link
Owner

Hi! If you don't have the plugin installed globally and you're just relying on the entry in tool.poetry.dependencies, then the plugin won't become available until Poetry has installed it in the virtual environment. It's not given any kind of preferential treatment to be installed before everything else, so it has to wait like any other dependency, and by then it's too late to activate during the first run.

I did confirm that the plugin activates during an initial poetry install if the plugin is installed globally.

Also, you would probably want to put the plugin in dev-dependencies instead.

@uSpike
Copy link
Author

uSpike commented May 11, 2021

Hi, what does installed globally mean? Poetry installed via get-poetry.py is installed into its own environment which isn't really accessible for the user. A package such as this installed globally via pip will not be accessible by poetry.

@uSpike
Copy link
Author

uSpike commented May 11, 2021

Nevermind, seems like this is a hole in the the current way of doing things and also the new plugin system: python-poetry/poetry#693 (comment)

@mtkennerly
Copy link
Owner

When you install Poetry with get-poetry.py, the Poetry launcher script basically adds its vendored dependencies (along with the Poetry module itself) onto the PYTHONPATH and then launches Python as normal, so it's not completely isolated from your global Python libraries. If you install the plugin with pip install poetry-dynamic-versioning, it can indeed work with Poetry regardless of which way Poetry was installed. The plugin is regularly tested with both Poetry installation methods as part of the GitHub workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants