8000 Add internal version info by riga · Pull Request #2760 · spotify/luigi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 9 commits into from
Nov 26, 2019
Merged

Add internal version info #2760

merged 9 commits into from
Nov 26, 2019

Conversation

riga
Copy link
Contributor
@riga riga commented Aug 10, 2019

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

import luigi
luigi.__version__

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 either luigid or luigi has that feature, and since I didn't want to interfere with the argument parsing in cmdline_parser.py, I added it to luigid.

Tests

I added a command line test that calls luigid --version and checks the output.

# load meta package infos
meta = {}
with open("luigi/__meta__.py", "r") as f:
exec(f.read(), meta)
Copy link
Contributor Author

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.

@dlstadther
Copy link
Collaborator

Could you also update the note in release-process.rst if we're moving where the version is stored?

Copy link
Collaborator
@dlstadther dlstadther left a 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.

Copy link
Contributor 8000
@Tarrasch Tarrasch left a 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

@honnix
Copy link
Member
honnix commented Aug 26, 2019

I agree with @Tarrasch . Is it needed?

@riga
Copy link
Contributor Author
riga commented Sep 23, 2019

Sorry for the long pause.

Personally, I only need to access the version information on the luigi module itself, so I'm fine of course with removing it again from luigid.

@riga
Copy link
Contributor Author
riga commented Oct 25, 2019

Kind ping =)

@honnix
Copy link
Member
honnix commented Oct 29, 2019

@dlstadther LGTM. We will adapt the release process a bit.

8000
@honnix honnix merged commit 229a659 into spotify:master Nov 26, 2019
drowoseque pushed a commit to drowoseque/luigi that referenced this pull request Nov 26, 2019
* 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
@honnix
Copy link
Member
honnix commented Jun 2, 2020

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.

@riga
Copy link
Contributor Author
riga commented Jun 2, 2020

@honnix Sure, I will look into this asap.

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

Successfully merging this pull request may close these issues.

4 participants
0