2
2
3
3
from setuptools import find_packages , setup
4
4
5
- from causalpy .version import __version__
6
-
7
5
PROJECT_ROOT = os .path .dirname (os .path .realpath (__file__ ))
8
6
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" )
10
8
REQUIREMENTS_FILE = os .path .join (PROJECT_ROOT , "requirements.txt" )
9
+ TEST_REQUIREMENTS_FILE = os .path .join (PROJECT_ROOT , "requirements-test.txt" )
11
10
12
11
13
12
def get_long_description ():
14
13
with open (README_FILE , encoding = "utf-8" ) as f :
15
14
return f .read ()
16
15
17
16
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 ('"' )
23
19
24
20
with open (REQUIREMENTS_FILE ) as f :
25
21
install_reqs = f .read ().splitlines ()
26
22
23
+ with open (TEST_REQUIREMENTS_FILE ) as f :
24
+ tests_reqs = f .read ().splitlines ()
25
+
27
26
setup (
28
27
name = "CausalPy" ,
29
- version = __version__ ,
28
+ version = version ,
30
29
description = "Causal inference for quasi-experiments in Python" ,
31
30
long_description = get_long_description (),
32
31
long_description_content_type = "text/markdown" ,
@@ -37,5 +36,5 @@ def get_long_description():
37
36
python_requires = ">=3.8" ,
38
37
maintainer = "Benjamin T. Vincent" ,
39
38
install_requires = install_reqs ,
40
- # tests_require=test_reqs ,
39
+ tests_require = tests_reqs ,
41
40
)
0 commit comments