Skip to content
Snippets Groups Projects
Commit 1851beee authored by Nikolay Stanchev's avatar Nikolay Stanchev
Browse files

Redactors test module setup.py

parent f28a4570
No related branches found
No related tags found
No related merge requests found
include MANIFEST.in include VERSION
recursive-include clmctest _version.py *.yml *.yaml *.sh *.json *.conf recursive-include clmctest *.yml *.yaml *.sh *.json *.conf
\ No newline at end of file \ No newline at end of file
__version__ = "1.2.0"
\ No newline at end of file
...@@ -27,32 +27,41 @@ import os.path ...@@ -27,32 +27,41 @@ import os.path
from setuptools import setup, find_packages from setuptools import setup, find_packages
def read(fname): def get_version(*relative_path):
return open(os.path.join(os.path.dirname(__file__), fname)).read() """
Reads and parses a version file.
:param relative_path: iterable representing the relative path to the version file
:return:
"""
fname = os.path.join(os.path.dirname(__file__), *relative_path)
def get_version(fname):
if os.path.isfile(fname): if os.path.isfile(fname):
git_revision = read(fname) with open(fname) as f: # Use context managers when opening files, otherwise file handlers might not be properly closed
version = {}
# execute the version file and put its content in the version dictionary
exec(f.read(), version)
# extract the __version__ variable from the dictionary, if not found use default value "SNAPSHOT"
git_revision = version.get("__version__", "SNAPSHOT")
else: else:
git_revision = "SNAPSHOT" git_revision = "SNAPSHOT"
return git_revision return git_revision
setup( setup(
name = "clmctest", name="clmctest",
version = get_version("_version.py"), version=get_version("VERSION"),
author = "Michael Boniface", author="Michael Boniface",
author_email = "mjb@it-innovation.soton.ac.uk", author_email="mjb@it-innovation.soton.ac.uk",
description = "FLAME CLMC Test Module", description="FLAME CLMC Test Module",
license = "https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc/blob/integration/LICENSE", license="https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc/blob/integration/LICENSE",
keywords = "FLAME CLMC", keywords="FLAME CLMC",
url='https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc', url='https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc',
packages=find_packages(exclude=["services"]), packages=find_packages(),
include_package_data=True, include_package_data=True,
package_data={'': ['_version.py', '*.yml', '*.yaml', '*.sh', '*.json', '*.conf']}, long_description="FLAME CLMC Test",
long_description="FLAME CLMC",
classifiers=[ classifiers=[
"Development Status :: Alpha", "Development Status :: Alpha",
"Topic :: FLAME Tests", "Topic :: FLAME Tests",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment