Closed vancromy closed 6 months ago
I have also unzipped the poetry generated wheel file and cannot find the _version.py file in the wheel.
I'm not able to reproduce that behavior. I see the generated file in the wheel, and the wheel's RECORD file also has an entry for it.
I'm using Poetry 1.5.1 and Python 3.10.7 on Windows 11. What's your environment?
I installed the plugin with
poetry self add ...
Just to confirm, did you specify the [plugin]
feature? (poetry self add "poetry-dynamic-versioning[plugin]"
)
Hi @mtkennerly, thanks for the quick reply.
I am running macOS 14.2.1 (BuildVersion 23C71) and using pyenv installed python version 3.11.5, poetry version 1.7.1.
Yes I installed with the [plugin]
extra. Here's the output of poetry self show poetry-dynamic-versioning
:
I just reproed it with the same config as above. The _version.py
file is created after a poetry install
but does not exist in the built wheels. I used poetry build --format wheel
to generate the wheel file. See attached screenshot:
Ah! After a bit of debugging I realised this was due to the fact that I am gitignoring the file and since I did not add it via the include
keyword in the tool.poetry
section, it wasn't making it into the build. Could be this is a novice mistake from me but it may be worth having a short note about this in the README?
Good catch! I've added a note to the README.
Hello,
I have a use case where I do not want to git track my version file and instead want it to be generated on install (regardless of whether poetry or pip are used). If I run
poetry install
the desired_version.py
file is created and has the correct version. But if I runpip install path-to-poetry-built-wheel.whl
that file is not created and I get import issues in my package. I have also unzipped the poetry generated wheel file and cannot find the_version.py
file in the wheel.I installed the plugin with
poetry self add ...
and here is my pyproject.toml file: