-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
74 lines (56 loc) · 1.84 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
import os
from distutils import cmd
from setuptools import find_packages, setup
root_path = os.path.dirname(__file__)
def readfile(p):
with open(p) as f:
return f.read()
def read_reqs():
reqs_path = os.path.join(root_path, "requirements-package.in")
return readfile(reqs_path).split("\n")
def read_readme():
reqs_path = os.path.join(root_path, "README.md")
return readfile(reqs_path)
class BuildExeCommand(cmd.Command):
"""A custom command to build the executable."""
description = "run PyInstaller to generate the executable"
user_options = [] # type: ignore
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import PyInstaller.building.build_main
PyInstaller.building.build_main.main(
None,
os.path.join(os.path.dirname(__file__), "exe.spec"),
noconfirm=True,
distpath=os.path.join(os.path.dirname(__file__), "dist-exe"),
workpath=os.path.dirname(__file__),
clean_build=True,
)
setup(
name="converter",
version="0.0.1",
cmdclass={
"build_exe": BuildExeCommand,
},
packages=find_packages(exclude=("tests", "tests.*")),
package_data={"converter": ["data/mappings/*"], "": ["README.rst"]},
install_requires=read_reqs(),
entry_points="""
[console_scripts]
converter=converter.cli:cli
""",
long_description=read_readme(),
long_description_content_type="text/markdown",
url="https://github.com/OasisLMF/OasisDataconverter",
python_requires=">=3.8",
license="BSD 3-Clause License",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
],
)