Skip to content

Commit c2060ed

Browse files
authored
Merge pull request #77 from fccoelho/remove_demography
Remove demography
2 parents 3af7296 + 0c3e942 commit c2060ed

File tree

26 files changed

+416
-4959
lines changed

26 files changed

+416
-4959
lines changed
Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
name: tests
32

4-
name: Python package
5-
6-
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
3+
on: [push, pull_request]
114

125
jobs:
136
build:
14-
157
runs-on: ubuntu-latest
168
timeout-minutes: 60
9+
strategy:
10+
matrix:
11+
python-version: ["3.9"]
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
1716
defaults:
1817
run:
1918
shell: bash -l {0}
2019

2120
steps:
2221
- uses: actions/checkout@v2
23-
22+
2423
- uses: conda-incubator/setup-miniconda@v2
2524
with:
2625
miniconda-version: "latest"
2726
mamba-version: "*"
28-
environment-file: environment.yaml
29-
channels: conda-forge
27+
environment-file: conda/environment.yaml
28+
channels: conda-forge,nodefaults
3029
activate-environment: env-pysus
3130
use-mamba: true
3231
miniforge-variant: Mambaforge
@@ -37,17 +36,12 @@ jobs:
3736
3837
- name: Lint with flake8
3938
run: |
40-
make lint
39+
make check-codestyle
4140
4241
- name: build and deploy jupyterlab
4342
run: |
44-
make run_jupyter_pysus
43+
make run-jupyter-pysus
4544
46-
- name: run tests for notebooks on container
45+
- name: Test with pytest
4746
run: |
48-
make test_jupyter_pysus
49-
50-
# - name: Test with pytest
51-
# shell: bash -l {0}
52-
# run: |
53-
# make test
47+
make test

Makefile

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,54 @@ help:
2121
DOCKER = docker-compose -p pysus -f docker/docker-compose.yaml
2222
SERVICE :=
2323

24-
# Docker basic
25-
run_jupyter_pysus: ## build and deploy all containers
24+
25+
#* Installation
26+
.PHONY: install
27+
install: clean ## install the package to the active Python's site-packages
28+
python setup.py install
29+
30+
.PHONY: pre-commit-install
31+
develop-install: clean ## install the package in development mode
32+
pip install -e '.[dev]'
33+
pre-commit install
34+
35+
#* Linting
36+
.PHONY: check-codestyle
37+
check-codestyle: ## check style with flake8
38+
# stop the build if there are Python syntax errors or undefined names
39+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42+
43+
#* Docker basic
44+
.PHONY: run-jupyter-pysus
45+
run-jupyter-pysus: ## build and deploy all containers
2646
$(DOCKER) up -d --build
2747

28-
down_jupyter_pysus: ## stop and remove containers for all services
48+
.PHONY: down-jupyter-pysus
49+
down-jupyter-pysus: ## stop and remove containers for all services
2950
$(DOCKER) down -v --remove-orphans
3051

31-
test_jupyter_pysus: ## run pytest for notebooks inside jupyter container
52+
#* Tests
53+
.PHONY: test-jupyter-pysus
54+
test-jupyter-pysus: ## run pytest for notebooks inside jupyter container
3255
$(DOCKER) exec -T jupyter bash /test_notebooks.sh
3356

57+
.PHONY: test
58+
test: ## run tests quickly with the default Python
59+
py.test
60+
61+
coverage: ## check code coverage quickly with the default Python
62+
coverage run --source pysus/tests/ -m pytest
63+
coverage report -m
64+
coverage html
65+
$(BROWSER) htmlcov/index.html
66+
67+
# Cleaning
68+
.PHONY: clean
3469
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
3570

71+
.PHONY: clean-build
3672
clean-build: ## remove build artifacts
3773
rm -fr build/
3874
rm -fr dist/
@@ -44,37 +80,16 @@ clean-build: ## remove build artifacts
4480
find . -name '*.egg-info' -exec rm -fr {} +
4581
find . -name '*.egg' -exec rm -f {} +
4682

47-
83+
.PHONY: clean-pyc
4884
clean-pyc: ## remove Python file artifacts
4985
find . -name '*.pyc' -exec rm -f {} +
5086
find . -name '*.pyo' -exec rm -f {} +
5187
find . -name '*~' -exec rm -f {} +
5288
find . -name '__pycache__' -exec rm -fr {} +
5389

90+
.PHONY: clean-test
5491
clean-test: ## remove test and coverage artifacts
5592
rm -fr .tox/
5693
rm -f .coverage
5794
rm -fr htmlcov/
5895
rm -fr .pytest_cache
59-
60-
lint: ## check style with flake8
61-
# stop the build if there are Python syntax errors or undefined names
62-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
63-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
64-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
65-
66-
install: clean ## install the package to the active Python's site-packages
67-
python setup.py install
68-
69-
develop: clean ## install the package in development mode
70-
pip install -e '.[dev]'
71-
pre-commit install
72-
73-
test: ## run tests quickly with the default Python
74-
py.test
75-
76-
coverage: ## check code coverage quickly with the default Python
77-
coverage run --source pysus/tests/ -m pytest
78-
coverage report -m
79-
coverage html
80-
$(BROWSER) htmlcov/index.html

environment.yaml renamed to conda/environment.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6+
- docker-compose
67
- jupyterlab
78
- nodejs
89
- cffi>=1.0.0
910
- dbfread
1011
- geocoder
1112
- requests
12-
- folium
1313
- fastparquet
14-
- geopandas
1514
- dask
1615
- wget
17-
- colorcet
18-
- datashader
19-
- xarray
20-
- georasters
2116
- elasticsearch
2217
- pyarrow
2318
# dev
@@ -32,6 +27,4 @@ dependencies:
3227
- numba
3328
- pip:
3429
- nbmake
35-
- geobr
36-
- facets-overview
3730
- pysus

condarecipe/pysus/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ requirements:
2323
- pip
2424
- python
2525
- requests
26-
- georasters
2726
run:
2827
- cffi >=1.0.0
2928
- dbfread
@@ -33,7 +32,6 @@ requirements:
3332
- pyarrow
3433
- python
3534
- requests
36-
- georasters
3735
- elasticsearch
3836

3937
test:

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ENV HOME /home/developer
2323
ENV APP_TMP_DATA=/tmp
2424

2525
# Copy environment file to tmp/
26-
COPY environment.yaml ${APP_TMP_DATA}/environment.yaml
26+
COPY conda/environment.yaml ${APP_TMP_DATA}/environment.yaml
2727
# Executable in a container to be owned by the root user
2828
COPY docker/test_notebooks.sh /test_notebooks.sh
2929
COPY docker/entrypoint.sh /entrypoint.sh

0 commit comments

Comments
 (0)