-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
70 lines (57 loc) · 2.11 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""setup.py."""
import os
import shlex
from codecs import open
from subprocess import check_call
from warnings import warn
from setuptools import find_packages, setup
from setuptools.command.develop import develop
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
readme = f.read()
with open(os.path.join(here, "requirements.txt")) as f:
install_requires = f.readlines()
version_file = os.path.join(here, "rl_equation_solver", "version.py")
with open(version_file, encoding="utf-8") as f:
version = f.read()
version = version.split("=")[-1].strip().strip('"').strip("'")
class PostDevelopCommand(develop):
"""Class to run post setup commands."""
def run(self, show_deprecation: bool = False) -> None:
"""Run method that tries to install pre-commit hooks."""
try:
check_call(shlex.split("pre-commit install"))
except Exception as e:
warn(f"Unable to run 'pre-commit install': {e}")
develop.run(self)
setup(
name="RL-equation-solver",
version=version,
description="RL equation solver using deep Q networks implemented in PyTorch",
long_description=readme,
author="Brandon Benton, Kevin O'Keefe",
author_email="[email protected], [email protected]",
entry_points={"console_scripts": []},
url="https://github.com/RL-equation-solver",
packages=find_packages(),
package_dir={"RL-equation-solver": "rl_equation_solver"},
include_package_data=True,
license="MIT License",
zip_safe=False,
keywords="RL-equation-solver",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
test_suite="tests",
python_requires=">=3.9",
install_requires=install_requires,
extras_require={
"dev": ["pre-commit", "ruff", "isort", "black"],
},
cmdclass={"develop": PostDevelopCommand},
)