Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flame
flame-clmc
Commits
1851beee
Commit
1851beee
authored
6 years ago
by
Nikolay Stanchev
Browse files
Options
Downloads
Patches
Plain Diff
Redactors test module setup.py
parent
f28a4570
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/test/MANIFEST.in
+2
-2
2 additions, 2 deletions
src/test/MANIFEST.in
src/test/VERSION
+1
-0
1 addition, 0 deletions
src/test/VERSION
src/test/setup.py
+24
-15
24 additions, 15 deletions
src/test/setup.py
with
27 additions
and
17 deletions
src/test/MANIFEST.in
+
2
−
2
View file @
1851beee
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
This diff is collapsed.
Click to expand it.
src/test/VERSION
0 → 100644
+
1
−
0
View file @
1851beee
__version__ = "1.2.0"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/test/setup.py
+
24
−
15
View file @
1851beee
...
@@ -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
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment