-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
pdm show --version no longer prints actual version number when version is dynamic #1753
Comments
It was changed to read the |
Would it be possible to have a flag on the show command to allow the user to choose to see the dynamic values that would be computed? I kinda understand the desire to keep the responsibilities of each piece of the system clear . It's just super useful to be able to see what version number PDM would use for a build without actually having to run a full build of a wheel to see what value comes out. Obviously I could have behaviour in a plugin, but it just seems like the sort of thing that would be really useful to have by default, at least as an option. |
@MasterNayru A possible solution is to get the metadata from the installed copy in the current environment, which also doesn't need a build. However, the metadata may be outdated until you run |
Looks like I am able to get the information I want by just specifying the name of the package that I am building in the show command like: |
Make sure you run commands with
-v
flag before pasting the output.Steps to reproduce
Use a dynamic field and attempt to retrieve its computed value using
pdm show
. For example, have the following set in pyproject.toml:Then run
pdm show --version
. I have been using this command to pull out the version stored in version.py in a CI setup, so breaking this behaviour is currently causing me to be unable to obtain the version number from the project, which I was able to do using that command up until v2.4.7 was released.Actual behavior
Prints DYNAMIC
Expected behavior
The command looks to have been intentionally changed to show this string in v2.4.7 but showed what it used to show in v2.4.6.
I mean, with all due respect, what it's showing in v2.4.7 may well be the expected behaviour from a big picture standpoint but what I really expect is that this behaviour would not change in a patch release. I can't see any reference to this project following SemVer strictly in the README but it's just leaving a really bad taste in my mouth.
Ideally, the behaviour would be reverted, at least within this minor release but I do understand the motivation to have the command print out what the actual defined metadata of the project is. If this were the existing behaviour, I would probably expect to have a flag that could produce the dynamic values for the project. Given that the block that defines where to pull the version number from is a pdm tool block, I would expect pdm to at least have a command that could make use of this config block to pull the version number out.
Environment Information
The text was updated successfully, but these errors were encountered: