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

Add a command to extract the version number #262

Open
exhuma opened this issue Apr 29, 2019 · 1 comment
Open

Add a command to extract the version number #262

exhuma opened this issue Apr 29, 2019 · 1 comment

Comments

@exhuma
Copy link

exhuma commented Apr 29, 2019

There are times where external tooling needs access to the version number of the package/application during the build step.

As is the case during the build step, the application is not yet installed at that point. Nor do you necessarily want to do that on the build environment (think: building in a remote pipeline).

I currently resorted to storing the version number in a <package>/version.txt file which I then read in the <package>/__init__.py file. This has the advantage that the version is available in a predictable location and is easily readablo by any external tool. It has the downside that it confuses pyinstaller.

flit already manages to extract the version number from the build process. And there is no need to specify it in the ptproject.toml file. Which is really nice.

But that means that there is no way to get to the version number from external tools. Before the pyproject.toml file switch, one could also do python setup.py --version which is also no longer possible.

It would be really nice if flit had a command to do just that.

Tangentially, there are other useful setup.py commands which help during build steps like --name and --fullname which I used to determine filenames of contents in the dist folder. With those it was however not possible to get the filename of a generated whl file. I think flit would be in a good position to offer those as well.

exhuma added a commit to exhuma/flit that referenced this issue May 1, 2019
@exhuma
Copy link
Author

exhuma commented May 20, 2019

Hmm... seems that only my commit got linked. The PR #263 was not linked. Here's to hoping that this comment will do just that 😉

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

1 participant