Commit 721720cf authored by Christophe Benz's avatar Christophe Benz
Browse files

Read version from text file

parent eba5ec54
Pipeline #1092 passed with stage
in 5 minutes and 1 second
......@@ -4,12 +4,15 @@ from pathlib import Path
from setuptools import setup
from validata_ui.version import VERSION
script_dir = Path(__file__).parent
# Gets the long description from the file
readme_filepath = Path(__file__).parent / ''
with'rt', encoding='utf-8') as fd_in:
readme_filepath = script_dir / ''
with'rt', encoding='utf-8') as fd:
with (script_dir / 'validata_ui' / 'VERSION').open('rt', encoding='utf-8') as fd:
......@@ -8,16 +8,18 @@ from urllib.parse import quote_plus
import cachecontrol
import flask
import jinja2
import opendataschema
import pkg_resources
import requests
import tableschema
import opendataschema
from . import config
from .version import VERSION
log = logging.getLogger(__name__)
distribution = pkg_resources.get_distribution("validata-ui")
VERSION = distribution.version
def generate_schema_from_url_func(session):
"""Generates a function that encloses session"""
......@@ -91,6 +93,7 @@ def urlencode(context, value):
def inject_version():
global VERSION
return {"validata_ui_version": VERSION}
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