Skip to content

Commit 58f1470

Browse files
committed
single sourcing the package version
1 parent 74714a1 commit 58f1470

File tree

7 files changed

+117
-35
lines changed

7 files changed

+117
-35
lines changed

docs/source/conf.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,28 @@
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
13+
import codecs
1314
import os
15+
import os.path
1416
import sphinx_rtd_theme
1517
import sys
1618

19+
20+
def read(rel_path):
21+
here = os.path.abspath(os.path.dirname(__file__))
22+
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
23+
return fp.read()
24+
25+
26+
def get_version(rel_path):
27+
for line in read(rel_path).splitlines():
28+
if line.startswith('__version__'):
29+
delim = '"' if '"' in line else "'"
30+
return line.split(delim)[1]
31+
else:
32+
raise RuntimeError("Unable to find version string.")
33+
34+
1735
sys.path.insert(0, os.path.abspath('../..'))
1836
sys.setrecursionlimit(1500)
1937

@@ -24,9 +42,9 @@
2442
author = 'WorkflowHub Team'
2543

2644
# The short X.Y version
27-
version = '0.1-dev'
45+
version = get_version("../../workflowhub/__init__.py")
2846
# The full version, including alpha/beta/rc tags
29-
release = '0.1-dev'
47+
release = get_version("../../workflowhub/__init__.py")
3048

3149
# -- General configuration ---------------------------------------------------
3250

docs/source/index.rst

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ provides a collection of tools for:
1010
generation; and
1111
- Generating synthetic realistic workflow traces.
1212

13+
----
14+
15+
.. toctree::
16+
:caption: Quickstart
17+
:maxdepth: 2
18+
19+
quickstart_installation.rst
20+
1321
.. toctree::
1422
:caption: User Guide
1523
:maxdepth: 2
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Installation
2+
============
3+
4+
WorkflowHub is available on `PyPI <https://pypi.org/project/workflowhub>`_.
5+
WorkflowHub requires Python3.3+ and has been tested on Linux and macOS.
6+
7+
Installation using Pip
8+
----------------------
9+
10+
While `pip` can be used to install WorkflowHub, we suggest the following
11+
approach for reliable installation when many Python environments are available:
12+
13+
.. code-block:: bash
14+
15+
$ python3 -m pip install workflowhub

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[metadata]
2+
description-file = README.md

setup.py

+71-30
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,76 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright (c) 2020 The WorkflowHub Team.
5+
#
6+
# This program is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
11+
import codecs
12+
import os.path
13+
114
from setuptools import setup, find_packages
215

3-
with open("README.md", "r") as fh:
4-
long_description = fh.read()
16+
17+
def read(rel_path):
18+
here = os.path.abspath(os.path.dirname(__file__))
19+
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
20+
return fp.read()
21+
22+
23+
def get_version(rel_path):
24+
for line in read(rel_path).splitlines():
25+
if line.startswith('__version__'):
26+
delim = '"' if '"' in line else "'"
27+
return line.split(delim)[1]
28+
else:
29+
raise RuntimeError("Unable to find version string.")
30+
31+
32+
with open('README.md', 'r') as fh:
33+
long_description = fh.read()
534

635
setup(
7-
name="workflowhub",
8-
version="0.1",
9-
author="WorkflowHub team",
10-
author_email="[email protected]",
11-
description="Community Framework for Enabling Scientific Workflow Research and Education",
12-
long_description=long_description,
13-
long_description_content_type="text/markdown",
14-
url="https://github.com/workflowhub/workflowhub",
15-
packages=find_packages(),
16-
classifiers=[
17-
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
18-
"Operating System :: OS Independent",
19-
"Programming Language :: Python :: 3",
20-
"Programming Language :: Python :: 3.3",
21-
"Programming Language :: Python :: 3.4",
22-
"Programming Language :: Python :: 3.5",
23-
"Programming Language :: Python :: 3.6",
24-
"Programming Language :: Python :: 3.7",
25-
"Programming Language :: Python :: 3.8",
26-
"Programming Language :: Python :: 3.9",
27-
"Intended Audience :: Developers",
28-
"Intended Audience :: Education",
29-
"Intended Audience :: Science/Research",
30-
"Natural Language :: English",
31-
"Topic :: Documentation :: Sphinx",
32-
"Topic :: System :: Distributed Computing"
33-
],
34-
python_requires='>=3.3',
36+
name='workflowhub',
37+
version=get_version("workflowhub/__init__.py"),
38+
license='GPLv3',
39+
author='WorkflowHub team',
40+
author_email='[email protected]',
41+
description='Community Framework for Enabling Scientific Workflow Research and Education',
42+
long_description=long_description,
43+
long_description_content_type='text/markdown',
44+
url='https://github.com/workflowhub/workflowhub',
45+
packages=find_packages(),
46+
install_requires=[
47+
'jsonschema',
48+
'matplotlib',
49+
'networkx',
50+
'numpy',
51+
'pygraphviz',
52+
'python-dateutil',
53+
'requests',
54+
'scipy',
55+
'setuptools'
56+
],
57+
classifiers=[
58+
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
59+
'Operating System :: OS Independent',
60+
'Programming Language :: Python :: 3',
61+
'Programming Language :: Python :: 3.3',
62+
'Programming Language :: Python :: 3.4',
63+
'Programming Language :: Python :: 3.5',
64+
'Programming Language :: Python :: 3.6',
65+
'Programming Language :: Python :: 3.7',
66+
'Programming Language :: Python :: 3.8',
67+
'Programming Language :: Python :: 3.9',
68+
'Intended Audience :: Developers',
69+
'Intended Audience :: Education',
70+
'Intended Audience :: Science/Research',
71+
'Natural Language :: English',
72+
'Topic :: Documentation :: Sphinx',
73+
'Topic :: System :: Distributed Computing'
74+
],
75+
python_requires='>=3.3',
3576
)

workflowhub/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# the Free Software Foundation, either version 3 of the License, or
99
# (at your option) any later version.
1010

11-
__version__ = "0.1-dev"
11+
__version__ = "0.2"
1212
__author__ = 'WorkflowHub Team - https://workflowhub.org'
1313
__credits__ = 'University of Southern California, University of Hawaii at Manoa'
1414

workflowhub/trace/trace.py

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
from ..common.workflow import Workflow
2727
from ..utils import read_json
2828

29-
limits = plt.axis('off')
30-
3129

3230
class Trace:
3331
"""Representation of one execution of one workflow on a set of machines

0 commit comments

Comments
 (0)