-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
60 lines (45 loc) · 1.8 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
# see https://github.com/karlicoss/pymplate for up-to-date reference
from setuptools import setup, find_namespace_packages # type: ignore
def main():
# works with both ordinary and namespace packages
pkgs = find_namespace_packages('src')
pkg = min(pkgs) # lexicographically smallest is the correct one usually?
setup(
name=pkg,
use_scm_version={
'version_scheme': 'python-simplified-semver',
'local_scheme': 'dirty-tag',
},
setup_requires=['setuptools_scm'],
zip_safe=False,
packages=pkgs,
package_dir={'': 'src'},
# necessary so that package works with mypy
package_data={pkg: ['py.typed']},
## ^^^ this should be mostly automatic and not requiring any changes
install_requires=[
'stackapi',
'backoff',
# vvv example of git repo dependency
# 'repo @ git+https://github.com/karlicoss/repo.git',
# vvv example of local file dependency. yes, DUMMY is necessary for some reason
# 'repo @ git+file://DUMMY/path/to/repo',
],
extras_require={
'testing': ['pytest'],
'linting': ['pytest', 'mypy', 'lxml'], # lxml for mypy coverage report
},
# this needs to be set if you're planning to upload to pypi
# url='',
# author='',
# author_email='',
# description='',
# Rest of the stuff -- classifiers, license, etc, I don't think it matters for pypi
# it's just unnecessary duplication
)
if __name__ == '__main__':
main()
# TODO
# from setuptools_scm import get_version
# https://github.com/pypa/setuptools_scm#default-versioning-scheme
# get_version(version_scheme='python-simplified-semver', local_scheme='no-local-version')