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

when packing pdm the version given at the stdout is not the same as the one given when doing --version #27

Closed
franzhaas opened this issue Dec 15, 2022 · 3 comments

Comments

@franzhaas
Copy link
Contributor

I can see the version of pdm used listed on stdout when creating the zipapp, but when running the zip app with --version, I get a different version.

To Reproduce
git checkout 2.3.3
pdm add pdm-packer
pdm pack
---------8<---------8<---------8<---------8<---------8<---------
...
[2022-12-15T20:38:56.771Z] v Install pdm 2.3.3+d20221215 successful
[2022-12-15T20:38:56.771Z]
[2022-12-15T20:38:56.771Z] All complete!
[2022-12-15T20:38:56.771Z]
[2022-12-15T20:38:56.771Z] Packages are prepared at xx
[2022-12-15T20:38:56.771Z] Creating zipapp...
[2022-12-15T20:38:57.026Z] Zipapp is generated at pdm.pyz
[2022-12-15T20:38:57.586Z] pdm.pyz --version
[2022-12-15T20:38:58.947Z] PDM, version 0.0.0+local
---------8<---------8<---------8<---------8<---------8<---------

I would have expected the version to be 2.3.3+d20221215, or 2.3.3 but not 0.0.0+local

Is this expected? What would I need to do to get the version to be 2.3.3+packedbymyorgnamehere?

Thanks in advance,
Franz

@frostming
Copy link
Owner

Yes, when being packed in a zipapp, the version string can't be determined, because PDM doesn't write the version in a static file.

@franzhaas
Copy link
Contributor Author

Ok, if pdm doesnt do it, as far as I can tell a horrible hack would be to write the version of choice into

src/pdm/verison.py

Any recommendation how to do this properly? Would it make more sense to do this as a pdm plugin? or integrate it into pdm-packer?

@frostming
Copy link
Owner

No, it was resolved upstream: pdm-project/pdm@a6871d2

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

No branches or pull requests

2 participants