Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pysal/spaghetti
Browse files Browse the repository at this point in the history
  • Loading branch information
weikang9009 committed Feb 10, 2020
2 parents 35a9873 + 9a3cb04 commit b34b96f
Show file tree
Hide file tree
Showing 245 changed files with 90,524 additions and 5,704 deletions.
29 changes: 27 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
Thank you for your interest in contributing! We work primarily on Github. Please
review the [contributing procedures](https://github.com/pysal/pysal/wiki/GitHub-Standard-Operating-Procedures) so that we can accept your contributions! Alternatively, contact someone in the [development chat channel](https://gitter.im//pysal/Spaghetti).
Contributing Guidelines for `spaghetti`
=============================

Thank you for your interest in contributing! We work primarily on Github. Please review the contributing procedures [here](http://pysal.org/getting_started#for-developers) and [here](https://github.com/pysal/pysal/wiki/GitHub-Standard-Operating-Procedures) so that we can accept your contributions! Alternatively, contact someone in the [development chat channel](https://gitter.im//pysal/Spaghetti).


Style and format
----------------

1. Python 3.6 and 3.7 are currently the only officially support versions.
2. This project follows the formatting conventions of [`black`](https://black.readthedocs.io/en/stable/) and utilizes [`pre-commit`](https://pre-commit.com) to format commits prior to pull requests being made.
* LJ Miranda provides an [excellent, concise guide](https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/) on setting up and implementing a `pre-commit` hook for `black`.
3. Import packages, classes, and functions with their full name where possible.
* For example:

:white_check_mark:
```python
import spaghetti
from shapely.geometry import Point
```
:x:
```python
import spaghetti as spgh
from shapely.geometry import Point as pt
```


6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
language_version: python3.7
121 changes: 75 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,95 @@
dist: xenial
language: python
sudo: true
branches:
only:
- master

python:
- 3.6
- 3.7

env:
- PYSAL_PYPI=true PYSAL_PLUS=true
- PYSAL_PYPI=true PYSAL_PLUS=false
- PYSAL_PYPI=false PYSAL_PLUS=true
- PYSAL_PYPI=false PYSAL_PLUS=false
language: minimal
sudo: false

matrix:
include:
- name: "python-3.6-pypi"
env: PY=3.6 PYSAL_PYPI=true PYSAL_PLUS=false
- name: "python-3.6-pypi-plus"
env: PY=3.6 PYSAL_PYPI=true PYSAL_PLUS=true
- name: "python-3.7-pypi"
env: PY=3.7 PYSAL_PYPI=true PYSAL_PLUS=false
- name: "python-3.7-pypi-plus"
env: PY=3.7 PYSAL_PYPI=true PYSAL_PLUS=true
- name: "python-3.8-pypi"
env: PY=3.8 PYSAL_PYPI=true PYSAL_PLUS=false
- name: "python-3.8-pypi-plus"
env: PY=3.8 PYSAL_PYPI=true PYSAL_PLUS=true
- name: "tarball-pypi"
env: PY=3.8 PYSAL_PYPI=true PYSAL_PLUS=false
- name: "python-3.6"
env: PY=3.6 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.6-plus"
env: PY=3.6 PYSAL_PYPI=false PYSAL_PLUS=true
- name: "python-3.7"
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.7-plus"
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=true
- name: "python-3.8"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.8-plus"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=true
allow_failures:
- python: 3.6
env: PYSAL_PYPI=false PYSAL_PLUS=false
- python: 3.6
env: PYSAL_PYPI=false PYSAL_PLUS=true
- python: 3.7
env: PYSAL_PYPI=false PYSAL_PLUS=false
- python: 3.7
env: PYSAL_PYPI=false PYSAL_PLUS=true
- name: "python-3.6"
env: PY=3.6 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.6-plus"
env: PY=3.6 PYSAL_PYPI=false PYSAL_PLUS=true
- name: "python-3.7"
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.7-plus"
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=true
- name: "python-3.8"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.8-plus"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=true

before_install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b -p ./miniconda
- export PATH=`pwd`/miniconda/bin:$PATH
- conda update --yes conda
- conda config --add channels conda-forge
- conda config --set channel_priority strict
- conda create -y -q -n test-env python=$TRAVIS_PYTHON_VERSION
- source activate test-env
- |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
conda update --quiet conda
conda config --add channels conda-forge --force
conda config --set channel_priority strict
conda config --set safety_checks disabled
conda create --name TEST python=$PY --file requirements.txt --file requirements_dev.txt --file requirements_tests.txt
source activate TEST
conda info --all
install:
- conda install --yes pip
- if "$PYSAL_PYPI"; then
echo 'testing conda libpysal' && conda install --yes libpysal;
else echo 'testing git libpysal';
- pip install -e . --no-deps --force-reinstall
- if [ "$PYSAL_PYPI" == true ]; then
echo 'testing conda libpysal';
conda install --yes libpysal;
else echo 'testing git libpysal';
git clone https://github.com/pysal/libpysal.git;
cd libpysal; pip install .; cd ../;
cd libpysal;
pip install .;
cd ../;
fi;
- if [ "$PYSAL_PLUS" == true ]; then
echo 'plus testing'; conda install --yes --file requirements_plus.txt;
echo 'plus testing';
conda install --yes --file requirements_plus.txt;
fi;
- conda install --yes --file requirements.txt
- pip install -r requirements_dev.txt -r requirements_docs.txt

script:
- python setup.py sdist >/dev/null
- nosetests --verbose --with-doctest --with-coverage --cover-package=spaghetti;
- python -c 'import libpysal; libpysal.examples.load_example("newHaven")'
- if [[ $TRAVIS_JOB_NAME == python-* ]]; then
travis_wait 45 nosetests --verbose --with-coverage --with-doctest --cover-package=spaghetti;
fi

- if [[ $TRAVIS_JOB_NAME == tarball* ]]; then
pip wheel . -w dist --no-deps;
twine check dist/*;
fi

notifications:
email:
recipients:
- sjsrey@gmail.com
- levi.john.wolf@gmail.com
- jgaboardi@gmail.com
- sjsrey+travis@gmail.com
- levi.john.wolf+travis@gmail.com
- jgaboardi+travis@gmail.com
on_success: change
on_failure: change

Expand Down

0 comments on commit b34b96f

Please sign in to comment.