Skip to content

Commit e380f93

Browse files
Merge pull request #96 from brandonwillard/update-unification-dependency
Update dependencies and use versioneer
2 parents bc7a580 + f159544 commit e380f93

38 files changed

+3157
-787
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

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ ignore-mixin-members=yes
263263
# (useful for modules/projects where namespaces are manipulated during runtime
264264
# and thus existing member attributes cannot be deduced by static analysis. It
265265
# supports qualified module names, as well as Unix pattern matching.
266-
ignored-modules=tensorflow.core.framework,tensorflow.python.framework,tensorflow.python.ops.gen_linalg_ops
266+
ignored-modules=tensorflow.core.framework,tensorflow.python.framework,tensorflow.python.ops.gen_linalg_ops,tensorflow.python.eager.context,tensorflow.compat.v1
267267

268268
# List of classes names for which member attributes should not be checked
269269
# (useful for classes with attributes dynamically set). This supports can work

.travis.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
dist: xenial
22
language: python
33

4-
matrix:
5-
include:
6-
- name: "Python 3.6 Lint"
7-
python: 3.6
8-
env: PYTHON_VERSION=3.6 NAME="LINT"
9-
- name: "Python 3.6 Unit Test"
10-
python: 3.6
11-
env: PYTHON_VERSION=3.6 NAME="UNIT"
4+
python:
5+
- "3.6"
6+
- "3.7"
7+
# No tf-nightly for this version
8+
# - "3.8"
9+
# Cython and/or Numpy fails with permission errors
10+
# - "pypy3"
1211

1312
install:
1413
- pip install -r requirements.txt
15-
- pip install -r requirements-dev.txt
16-
- if [[ $NAME == UNIT ]]; then pip install coveralls; fi
17-
- pip freeze
1814

1915
script:
20-
- if [[ $NAME == UNIT ]]; then pytest -v tests/ --cov=symbolic_pymc/; fi
21-
- if [[ $NAME == LINT ]]; then make lint; fi
16+
- pylint symbolic_pymc/ tests/
17+
- if [[ `command -v black` ]]; then
18+
black --check symbolic_pymc tests;
19+
fi
20+
- pytest -v tests/ --cov=symbolic_pymc/
2221

2322
after_success:
24-
- echo $(pwd)
25-
- ls -la
26-
- if [[ $NAME == UNIT ]]; then sed -i 's/\/opt\/symbolic-pymc/\/home\/travis\/build\/pymc-devs\/symbolic-pymc/g' .coverage; fi
27-
- if [[ $NAME == UNIT ]]; then coveralls; fi
23+
- coveralls

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

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ format:
5151

5252
style:
5353
@printf "Checking code style with pylint...\n"
54-
pylint symbolic_pymc/
54+
pylint symbolic_pymc/ tests/
5555
@printf "\033[1;34mPylint passes!\033[0m\n\n"
5656

5757
black: # Format code in-place using black.
58-
black symbolic_pymc/
58+
black symbolic_pymc/ tests/
5959

6060
test: # Test code using pytest.
6161
pytest -v tests/ --cov=symbolic_pymc/ --cov-report=xml --html=testing-report.html --self-contained-html

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-
kanren @ git+https://github.com/pymc-devs/kanren.git@symbolic-pymc#egg=kanren-0.2.3
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 = "pymc.devs@gmail.com"
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)