-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add internal version info #2760
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
Conversation
# load meta package infos | ||
meta = {} | ||
with open("luigi/__meta__.py", "r") as f: | ||
exec(f.read(), meta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One could also do sth like
sys.path.insert(0, "luigi")
import __meta__ as meta
sys.path.pop(0)
I have no strong preference here.
Could you also update the note in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good here.
@honnix Could you and some folks at Spotify confirm your approval? Since this will impact y'alls releases (such as today), i feel you should approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this but I would also poke someone at Spotify to review this.
Also, I would not add the --version
command line support unless you actually need it. I'm afraid we might later regret that we put it on luigid
I agree with @Tarrasch . Is it needed? |
Sorry for the long pause. Personally, I only need to access the version information on the |
Kind ping =) |
@dlstadther LGTM. We will adapt the release process a bit. |
* Add __meta__ module to store package data. * Add --version to luigid, add test. * Fix test. * Change version description in RELEASE-PROCESS.rst. * Remove version parameter from luigid. * use latest version
Sorry for backing to this PR. Not entirely sure it is caused by the change here, but since https://pypi.org/project/luigi/2.8.11/ we have lost all metadata in pypi, and 2.8.11 is the first release including this change. @riga Would you mind taking a look at this? Thanks. |
@honnix Sure, I will look into this asap. |
Description, Motivation and Context
This PR adds version (and meta) infos to the luigi package itself, and by extension provides them to packages built on top of luigi. E.g. the version can be queried now by doing
which is standard in many other packages as well.
The current luigi version is only known in
setup.py
at the time of building the package. Therefore,I added
__meta__.py
which contains meta package information like version number, author, license etc. This file is used by both the setup file and the luigi package itself, so that there is only one place where versions are bumped.Also, this allows for having a
--version
parameter on the command line. I think it is sufficient if eitherluigid
orluigi
has that feature, and since I didn't want to interfere with the argument parsing incmdline_parser.py
, I added it toluigid
.Tests
I added a command line test that calls
luigid --version
and checks the output.