-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
56 lines (44 loc) · 1.52 KB
/
setup.py
File metadata and controls
56 lines (44 loc) · 1.52 KB
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
# coding=utf-8
from os.path import dirname
from os.path import join
from urllib.parse import urljoin
from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install
from casm.attribute import __author__
from casm.attribute import __author_email__
from casm.attribute import __description__
from casm.attribute import __project__
from casm.attribute import __urlhome__
from casm.attribute import __version__
__urlcode__ = __urlhome__
__urldocs__ = __urlhome__
__urlbugs__ = urljoin(__urlhome__, "issues")
def all_requirements():
def read_requirements(path: str):
with open(path, "r", encoding="utf-8") as rhdl:
return rhdl.read().splitlines()
path: str = join(dirname(__file__), "requirements.txt")
requirements = read_requirements(path)
return requirements
class CustomInstallCommand(install):
"""Customized setuptools install command"""
def run(self):
install.run(self) # Run the standard installation
# Execute your custom code after installation
setup(
name=__project__,
version=__version__,
description=__description__,
url=__urlhome__,
author=__author__,
author_email=__author_email__,
project_urls={"Source Code": __urlcode__,
"Bug Tracker": __urlbugs__,
"Documentation": __urldocs__},
packages=find_packages(include=["casm*"], exclude=["casm.unittest"]),
install_requires=all_requirements(),
cmdclass={
"install": CustomInstallCommand,
}
)