This repository has been archived by the owner on Sep 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
executable file
·97 lines (86 loc) · 2.69 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
if "test" in sys.argv:
version = "0.0.0"
else:
# Hackishly inject a constant into builtins to enable importing of the
# package even if numpy isn't installed. Only do this if we're not
# running the tests!
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
builtins.__EMCEE3_SETUP__ = True
import emcee3
version = emcee3.__version__
# Publish to PyPI.
if "publish" in sys.argv:
os.system("python setup.py sdist upload")
os.system("python setup.py bdist_wheel upload")
sys.exit()
# Push a new tag to GitHub.
if "tag" in sys.argv:
os.system("git tag -a {0} -m 'version {0}'".format(version))
os.system("git push --tags")
sys.exit()
# Testing.
class PyTest(TestCommand):
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
name="emcee3",
version=version,
author="Daniel Foreman-Mackey",
author_email="danfm@nyu.edu",
packages=[
"emcee3",
"emcee3.moves",
"emcee3.samplers",
"emcee3.pools",
"emcee3.backends",
],
url="http://dan.iel.fm/emcee3/",
license="MIT",
description="Kick ass affine-invariant ensemble MCMC sampling",
long_description=(open("README.rst").read() + "\n\n"
+ "Changelog\n"
+ "---------\n\n"
+ open("HISTORY.rst").read()),
package_data={"": ["LICENSE", "*.rst"]},
include_package_data=True,
install_requires=[
"numpy >= 1.7"
],
tests_require=[
"pytest",
"pytest-cov",
],
cmdclass = {"test": PyTest},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
],
)