forked from pbrod/numdifftools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
69 lines (51 loc) · 1.64 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for numdifftools.
This file was generated with PyScaffold 2.4.2, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
Usage:
Run all tests:
python setup.py test
python setup.py doctests
Build documentation
python setup.py docs
Install
python setup.py install [, --prefix=$PREFIX]
Build
python setup.py bdist_wininst
python setup.py bdist_wheel --universal
python setup.py sdist
PyPi upload:
git pull origin
git tag v0.9.16 master
git shortlog v0.9.15..v0.9.16 > log.txt # update Changes.rst
git commit
git tag v0.9.17 master
python setup.py sdist
python setup.py bdist_wheel --universal
python setup.py egg_info
git push --tags
twine -p PASSWORD upload dist/*
"""
import sys
from setuptools import setup
def print_version():
import pkg_resources
try:
__version__ = pkg_resources.get_distribution("numdifftools").version
with open("__conda_version__.txt","w") as fid:
fid.write(__version__)
except pkg_resources.DistributionNotFound:
__version__ = 'unknown'
print("Version: {}".format(__version__))
def setup_package():
needs_sphinx = {'build_sphinx', 'upload_docs'}.intersection(sys.argv)
sphinx = ['sphinx', 'numpydoc', 'sphinx_rtd_theme>=0.1.7'] if needs_sphinx else []
setup(setup_requires=['six', 'pyscaffold>=2.4rc1,<2.5a0'] + sphinx,
tests_require=['pytest_cov', 'pytest', 'hypothesis', 'matplotlib'],
use_pyscaffold=True)
print_version()
if __name__ == "__main__":
setup_package()