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

Figure out a way to have /-/version return current git commit hash #273

Closed
simonw opened this issue May 18, 2018 · 2 comments
Closed

Figure out a way to have /-/version return current git commit hash #273

simonw opened this issue May 18, 2018 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented May 18, 2018

https://fivethirtyeight.datasettes.com/-/versions reports Datasette version 0.21

This isn't actually correct. The deploy script for that site actually deploys current master using https://github.com/simonw/datasette/archive/master.zip: https://github.com/simonw/fivethirtyeight-datasette/blob/66b4b0dfedd7237bc8c02d3e26d905bca7b84069/Dockerfile#L9

Ideally this would show the current commit hash, but I'm not at all sure if it's possible to derive that from pip install https://github.com/simonw/datasette/archive/master.zip. Is there another mechanism that could be used to reliably pip install current master but still provide access to the most recent commit hash?

@rgieseke
Copy link
Contributor

rgieseke commented May 18, 2018

Shouldn't versioneer do that?

E.g. 0.21+2.g1076c97

You'd need to install via pip install git+https://github.com/simow/datasette.git though, this does a temp git clone.

@simonw
Copy link
Owner Author

simonw commented May 22, 2018

That looks great. I don't think it's possible to derive the current commit version from the .zip downloaded directly from GitHub, so needing to pip install via git+https feels reasonable to me.

simonw pushed a commit that referenced this issue May 22, 2018
Repo:
https://github.com/warner/python-versioneer

Versioneer Licence:
Public Domain (CC0-1.0)

Closes #273
simonw added a commit to simonw/fivethirtyeight-datasette that referenced this issue May 23, 2018
Thanks to simonw/datasette#273 Datasette now uses
versioneer which means we can get the correct version number reported even if
we install from master.

To take advantage of this we need to git clone latest master and then build it
using setup.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants