Skip to content

Commit 5a74cd8

Browse files
author
juanitorduz
committed
fix version setting
1 parent 42dfe78 commit 5a74cd8

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

requirements-test.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
-r requirements.txt
2-
31
pytest
42
pytest-cov

setup.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,30 @@
22

33
from setuptools import find_packages, setup
44

5-
from causalpy.version import __version__
6-
75
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
86
README_FILE = os.path.join(PROJECT_ROOT, "README.md")
9-
VERSION_FILE = os.path.join(PROJECT_ROOT, "bambi", "version.py")
7+
VERSION_FILE = os.path.join(PROJECT_ROOT, "causalpy", "version.py")
108
REQUIREMENTS_FILE = os.path.join(PROJECT_ROOT, "requirements.txt")
9+
TEST_REQUIREMENTS_FILE = os.path.join(PROJECT_ROOT, "requirements-test.txt")
1110

1211

1312
def get_long_description():
1413
with open(README_FILE, encoding="utf-8") as f:
1514
return f.read()
1615

1716

18-
# get version
19-
# sys.path.insert(0, os.path.abspath("../"))
20-
# from causalpy.version import __version__
21-
exec(open("causalpy/version.py").read())
22-
17+
with open(VERSION_FILE) as f:
18+
version = f.read().split("=")[-1].strip().strip('"')
2319

2420
with open(REQUIREMENTS_FILE) as f:
2521
install_reqs = f.read().splitlines()
2622

23+
with open(TEST_REQUIREMENTS_FILE) as f:
24+
tests_reqs = f.read().splitlines()
25+
2726
setup(
2827
name="CausalPy",
29-
version=__version__,
28+
version=version,
3029
description="Causal inference for quasi-experiments in Python",
3130
long_description=get_long_description(),
3231
long_description_content_type="text/markdown",
@@ -37,5 +36,5 @@ def get_long_description():
3736
python_requires=">=3.8",
3837
maintainer="Benjamin T. Vincent",
3938
install_requires=install_reqs,
40-
# tests_require=test_reqs,
39+
tests_require=tests_reqs,
4140
)

0 commit comments

Comments
 (0)