Skip to content

Commit

Permalink
Add internal version info (spotify#2760)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
riga authored and m.slavoshevski@cian.ru committed Nov 26, 2019
1 parent b446e49 commit 9227d7e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion RELEASE-PROCESS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ For maintainers of Luigi, who have push access to pypi. Here's how you upload
Luigi to pypi.

#. Make sure [twine](https://pypi.org/project/twine/) is installed ``pip install twine``.
#. Update version number in `setup.py`.
#. Update version number in `luigi/__meta__.py`.
#. Commit, perhaps simply with a commit message like ``Version x.y.z``.
#. Push to GitHub at [spotify/luigi](https://github.com/spotify/luigi).
#. Clean up previous distributions by executing ``rm -rf dist``
Expand Down
5 changes: 4 additions & 1 deletion luigi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
Package containing core luigi functionality.
"""

from luigi.__meta__ import __version__

from luigi import task
from luigi.task import Task, Config, ExternalTask, WrapperTask, namespace, auto_namespace

Expand Down Expand Up @@ -58,7 +60,8 @@
'FloatParameter', 'BoolParameter', 'TaskParameter',
'ListParameter', 'TupleParameter', 'EnumParameter', 'DictParameter',
'configuration', 'interface', 'local_target', 'run', 'build', 'event', 'Event',
'NumericalParameter', 'ChoiceParameter', 'OptionalParameter', 'LuigiStatusCode'
'NumericalParameter', 'ChoiceParameter', 'OptionalParameter', 'LuigiStatusCode',
'__version__',
]

if not configuration.get_config().has_option('core', 'autoload-range'):
Expand Down
11 changes: 11 additions & 0 deletions luigi/__meta__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coding: utf-8

"""
Workflow mgmgt + task scheduling + dependency resolution.
"""

__author__ = 'The Luigi Authors'
__contact__ = 'https://github.com/spotify/luigi'
__license__ = 'Apache License 2.0'
__version__ = '2.8.10'
__status__ = 'Production'
15 changes: 10 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,19 @@ def get_static_files(path):
install_requires = [x for x in install_requires if not x.startswith('python-daemon')]
install_requires.append('sphinx>=1.4.4') # Value mirrored in doc/conf.py

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

setup(
name='luigi',
version='2.8.10',
description='Workflow mgmgt + task scheduling + dependency resolution',
version=meta['__version__'],
description=meta['__doc__'],
long_description=long_description,
author='The Luigi Authors',
url='https://github.com/spotify/luigi',
license='Apache License 2.0',
author=meta['__author__'],
url=meta['__contact__'],
license=meta['__license__'],
packages=[
'luigi',
'luigi.configuration',
Expand Down

0 comments on commit 9227d7e

Please sign in to comment.