Skip to content

Commit

Permalink
Adding Python 3.6 versioning separate from Python 2.7 along with tox.…
Browse files Browse the repository at this point in the history
…ini file
  • Loading branch information
ericsuh committed Mar 15, 2020
1 parent 1e5c9a0 commit 1529943
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 20 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Dirichlet-distributed data sets are likely to be from the same distribution
or from two different ones, much like a chi-square or G-test for independence,
but with Dirichlet models.

Simplex Plots
-------------

The `dirichlet.simplex` module creates scatter, contour, and filled contour 2-simplex plots.

Caveats
-------

Expand All @@ -32,3 +37,5 @@ Installation
------------

pip install git+https://github.com/ericsuh/dirichlet.git

Note: this has only been tested with Python 2.7+ and Python 3.6+. Other versions may work, but they haven't been tested.
60 changes: 40 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
#!/usr/bin/env python
#
# This file is subject to the terms and conditions defined in file
# 'LICENSE.txt', which is part of this source code package.
# "LICENSE.txt", which is part of this source code package.

import sys
from setuptools import setup, find_packages

setup(
name='dirichlet',
version='0.7',
description='Calculates Dirichlet test and plots 2-simplex Dirichlets',
author='Eric Suh',
author_email='[email protected]',
packages=['dirichlet'],
# Note, any changes here should be replicated in the `tox.ini` file

py_version = sys.version_info[:2]
if not (py_version >= (2, 6) and py_version <= (2, 7) or
py_version >= (3, 6)):
raise Exception("Only supports Python versions 2.6 to 2.7 and >= 3.6")
if py_version < (3, 0): # Python 2.6 or 2.7
install_requires = [
'scipy >= 0.10.1',
'numpy >= 1.6.2',
'matplotlib >= 1.2.0',
],
url='http://github.com/ericsuh/dirichlet',
download_url='https://github.com/ericsuh/dirichlet/zipball/master',
"scipy >= 0.10.1, <1.3",
"numpy >= 1.6.2, <1.17",
"matplotlib >= 1.2.0, <2.3",
]
else: # Python 3.6+
install_requires = [
"scipy >= 1.4.1",
"numpy >= 1.18.1",
"matplotlib >= 3.2.0",
]

setup(
name="dirichlet",
version="0.8",
description="Calculates Dirichlet test and plots 2-simplex Dirichlets",
author="Eric Suh",
author_email="[email protected]",
packages=["dirichlet"],
install_requires = install_requires,
url="http://github.com/ericsuh/dirichlet",
download_url="https://github.com/ericsuh/dirichlet/zipball/master",
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Operating System :: OS Independent',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
],

long_description="""\
Expand Down
34 changes: 34 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[tox]
envlist = py{27-oldest,27-newest,36}

[testenv]
deps =
pytest
commands = pytest {posargs}

[testenv:py27-oldest]
description = Python 2.7 with oldest compatible versions of dependencies
deps =
{[testenv]deps}
commands_pre =
pip install numpy==1.6.2
pip install scipy==0.10.1
pip install matplotlib==1.2.0
commands =
pytest {posargs}

[testenv:py27-newest]
description = Python 2.7 with newest compatible versions of dependencies
deps =
{[testenv]deps}
scipy == 1.2.*
numpy == 1.16.*
matplotlib == 2.2.*

[testenv:py36]
description = Python 3.6 with newest compatible versions of dependencies
deps =
{[testenv]deps}
scipy == 1.4.*
numpy == 1.18.*
matplotlib == 3.2.*

0 comments on commit 1529943

Please sign in to comment.