Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions #153

Merged
merged 40 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2d7e5a5
Travis -> github action
smmaurer Nov 25, 2020
57fec9f
Removing appveyor
smmaurer Nov 25, 2020
2654326
Run on push
smmaurer Nov 25, 2020
03a1007
Syntax
smmaurer Nov 25, 2020
8c2ac16
Don't run on push
smmaurer Nov 25, 2020
815884a
Code style
smmaurer Nov 26, 2020
a4f9ff6
Unit tests
smmaurer Nov 26, 2020
8c00aa8
Unit tests
smmaurer Nov 26, 2020
f4184ec
Updating pytest
smmaurer Nov 26, 2020
ebde169
Unit tests
smmaurer Nov 27, 2020
ba44640
Adding osmnet
smmaurer Nov 27, 2020
f90f90f
Cross compatibility
smmaurer Nov 27, 2020
b7b28f5
Macos deployment target
smmaurer Nov 27, 2020
315edc4
Drop python 2
smmaurer Nov 27, 2020
904afdf
Windows
smmaurer Nov 27, 2020
ac8e342
Windows
smmaurer Nov 27, 2020
2dac2f5
Conda forge
smmaurer Nov 27, 2020
0229ddd
Run demo
smmaurer Nov 28, 2020
7e5bddf
Syntax
smmaurer Nov 28, 2020
091dca5
Typo
smmaurer Nov 28, 2020
1373c3c
Python 3.9
smmaurer Nov 28, 2020
5463650
Restructuring
smmaurer Nov 28, 2020
6ddf97a
Cleanup
smmaurer Nov 28, 2020
35fd07f
Conda forge
smmaurer Nov 28, 2020
9190627
No deployment target
smmaurer Nov 28, 2020
dacc7f3
Printenv
smmaurer Nov 28, 2020
782749b
Skipiftravis -> skipifci
smmaurer Nov 28, 2020
0e8a55d
Dropping py39
smmaurer Nov 28, 2020
0c775fe
Coverage report
smmaurer Dec 1, 2020
20c4e8e
Coverage
smmaurer Dec 1, 2020
59e4a7e
Installation workflow
smmaurer Dec 1, 2020
eff5f11
Coveralls token
smmaurer Dec 1, 2020
ff1180a
Conda persistence
smmaurer Dec 1, 2020
2119809
Coverage test
smmaurer Dec 1, 2020
1829fba
Disabling mac installation test
smmaurer Dec 1, 2020
ac93f31
Coveralls
smmaurer Dec 1, 2020
9bf4bb5
Cleanup
smmaurer Dec 1, 2020
87f2d24
Github token
smmaurer Dec 1, 2020
6e7e51e
Fixing token
smmaurer Dec 1, 2020
c866c0f
Turning off coverage
smmaurer Dec 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Code style

# This workflow runs code style checks.

on:
push:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Check code style
run: |
pip install pycodestyle
pycodestyle pandana
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Coverage

# This workflow generates a coverage report (how much of the codebase is covered by the
# unit tests) and uploads the information to Coveralls.io for reporting and analysis.

on:
# push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Pandana
run: |
pip install .
pip install osmnet
- name: Run unit tests
run: |
pip install 'pytest<4.0' 'pytest-cov<2.10'
python setup.py test --pytest-args "--cov pandana --cov-report term-missing"
- name: Upload to Coveralls
run: |
pip install coveralls
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/cross-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Cross-compatibility

# This workflow runs the Pandana unit tests across a comprehensive range of Python
# versions and operating systems.

# TO DO: might be clearer to split this into a set of default-python builds and a set of
# conda-based builds -- see installation.yml for example. Windows needs conda in order to
# install geospatial dependencies.

on:
# push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
if: matrix.os != 'windows-latest'
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }} (conda - for win)
if: matrix.os == 'windows-latest'
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install OSMnet
if: matrix.os != 'windows-latest'
run: |
pip install osmnet
- name: Install OSMnet (conda - for win)
if: matrix.os == 'windows-latest'
run: |
conda install osmnet --channel conda-forge
- name: Install Pandana from source code
run: |
pip install .
- name: Run demo
run: |
python examples/simple_example.py
- name: Run unit tests (skipped on windows)
if: matrix.os != 'windows-latest' # skipped because not passing at the moment
run: |
pip install 'pytest<4.0'
python setup.py test
58 changes: 58 additions & 0 deletions .github/workflows/installation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Installation

# This workflow installs Pandana from Pip and Conda across a range of Python versions and
# operating systems. You can run this manually after a new release is posted to confirm
# that it installs smoothly. This workflow also runs periodically in the background to
# catch dependency updates that break Pandana.

on:
# push:
# pull_request:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1' # every Monday at 3am UTC (Sunday evening Calif time)

jobs:
build-pip:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# Pip installation for Windows is not supported. Pip installation for Mac is
# broken in the GitHub Actions environment with Pandana v0.6 but should be fixed
# in the next Pandana release.
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Pandana
run: |
pip install pandana
- name: Run demo
run: |
python examples/simple_example.py

build-conda:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0} # needed for conda persistence
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Pandana
run: |
conda install pandana --channel conda-forge
- name: Run demo
run: |
python examples/simple_example.py
28 changes: 28 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Unit tests

# This workflow runs the Pandana unit tests in a single generic environment (recent but
# stable Python version on recent but stable Ubuntu). The cross-compatibility.yml
# workflow runs the same tests across multiple platforms.

on:
push:
# pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Pandana
run: |
pip install .
pip install osmnet
- name: Run unit tests
run: |
pip install 'pytest<4.0'
python setup.py test
25 changes: 25 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Windows tests

# This workflow runs the Pandana unit tests in Windows -- this is a one-off for debugging.

on:
# push:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
- name: Install Pandana
run: |
pip install .
pip install 'pytest<4.0'
conda install osmnet --channel conda-forge
- name: Run unit tests
run: |
python setup.py test
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions pandana/loaders/tests/test_osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pandana
from pandana.loaders import osm
from pandana.testing import skipiftravis
from pandana.testing import skipifci


@pytest.fixture(scope='module')
Expand Down Expand Up @@ -41,7 +41,7 @@ def test_process_node():
assert osm.process_node(test_node) == expected


@skipiftravis
@skipifci
def test_network_from_bbox(bbox2):
net = osm.pdna_network_from_bbox(*bbox2)
assert isinstance(net, pandana.Network)
Expand Down
14 changes: 7 additions & 7 deletions pandana/loaders/tests/test_pandash5.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pandas.util.testing as pdt
from pandana import Network
from pandana.testing import skipiftravis
from pandana.testing import skipifci

from pandana.loaders import pandash5 as ph5

Expand Down Expand Up @@ -71,7 +71,7 @@ def cleanup():
return fname


@skipiftravis
@skipifci
def test_remove_nodes(network, rm_nodes):
# node 0 is connected to node 4, which is in turn connected to node 5
# node 7 is connected to node 11, which has no other connections
Expand All @@ -96,7 +96,7 @@ def test_remove_nodes(network, rm_nodes):
pdt.assert_frame_equal(edges, exp_edges)


@skipiftravis
@skipifci
def test_network_to_pandas_hdf5(
tmpfile, network, nodes, edges_df, impedance_names, two_way):
ph5.network_to_pandas_hdf5(network, tmpfile)
Expand All @@ -110,7 +110,7 @@ def test_network_to_pandas_hdf5(
store['impedance_names'], pd.Series(impedance_names))


@skipiftravis
@skipifci
def test_network_to_pandas_hdf5_removal(
tmpfile, network, impedance_names, two_way, rm_nodes):
nodes, edges = ph5.remove_nodes(network, rm_nodes)
Expand All @@ -125,7 +125,7 @@ def test_network_to_pandas_hdf5_removal(
store['impedance_names'], pd.Series(impedance_names))


@skipiftravis
@skipifci
def test_network_from_pandas_hdf5(
tmpfile, network, nodes, edges_df, impedance_names, two_way):
ph5.network_to_pandas_hdf5(network, tmpfile)
Expand All @@ -137,7 +137,7 @@ def test_network_from_pandas_hdf5(
assert new_net.impedance_names == impedance_names


@skipiftravis
@skipifci
def test_network_save_load_hdf5(
tmpfile, network, impedance_names, two_way, rm_nodes):
network.save_hdf5(tmpfile, rm_nodes)
Expand All @@ -153,7 +153,7 @@ def test_network_save_load_hdf5(

# this is an odd place for this test because it's not related to HDF5,
# but my test Network is perfect.
@skipiftravis
@skipifci
def test_network_low_connectivity_nodes(network, impedance_names):
nodes = network.low_connectivity_nodes(10, 3, imp_name=impedance_names[0])
assert list(nodes) == [7, 11]
4 changes: 2 additions & 2 deletions pandana/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

import pytest

skipiftravis = pytest.mark.skipif(
os.environ.get('TRAVIS') == 'true', reason='skip on Travis-CI')
skipifci = pytest.mark.skipif(
os.environ.get('CI') == 'true', reason='skip on CI')
2 changes: 1 addition & 1 deletion pandana/tests/test_pandana.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pandas as pd
import pytest
from pandas.util import testing as pdt
from pandana.testing import skipiftravis
from pandana.testing import skipifci

import pandana.network as pdna

Expand Down
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ def run(self):

if sys.platform.startswith('darwin'): # Mac

# This environment variable sets the earliest OS version that the compiled
# code will be compatible with. In certain contexts the default is too old
# to allow using libc++; supporting OS X 10.9 and later seems reasonable
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'

extra_compile_args += ['-D NO_TR1_MEMORY', '-stdlib=libc++']
extra_link_args += ['-stdlib=libc++']

Expand Down