-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
123 lines (97 loc) · 3.61 KB
/
setup.py
File metadata and controls
123 lines (97 loc) · 3.61 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env python
"""
A setuptools based setup module generated from the xBrite Sample Package.
See:
* https://github.com/xBrite/sample-python-package
* https://packaging.python.org/en/latest/distributing.html
* https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
import os
import sys
import re
# Package configuration should all be defined here for easy access.
# Update these values as best fits your particular package.
name = "dotscad"
description = "dotscad python tools for OpenSCAD"
author = "Chris Petersen"
# author_email = "sorry@youdontget.this"
url = "https://github.com/dotscad/python-dotscad"
license = "MIT License"
keywords = "dotscad,OpenSCAD"
classifiers = [
# CHANGEME: Update the classifiers as appropriate
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
f"License :: {license}",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
]
setup_requires = ()
install_requires = setup_requires + ()
tests_require = install_requires # + ("pytest", "pytest-runner", "tox")
dependency_links = (
# CHANGEME: Install any private dependency links here.
)
entry_points = {
# CHANGEME: Set up any appropriate entry points here, e.g. console_scripts
# 'console_scripts': [
# 'sample_script = sample_package.example_script:main',
# ],
}
# Setting this to true will make sure any binaries in MANIFEST.in
# get included with the package when it is distributed.
# See: http://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files
include_package_data = True
# Minimum python version required
min_python_version = (3, 6)
################################################
# Please try not to touch things below this line
################################################
if sys.version_info < min_python_version:
error = f"ERROR: {name} requires Python Version {min_python_version} or above...exiting."
print >>sys.stderr, error
sys.exit(1)
HERE = os.path.abspath(os.path.dirname(__file__))
MODULE_PATH = os.path.join(HERE, name.replace("-", "_"))
# Get the long description from the README file
with open(os.path.join(HERE, "README.md"), encoding="utf-8") as f:
long_description = f.read()
# Load the version by reading the package directly, so we don't run into
# dependency loops by importing it into setup.py
version = None
with open(os.path.join(MODULE_PATH, "__init__.py")) as file:
for line in file:
m = re.search(r"\b(?:__version__|VERSION)\b\s*=\s*(.+?)$", line)
if m:
version = eval(m.group(1))
break
assert version is not None, "Couldn't find version string."
setup(
name=name,
version=version,
description=description,
long_description=long_description,
author=author,
# author_email=author_email,
url=url,
license=license,
classifiers=classifiers,
keywords=keywords,
setup_requires=setup_requires,
# This package only installs its base module, and a bunch of dependencies
packages=find_packages(exclude=["contrib", "docs", "tests"]),
include_package_data=include_package_data,
install_requires=install_requires,
dependency_links=dependency_links,
entry_points=entry_points,
# In order to keep tox *and* setup happy, we need to define the test requirements twice...
extras_require={"test": tests_require},
tests_require=tests_require,
test_suite="py.test",
)