Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Validata
Validata UI
Commits
721720cf
Commit
721720cf
authored
Jun 24, 2019
by
Christophe Benz
Browse files
Read version from text file
parent
eba5ec54
Pipeline
#1092
passed with stage
in 5 minutes and 1 second
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
721720cf
...
...
@@ -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 README.md file
readme_filepath
=
Path
(
__file__
).
parent
/
'README.md'
with
readme_filepath
.
open
(
'rt'
,
encoding
=
'utf-8'
)
as
fd_in
:
LONG_DESCRIPTION
=
fd_in
.
read
()
readme_filepath
=
script_dir
/
'README.md'
with
readme_filepath
.
open
(
'rt'
,
encoding
=
'utf-8'
)
as
fd
:
LONG_DESCRIPTION
=
fd
.
read
()
with
(
script_dir
/
'validata_ui'
/
'VERSION'
).
open
(
'rt'
,
encoding
=
'utf-8'
)
as
fd
:
VERSION
=
fd
.
read
()
setup
(
...
...
validata_ui/VERSION
0 → 100644
View file @
721720cf
0.2.1
validata_ui/__init__.py
View file @
721720cf
...
...
@@ -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):
@
app
.
context_processor
def
inject_version
():
global
VERSION
return
{
"validata_ui_version"
:
VERSION
}
...
...
validata_ui/version.py
deleted
100644 → 0
View file @
eba5ec54
VERSION
=
'0.2.1'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment