Skip to content

Commit

Permalink
Put requirements into setup.py
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jotham Apaloo committed Sep 28, 2016
1 parent d689b95 commit d8c6d1b
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -20,6 +20,10 @@ lib
lib64
__pycache__


# virtual environment
venv/

# Installer logs
pip-log.txt

Expand Down Expand Up @@ -101,3 +105,4 @@ pysal/examples/snow_maps/soho_graph.prj
pysal/examples/snow_maps/soho_graph.qpj
pysal/examples/snow_maps/soho_graph.shp
pysal/examples/snow_maps/soho_graph.shx

12 changes: 6 additions & 6 deletions .travis.yml
Expand Up @@ -24,17 +24,17 @@ before_install:
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then 2to3 -nw pysal/ > /dev/null; fi

install:
- conda install --yes numpy scipy nose pip
- conda install --yes pip
- if [ "$PYSAL_PLUS" == true ]; then
echo 'plus testing'; conda install --yes --file requirements_plus.txt;
else conda install --yes --file requirements.txt;
echo 'plus testing'; pip install .[plus];
else pip install .;
fi;
- pip install -r travis.txt
- pip install .[dev]

script:
script:
- python setup.py sdist >/dev/null
- echo "check_stable=False" >pysal/config.py
- nosetests --with-coverage --cover-package=pysal;
- nosetests --with-coverage --cover-package=pysal;
#- cd doc; make pickle; make doctest
notifications:
email:
Expand Down
10 changes: 5 additions & 5 deletions doc/source/users/installation.rst
Expand Up @@ -61,7 +61,7 @@ downloaded and installed manually or from the command line using

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::

python setup.py install
pip install .


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

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

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

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

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

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

Expand Down
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements_plus.txt

This file was deleted.

31 changes: 29 additions & 2 deletions setup.py
Expand Up @@ -74,8 +74,35 @@ def setup_package():
packages=find_packages(exclude=[".meta", "*.meta.*", "meta.*",
"meta"]),
package_data={'pysal': list(example_data_files)},
requires=['scipy'],
cmdclass= {'build_py': build_py}
install_requires=[
'scipy>=0.11',
'numpy>=1.3',
],
extras_require={
'plus': [
'matplotlib>=1.5.1',
'seaborn>=0.7.0',
'geopandas>=0.2',
'scikit-learn>=0.17.1',
'bokeh>=0.11.1',
'geojson>=1.3.2',
'folium>=0.2.1',
'mplleaflet>=0.0.5',
'statsmodels>=0.6.1',
'numba',
'numexpr',
],
'dev': [
'nose',
'nose-progressive',
'nose-exclude',
'coverage',
'sphinx',
'sphinxcontrib-napoleon',
'coveralls',
],
},
cmdclass={'build_py': build_py}
)


Expand Down
6 changes: 0 additions & 6 deletions travis.txt

This file was deleted.

0 comments on commit d8c6d1b

Please sign in to comment.