Skip to content

Commit 9bb5c40

Browse files
authored
Merge pull request #71 from mje-nz/fix-dependencies
Specify dependencies correctly in setup.py (fix #70)
2 parents 0a68639 + 464e37f commit 9bb5c40

File tree

3 files changed

+17
-70
lines changed

3 files changed

+17
-70
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ install:
2222
- conda config --add channels conda-forge
2323
- conda create -n testenv --yes pip python=$PYTHON matplotlib
2424
- source activate testenv
25-
- pip install pytest==4.3
26-
- pip install .
25+
- pip install .[dev]
2726

2827

2928
script: pytest dabest

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![Free-to-view citation](https://zenodo.org/badge/DOI/10.1038/s41592-019-0470-3.svg)](https://rdcu.be/bHhJ4)
77
[![License](https://img.shields.io/badge/License-BSD%203--Clause--Clear-orange.svg)](https://spdx.org/licenses/BSD-3-Clause-Clear.html)
88

9+
910
## About
1011

1112
DABEST is a package for **D**ata **A**nalysis using **B**ootstrap-Coupled **EST**imation.
@@ -22,21 +23,12 @@ An estimation plot has two key features.
2223

2324
DABEST powers [estimationstats.com](https://www.estimationstats.com/), allowing everyone access to high-quality estimation plots.
2425

25-
## Requirements
26-
27-
DABEST has been tested on Python 3.5, 3.6, and 3.7.
28-
29-
In addition, the following packages are also required:
30-
- [numpy](https://www.numpy.org) (1.15)
31-
- [scipy](https://www.scipy.org) (1.2)
32-
- [matplotlib](https://www.matplotlib.org) (3.0)
33-
- [seaborn](https://seaborn.pydata.org) (0.9)
34-
- [pandas](https://pandas.pydata.org) (0.24).
35-
36-
To obtain these package dependencies easily, it is highly recommended to download the [Anaconda distribution](https://www.continuum.io/downloads) of Python.
3726

3827
## Installation
3928

29+
This package is tested on Python 3.5, 3.6, and 3.7.
30+
It is highly recommended to download the [Anaconda distribution](https://www.continuum.io/downloads) of Python in order to obtain the dependencies easily.
31+
4032
You can install this package via `pip`.
4133

4234
To install, at the command line run
@@ -56,6 +48,7 @@ Then, navigate to the cloned repo in the command line and run
5648
pip install .
5749
```
5850

51+
5952
## Usage
6053

6154
```python3
@@ -99,6 +92,7 @@ All contributions are welcome; please read the [Guidelines for contributing](htt
9992

10093
We also have a [Code of Conduct](https://github.com/ACCLAB/DABEST-python/blob/master/CODE_OF_CONDUCT.md) to foster an inclusive and productive space.
10194

95+
10296
## Acknowledgements
10397

10498
We would like to thank alpha testers from the [Claridge-Chang lab](https://www.claridgechang.net/): [Sangyu Xu](https://github.com/sangyu), [Xianyuan Zhang](https://github.com/XYZfar), [Farhan Mohammad](https://github.com/farhan8igib), Jurga Mituzaitė, and Stanislav Ott.

setup.py

Lines changed: 10 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -27,62 +27,7 @@
2727
"""
2828

2929

30-
# Modified from from setup.py in seaborn.
31-
try:
32-
from setuptools import setup
33-
except ImportError:
34-
from distutils.core import setup
35-
36-
37-
38-
def need_to_install(module, version):
39-
desired_major_version = int(version.split('.')[0])
40-
desired_minor_version = int(version.split('.')[1])
41-
42-
INSTALLED_VERSION_MAJOR = int(module.__version__.split('.')[0])
43-
INSTALLED_VERSION_MINOR = int(module.__version__.split('.')[1])
44-
45-
if INSTALLED_VERSION_MAJOR < desired_major_version:
46-
return True
47-
48-
elif INSTALLED_VERSION_MAJOR == desired_major_version and \
49-
INSTALLED_VERSION_MINOR < desired_minor_version:
50-
return True
51-
52-
else:
53-
return False
54-
55-
56-
57-
def check_dependencies():
58-
from importlib import import_module
59-
60-
modules = {'numpy' : '1.15',
61-
'scipy' : '1.2',
62-
'statsmodels': '0.9',
63-
'pandas' : '0.24',
64-
'matplotlib' : '3.0',
65-
'seaborn' : '0.9'}
66-
to_install = []
67-
68-
for module, version in modules.items():
69-
try:
70-
my_module = import_module(module)
71-
72-
if need_to_install(my_module, version):
73-
to_install.append("{}=={}".format(module, version))
74-
75-
except ImportError:
76-
to_install.append("{}=={}".format(module, version))
77-
78-
return to_install
79-
80-
81-
8230
if __name__ == "__main__":
83-
84-
installs = check_dependencies()
85-
8631
setup(
8732
name='dabest',
8833
author='Joses W. Ho',
@@ -93,7 +38,16 @@ def check_dependencies():
9338
description=DESCRIPTION,
9439
long_description=LONG_DESCRIPTION,
9540
packages=find_packages(),
96-
install_requires=installs,
41+
install_requires=[
42+
'numpy~=1.15',
43+
'scipy~=1.2',
44+
# 'statsmodels~=0.9',
45+
'pandas<0.25',
46+
'matplotlib~=3.0',
47+
'seaborn~=0.9'
48+
],
49+
extras_require={'dev': ['pytest==4.3']},
50+
python_requires='>=3.5',
9751
url='https://acclab.github.io/DABEST-python-docs',
9852
download_url='https://www.github.com/ACCLAB/DABEST-python',
9953
license='BSD 3-clause Clear License'

0 commit comments

Comments
 (0)