Commit 177fa58d authored by Christophe Benz's avatar Christophe Benz

Simplify the way setup.py version is handled

parent 8d088d4b
Pipeline #1103 failed with stage
in 4 minutes and 39 seconds
...@@ -11,13 +11,9 @@ readme_filepath = script_dir / 'README.md' ...@@ -11,13 +11,9 @@ readme_filepath = script_dir / 'README.md'
with readme_filepath.open('rt', encoding='utf-8') as fd: with readme_filepath.open('rt', encoding='utf-8') as fd:
LONG_DESCRIPTION = fd.read() LONG_DESCRIPTION = fd.read()
with (script_dir / 'validata_ui' / 'VERSION').open('rt', encoding='utf-8') as fd:
VERSION = fd.read().strip()
setup( setup(
name='validata_ui', name='validata_ui',
version=VERSION, version='0.2.5',
description='Validata Web UI', description='Validata Web UI',
long_description=LONG_DESCRIPTION, long_description=LONG_DESCRIPTION,
......
...@@ -19,9 +19,6 @@ from . import config ...@@ -19,9 +19,6 @@ from . import config
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
distribution = pkg_resources.get_distribution("validata-ui")
VERSION = distribution.version
def generate_schema_from_url_func(session): def generate_schema_from_url_func(session):
"""Generates a function that encloses session""" """Generates a function that encloses session"""
...@@ -109,8 +106,7 @@ app.register_blueprint(blueprint) ...@@ -109,8 +106,7 @@ app.register_blueprint(blueprint)
@app.context_processor @app.context_processor
def inject_version(): def inject_version():
global VERSION return {"validata_ui_version": pkg_resources.get_distribution("validata-ui").version}
return {"validata_ui_version": VERSION}
# Keep this import after app initialisation (to avoid cyclic imports) # Keep this import after app initialisation (to avoid cyclic imports)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment