-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
109 lines (93 loc) · 3.45 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
"""Installation file for ansys-pre-commit-hooks."""
import os
import sys
from setuptools import find_namespace_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install
SCRIPT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "src", "ansys")
sys.path.append(os.path.dirname(SCRIPT_DIR))
from ansys.pre_commit_hooks.tech_review import JSON_URL, LICENSES_JSON, download_license_json
class CustomInstallCommand(install):
"""Custom install command to download the license json file."""
def run(self):
"""Download the license json file."""
install.run(self)
download_license_json(JSON_URL, LICENSES_JSON)
class CustomDevelopCommand(develop):
"""Custom develop command to download the license json file."""
def run(self):
"""Download the license json file."""
develop.run(self)
download_license_json(JSON_URL, LICENSES_JSON)
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, "src", "ansys", "pre_commit_hooks", "VERSION"), encoding="utf-8") as f:
version = f.read().strip()
# Get the long description from the README file
with open(os.path.join(HERE, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
description = "A Python wrapper to create Ansys-tailored pre-commit hooks"
setup(
name="ansys-pre-commit-hooks",
packages=find_namespace_packages(where="src", include="ansys*"),
package_dir={"": "src"},
version=version,
description=description,
long_description=long_description,
license="MIT",
author="ANSYS, Inc.",
author_email="[email protected]",
maintainer="ANSYS, Inc.",
maintainer_email="[email protected]",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Information Analysis",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
url="https://github.com/ansys/pre-commit-hooks",
python_requires=">=3.10,<4",
install_requires=[
"GitPython==3.1.44",
"importlib-metadata==8.6.1",
"Jinja2==3.1.6",
"reuse==5.0.2",
"requests==2.32.3",
"semver==3.0.4",
"toml==0.10.2",
],
extras_require={
"doc": [
"ansys-sphinx-theme[autoapi]==1.3.3",
"numpydoc==1.8.0",
"sphinx==8.2.3",
"sphinx-autodoc-typehints==3.1.0",
"sphinx-copybutton==0.5.1",
"sphinx_design==0.6.1",
],
"tests": [
"pytest==8.3.5",
"pytest-cov==6.1.1",
],
},
project_urls={
"Source": "https://github.com/ansys/pre-commit-hooks/",
"Tracker": "https://github.com/ansys/pre-commit-hooks/issues",
"Homepage": "https://github.com/ansys/pre-commit-hooks",
"Documentation": "https://pre-commit-hooks.docs.pyansys.com",
},
include_package_data=True,
cmdclass={
"develop": CustomDevelopCommand,
"install": CustomInstallCommand,
},
entry_points={
"console_scripts": [
"add-license-headers=ansys.pre_commit_hooks.add_license_headers:main",
"tech-review=ansys.pre_commit_hooks.tech_review:main",
],
},
)