Skip to content

Commit

Permalink
setup.py: explicitly list dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Nov 9, 2022
1 parent a0f754a commit 3f742f3
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions setup.py
Expand Up @@ -6,24 +6,14 @@

module_dir = os.path.dirname(os.path.abspath(__file__))

# Requirements
reqs_file = os.path.join(module_dir, "requirements.txt")
with open(reqs_file) as f:
reqs_raw = f.read()
reqs_list = [r.replace("==", ">=") for r in reqs_raw.split("\n")]

# Optional requirements
extras_file = os.path.join(module_dir, "requirements-optional.txt")
with open(extras_file) as f:
extras_raw = f.read()
extras_raw = [r for r in extras_raw.split("##") if r.strip() and "#" not in r]
extras_dict = {}
for req in extras_raw:
items = [i.replace("==", ">=") for i in req.split("\n") if i.strip()]
dependency_name = items[0].strip()
dependency_reqs = [i.strip() for i in items[1:] if i.strip()]
extras_dict[dependency_name] = dependency_reqs
extras_list = [r for d in extras_dict.values() for r in d]
extras_require = {
"mpds": ["ujson", "jmespath", "httplib2", "ase"],
"dscribe": ["dscribe"],
"mdfforge": ["mdf-forge"],
"aflow": ["aflow"],
"citrine": ["citrination-client"]
}
tests_require = [r for v in extras_require.values() for r in v]

if __name__ == "__main__":
setup(
Expand All @@ -39,8 +29,20 @@
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=reqs_list,
extras_require=extras_dict,
install_requires=[
"numpy>=1.20.1",
"requests",
"pandas",
"tqdm",
"pymongo",
"future",
"scikit_learn",
"sympy",
"monty",
"pymatgen",
"jsonschema"
],
extras_require=extras_require,
classifiers=[
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
Expand All @@ -52,6 +54,6 @@
'Topic :: Other/Nonlisted Topic',
'Topic :: Scientific/Engineering'],
test_suite='matminer',
tests_require=extras_list,
tests_require=tests_require,
scripts=[]
)

0 comments on commit 3f742f3

Please sign in to comment.