Skip to content

Commit 707d56e

Browse files
Refactor requirements.txt and use versioneer
1 parent 7363618 commit 707d56e

File tree

10 files changed

+2446
-62
lines changed

10 files changed

+2446
-62
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
symbolic_pymc/_version.py export-subst

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ matrix:
1212

1313
install:
1414
- pip install -r requirements.txt
15-
- pip install -r requirements-dev.txt
16-
- if [[ $NAME == UNIT ]]; then pip install coveralls; fi
1715
- pip freeze
1816

1917
script:

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include versioneer.py
2+
include symbolic_pymc/_version.py

requirements-dev.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

requirements.txt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
scipy>=1.2.0
2-
Theano>=1.0.4
3-
pymc4 @ git+https://github.com/pymc-devs/pymc4.git@master#egg=pymc4-0.0.1
4-
tfp-nightly==0.9.0.dev20191003
5-
tf-nightly-2.0-preview==2.0.0.dev20191002
6-
tensorflow-estimator-2.0-preview>=1.14.0.dev2019090801
7-
pymc3>=3.6
8-
multipledispatch>=0.6.0
9-
logical-unification>=0.2.2
10-
miniKanren>=0.2.5
11-
cons>=0.1.3
12-
toolz>=0.9.0
13-
sympy>=1.3
14-
cachetools
1+
-e ./
2+
coveralls
3+
pydocstyle>=3.0.0
4+
pytest>=5.0.0
5+
pytest-cov>=2.6.1
6+
pytest-html>=1.20.0
7+
pylint>=2.3.1
8+
black>=19.3b0; platform.python_implementation!='PyPy'
9+
diff-cover
10+
ipython
11+
versioneer

setup.cfg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
[versioneer]
2+
VCS = git
3+
style = pep440
4+
versionfile_source = symbolic_pymc/_version.py
5+
versionfile_build = symbolic_pymc/_version.py
6+
tag_prefix = v
7+
parentdir_prefix = symbolic-pymc-
8+
19
[pydocstyle]
210
# Ignore errors for missing docstrings.
311
# Ignore D202 (No blank lines allowed after function docstring)
@@ -11,6 +19,11 @@ filterwarnings =
1119
ignore:the imp module is deprecated:DeprecationWarning:
1220
ignore:Using a non-tuple sequence:FutureWarning:theano\.tensor
1321

22+
[coverage:run]
23+
omit =
24+
symbolic_pymc/_version.py
25+
tests/*
26+
1427
[coverage:report]
1528
exclude_lines =
1629
pragma: no cover

setup.py

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
2-
import codecs
3-
import re
2+
import versioneer
3+
44
from pathlib import Path
55

66
from setuptools import setup, find_packages
@@ -11,47 +11,60 @@
1111
README_FILE = PROJECT_ROOT / "README.md"
1212
VERSION_FILE = PROJECT_ROOT / "symbolic_pymc" / "__init__.py"
1313

14-
NAME = "Symbolic PyMC"
15-
DESCRIPTION = "Symbolic mathematics for PyMC"
14+
NAME = "symbolic-pymc"
15+
DESCRIPTION = "Tools for symbolic math in PyMC"
1616
AUTHOR = "PyMC Developers"
1717
AUTHOR_EMAIL = "[email protected]"
1818
URL = ("https://github.com/pymc-devs/symbolic-pymc",)
1919

2020

21-
def get_requirements():
22-
with codecs.open(REQUIREMENTS_FILE) as buff:
23-
return buff.read().splitlines()
24-
25-
2621
def get_long_description():
27-
with codecs.open(README_FILE, "rt") as buff:
22+
with open(README_FILE, "rt") as buff:
2823
return buff.read()
2924

3025

31-
def get_version():
32-
lines = open(VERSION_FILE, "rt").readlines()
33-
version_regex = r"^__version__ = ['\"]([^'\"]*)['\"]"
34-
for line in lines:
35-
mo = re.search(version_regex, line, re.M)
36-
if mo:
37-
return mo.group(1)
38-
raise RuntimeError("Unable to find version in %s." % (VERSION_FILE,))
39-
40-
41-
if __name__ == "__main__":
42-
setup(
43-
name=NAME,
44-
version=get_version(),
45-
description=DESCRIPTION,
46-
author=AUTHOR,
47-
author_email=AUTHOR_EMAIL,
48-
url=URL,
49-
install_requires=get_requirements(),
50-
packages=find_packages(exclude=['tests']),
51-
tests_require=[
52-
'pytest'
53-
],
54-
long_description=get_long_description(),
55-
long_description_content_type="text/markdown",
56-
include_package_data=True,
57-
)
26+
setup(
27+
name=NAME,
28+
version=versioneer.get_version(),
29+
cmdclass=versioneer.get_cmdclass(),
30+
description=DESCRIPTION,
31+
author=AUTHOR,
32+
author_email=AUTHOR_EMAIL,
33+
url=URL,
34+
install_requires=[
35+
"scipy>=1.2.0",
36+
"Theano>=1.0.4",
37+
"tf-nightly-2.0-preview==2.0.0.dev20191002",
38+
"tf-nightly==2.1.0.dev20191003",
39+
"tensorflow-estimator-2.0-preview>=1.14.0.dev2019090801",
40+
"tfp-nightly==0.9.0.dev20191003",
41+
"multipledispatch>=0.6.0",
42+
"logical-unification>=0.2.2",
43+
"miniKanren>=0.2.5",
44+
"cons>=0.1.3",
45+
"toolz>=0.9.0",
46+
"sympy>=1.3",
47+
"cachetools",
48+
"pymc3>=3.6",
49+
"pymc4 @ git+https://github.com/pymc-devs/pymc4.git@master#egg=pymc4-0.0.1",
50+
],
51+
packages=find_packages(exclude=["tests"]),
52+
tests_require=["pytest"],
53+
long_description=get_long_description(),
54+
long_description_content_type="text/markdown",
55+
include_package_data=True,
56+
python_requires=">=3.6",
57+
classifiers=[
58+
"Development Status :: 3 - Alpha",
59+
"Intended Audience :: Science/Research",
60+
"Intended Audience :: Developers",
61+
"Operating System :: OS Independent",
62+
"Programming Language :: Python",
63+
"Programming Language :: Python :: 3",
64+
"Programming Language :: Python :: 3.6",
65+
"Programming Language :: Python :: 3.7",
66+
"Programming Language :: Python :: Implementation :: CPython",
67+
"Programming Language :: Python :: Implementation :: PyPy",
68+
"Topic :: Software Development :: Libraries",
69+
],
70+
)

symbolic_pymc/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# We need this so that `multipledispatch` initialization occurs
22
from .unify import *
33

4-
__version__ = "0.0.1"
4+
from ._version import get_versions
5+
6+
__version__ = get_versions()["version"]
7+
del get_versions

0 commit comments

Comments
 (0)