Skip to content

Commit d8c6d1b

Browse files
author
Jotham Apaloo
committed
Put requirements into setup.py
The main benefit here is that installing the package with pip/setuptools/etc will install the required packages automatically if they are missing It also moves all the dependencies definition into one place, easier to check and reconcile. In order for this not to introduce more complexity, the requirements files are removed and the .travis.yml is updated to specify which extras should be installed with the package Update the docs to use pip Pip is the canonical python package installation/management tool Add virtualenv to gitignore This is for developers not using conda where virtualenv is the canonical isolation tool
1 parent d689b95 commit d8c6d1b

File tree

7 files changed

+45
-32
lines changed

7 files changed

+45
-32
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ lib
2020
lib64
2121
__pycache__
2222

23+
24+
# virtual environment
25+
venv/
26+
2327
# Installer logs
2428
pip-log.txt
2529

@@ -101,3 +105,4 @@ pysal/examples/snow_maps/soho_graph.prj
101105
pysal/examples/snow_maps/soho_graph.qpj
102106
pysal/examples/snow_maps/soho_graph.shp
103107
pysal/examples/snow_maps/soho_graph.shx
108+

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ before_install:
2424
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then 2to3 -nw pysal/ > /dev/null; fi
2525

2626
install:
27-
- conda install --yes numpy scipy nose pip
27+
- conda install --yes pip
2828
- if [ "$PYSAL_PLUS" == true ]; then
29-
echo 'plus testing'; conda install --yes --file requirements_plus.txt;
30-
else conda install --yes --file requirements.txt;
29+
echo 'plus testing'; pip install .[plus];
30+
else pip install .;
3131
fi;
32-
- pip install -r travis.txt
32+
- pip install .[dev]
3333

34-
script:
34+
script:
3535
- python setup.py sdist >/dev/null
3636
- echo "check_stable=False" >pysal/config.py
37-
- nosetests --with-coverage --cover-package=pysal;
37+
- nosetests --with-coverage --cover-package=pysal;
3838
#- cd doc; make pickle; make doctest
3939
notifications:
4040
email:

doc/source/users/installation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ downloaded and installed manually or from the command line using
6161

6262
Alternatively, grab the source distribution (.tar.gz) and decompress it to your selected destination. Open a command shell and navigate to the decompressed pysal folder. Type::
6363

64-
python setup.py install
64+
pip install .
6565

6666

6767
Development version on GitHub
@@ -74,10 +74,10 @@ Developers can checkout PySAL using **git**::
7474
Open a command shell and navigate to the cloned pysal
7575
directory. Type::
7676

77-
python setup.py develop
77+
pip install -e .[dev]
7878

79-
The 'develop' subcommand builds the modules in place
80-
and modifies sys.path to include the code.
79+
The '-e' builds the modules in place
80+
and symlinks from the python site packages directory to the pysal folder.
8181
The advantage of this method is that you get the latest code
8282
but don't have to fuss with editing system environment variables.
8383

@@ -107,7 +107,7 @@ After cloning pysal, install it in develop mode so Python knows where to find it
107107
Open a command shell and navigate to the cloned pysal
108108
directory. Type::
109109

110-
python setup.py develop
110+
pip install -e .[dev]
111111

112112
To test your setup, start a Python session and type::
113113

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements_plus.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

setup.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,35 @@ def setup_package():
7474
packages=find_packages(exclude=[".meta", "*.meta.*", "meta.*",
7575
"meta"]),
7676
package_data={'pysal': list(example_data_files)},
77-
requires=['scipy'],
78-
cmdclass= {'build_py': build_py}
77+
install_requires=[
78+
'scipy>=0.11',
79+
'numpy>=1.3',
80+
],
81+
extras_require={
82+
'plus': [
83+
'matplotlib>=1.5.1',
84+
'seaborn>=0.7.0',
85+
'geopandas>=0.2',
86+
'scikit-learn>=0.17.1',
87+
'bokeh>=0.11.1',
88+
'geojson>=1.3.2',
89+
'folium>=0.2.1',
90+
'mplleaflet>=0.0.5',
91+
'statsmodels>=0.6.1',
92+
'numba',
93+
'numexpr',
94+
],
95+
'dev': [
96+
'nose',
97+
'nose-progressive',
98+
'nose-exclude',
99+
'coverage',
100+
'sphinx',
101+
'sphinxcontrib-napoleon',
102+
'coveralls',
103+
],
104+
},
105+
cmdclass={'build_py': build_py}
79106
)
80107

81108

travis.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)