Skip to content

Commit 619062f

Browse files
authored
Merge pull request #330 from bird-house/setup-cruft-for-cookiecutter-refresh
Setup cruft for cookiecutter refresh. This PR is part of issue bird-house/cookiecutter-birdhouse#61, rolling out cruft as a mechanism to easily update cookiecutter template changes to existing project. Require cookiecutter-birdhouse PR bird-house/cookiecutter-birdhouse#89 In `.cruft.json`, I set `"project_short_description": "A Web Processing Service Testbed."` from the `README.rst`, let me know if that is still correct. In `README.rst`, I took the Flyingpigeon bird description from `docs/source/index.rst`. Noticeable changes: * Notebooks testing enabled in Travis-CI but allowed to fail, waiting for this issue #328 according to @nilshempelmann * Fix pymetalink install to be able to run notebook tests * Docs testing also enabled in Travis-CI Travis-CI build working: https://travis-ci.org/github/bird-house/flyingpigeon/builds/694013491 RtD build working: https://readthedocs.org/projects/flyingpigeon/builds/11184473/
2 parents ac34e6c + 6e707a0 commit 619062f

File tree

14 files changed

+189
-79
lines changed

14 files changed

+189
-79
lines changed

.cruft.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"template": "https://github.com/bird-house/cookiecutter-birdhouse.git",
3+
"commit": "fce99f3071d65bb494a44f7527b5dc5d92fbd390",
4+
"skip": [
5+
"flyingpigeon/processes/wps_say_hello.py",
6+
"tests/test_wps_hello.py",
7+
"docs/source/notebooks/example.ipynb",
8+
"environment.yml",
9+
"requirements.txt",
10+
"AUTHORS.rst",
11+
"CHANGES.rst",
12+
"docs/source/notebooks/index.rst",
13+
"docs/source/processes.rst",
14+
"flyingpigeon/processes/__init__.py",
15+
"tests/test_wps_caps.py"
16+
],
17+
"context": {
18+
"cookiecutter": {
19+
"full_name": "Nils Hempelmann",
20+
"email": "[email protected]",
21+
"github_username": "bird-house",
22+
"project_name": "Flyingpigeon",
23+
"project_slug": "flyingpigeon",
24+
"project_repo_name": "flyingpigeon",
25+
"project_readthedocs_name": "flyingpigeon",
26+
"project_short_description": "A Web Processing Service Testbed.",
27+
"version": "1.5.1",
28+
"open_source_license": "Apache Software License 2.0",
29+
"http_port": "8093",
30+
"_copy_without_render": [
31+
"{{cookiecutter.project_slug}}/templates/*.cfg"
32+
],
33+
"_template": "https://github.com/bird-house/cookiecutter-birdhouse.git"
34+
}
35+
}
36+
}

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
44

5-
Please read the Birdhouse [Contributer Guide](http://birdhouse.readthedocs.io/en/latest/contributing.html)
6-
and the [Cookiecutter Documentation](http://flyingpigeon.readthedocs.io/en/latest/) to get started.
5+
Please read the Birdhouse [Developer Guide](https://birdhouse.readthedocs.io/en/latest/dev_guide.html)
6+
and the [Flyingpigeon Documentation](https://flyingpigeon.readthedocs.io/en/latest/) to get started.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ __pycache__
2828
.tox
2929
nosetests.xml
3030
unit_tests/testdata.json
31-
docs/source/output_sanitize.cfg
3231

3332
# R
3433
*.Rhistory
@@ -69,6 +68,7 @@ docs/make.bat
6968
docs/doctrees/
7069
docs/html/
7170
docs/build/
71+
docs/source/output-sanitize.cfg
7272

7373
# External Sources
7474
#src/external
@@ -88,5 +88,8 @@ testdata.json
8888
*.mod
8989
*.out
9090

91+
# Merge conflict
92+
*.orig
93+
9194
# custom
9295
etc/custom.cgf

.travis.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
11
dist: xenial # required for Python >= 3.7
22
language: python
3+
os:
4+
- linux
35
python:
46
- "3.6"
57
- "3.7"
68
branches:
79
only:
810
- master
9-
os:
10-
- linux
1111
# - osx
1212
sudo: false
13+
before_install:
14+
# Useful for debugging Travis CI environment
15+
- printenv
1316
install:
1417
# Python 3.x is default
1518
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
1619
- bash miniconda.sh -b -p $HOME/miniconda
1720
- export PATH="$HOME/miniconda/bin:$PATH"
1821
- hash -r
1922
- conda config --set always_yes yes --set changeps1 no
23+
- conda install setuptools
2024
- conda update -q conda
2125
# Useful for debugging any issues with conda
2226
- conda info -a
2327
# Prepare env with Python version
24-
- conda create -n flyingpigeon python=$TRAVIS_PYTHON_VERSION
28+
- conda create -n flyingpigeon -c conda-forge python=$TRAVIS_PYTHON_VERSION
2529
# Update now the env with our environment
2630
- conda env update -f environment.yml
2731
- source activate flyingpigeon
28-
# Packages for testing
29-
- conda install pytest flake8
32+
# Packages for testing and generating docs
33+
- make develop
3034
# Install WPS
3135
- python setup.py install
3236
before_script:
33-
# Start WPS service on port 5000 on 0.0.0.0
34-
- flyingpigeon start --daemon --bind-host 0.0.0.0 --port 5000
37+
# Start WPS service on port 8093 on 0.0.0.0
38+
- flyingpigeon start --daemon --bind-host 0.0.0.0 --port 8093
3539
- sleep 2
3640
script:
3741
- pytest
42+
- make test-notebooks || echo "allow fail"
3843
- flake8
44+
- make docs

Makefile

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ APP_NAME := flyingpigeon
55
# TODO read in from server configuration
66
WPS_URL = http://localhost:8093
77
OUTPUT_URL = https://pavics.ouranos.ca/wpsoutputs
8+
9+
SANITIZE_FILE := https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/raw/master/notebooks/output-sanitize.cfg
10+
811
# end of configuration
912

1013
.DEFAULT_GOAL := help
@@ -26,7 +29,9 @@ help:
2629
@echo "\nTesting targets:"
2730
@echo " test to run tests (but skip long running tests)."
2831
@echo " test-all to run all tests (including long running tests)."
32+
@echo " test-notebooks to verify Jupyter Notebook test outputs are valid."
2933
@echo " lint to run code style checks with flake8."
34+
@echo " refresh-notebooks to verify Jupyter Notebook test outputs are valid."
3035
@echo "\nSphinx targets:"
3136
@echo " docs to generate HTML documentation with Sphinx."
3237
@echo "\nDeployment targets:"
@@ -44,6 +49,7 @@ install:
4449
develop:
4550
@echo "Installing development requirements for tests and docs ..."
4651
@-bash -c 'pip install -e ".[dev]"'
52+
@-bash -c 'pip install git+https://github.com/metalink-dev/[email protected]#egg=pymetalink --upgrade'
4753

4854
.PHONY: start
4955
start:
@@ -61,15 +67,15 @@ restart: stop start
6167

6268
.PHONY: status
6369
status:
64-
@echo "Show status ..."
70+
@echo "Showing status ..."
6571
@-bash -c "$(APP_NAME) status"
6672

6773
.PHONY: clean
6874
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
6975

7076
.PHONY: clean-build
7177
clean-build:
72-
@echo "Remove build artifacts ..."
78+
@echo "Removing build artifacts ..."
7379
@-rm -fr build/
7480
@-rm -fr dist/
7581
@-rm -fr .eggs/
@@ -80,21 +86,22 @@ clean-build:
8086

8187
.PHONY: clean-pyc
8288
clean-pyc:
83-
@echo "Remove Python file artifacts ..."
89+
@echo "Removing Python file artifacts ..."
8490
@-find . -name '*.pyc' -exec rm -f {} +
8591
@-find . -name '*.pyo' -exec rm -f {} +
8692
@-find . -name '*~' -exec rm -f {} +
8793
@-find . -name '__pycache__' -exec rm -fr {} +
8894

8995
.PHONY: clean-test
9096
clean-test:
91-
@echo "Remove test artifacts ..."
97+
@echo "Removing test artifacts ..."
9298
@-rm -fr .pytest_cache
9399

94100
.PHONY: clean-dist
95101
clean-dist: clean
96-
@echo "Run 'git clean' ..."
97-
@git diff --quiet HEAD || echo "There are uncommited changes! Not doing 'git clean' ..."
102+
@echo "Running 'git clean' ..."
103+
@git diff --quiet HEAD || echo "There are uncommitted changes! Aborting 'git clean' ..."
104+
## do not use git clean -e/--exclude here, add them to .gitignore instead
98105
@-git clean -dfx
99106

100107
## Test targets
@@ -109,37 +116,41 @@ test-all:
109116
@echo "Running all tests (including slow and online tests) ..."
110117
@bash -c 'pytest -v tests/'
111118

119+
.PHONY: notebook-sanitizer
120+
notebook-sanitizer:
121+
@echo "Copying notebook output sanitizer ..."
122+
@-bash -c "curl -L $(SANITIZE_FILE) -o $(CURDIR)/docs/source/output-sanitize.cfg --silent"
123+
112124
.PHONY: test-notebooks
113-
test-notebooks:
125+
test-notebooks: notebook-sanitizer
114126
@echo "Running notebook-based tests"
115-
@bash -c "curl -L https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/raw/master/notebooks/output-sanitize.cfg --output $(CURDIR)/docs/source/output_sanitize.cfg --silent"
116-
@bash -c "env WPS_URL=$(WPS_URL) pytest --nbval --verbose $(CURDIR)/docs/source/notebooks/ --sanitize-with $(CURDIR)/docs/source/output_sanitize.cfg --ignore $(CURDIR)/docs/source/notebooks/.ipynb_checkpoints"
117-
118-
.PHONY: refresh-notebooks
119-
refresh-notebooks:
120-
@echo "Refresh all notebook outputs under docs/source/notebooks"
121-
cd docs/source/notebooks; for nb in *.ipynb; do WPS_URL="$(WPS_URL)" jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output "$$nb" "$$nb"; sed -i "s@$(WPS_URL)/outputs/@$(OUTPUT_URL)/@g" "$$nb"; done; cd $(APP_ROOT)
122-
123-
127+
@bash -c "env WPS_URL=$(WPS_URL) pytest --nbval --verbose $(CURDIR)/docs/source/notebooks/ --sanitize-with $(CURDIR)/docs/source/output-sanitize.cfg --ignore $(CURDIR)/docs/source/notebooks/.ipynb_checkpoints"
124128

125129
.PHONY: lint
126130
lint:
127131
@echo "Running flake8 code style checks ..."
128132
@bash -c 'flake8'
129133

134+
.PHONY: refresh-notebooks
135+
refresh-notebooks:
136+
@echo "Refresh all notebook outputs under docs/source/notebooks"
137+
@bash -c 'for nb in $(CURDIR)/docs/source/notebooks/*.ipynb; do WPS_URL="$(WPS_URL)" jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output "$$nb" "$$nb"; sed -i "s@$(WPS_URL)/outputs/@$(OUTPUT_URL)/@g" "$$nb"; done; cd $(APP_ROOT)'
138+
130139
## Sphinx targets
131140

132141
.PHONY: docs
133142
docs:
134143
@echo "Generating docs with Sphinx ..."
135144
@-bash -c '$(MAKE) -C $@ clean html'
136-
@echo "open your browser: open file://$(APP_ROOT)/docs/build/html/index.html"
145+
@echo "Open your browser to: file:/$(APP_ROOT)/docs/build/html/index.html"
146+
## do not execute xdg-open automatically since it hangs travis and job does not complete
147+
@echo "xdg-open $(APP_ROOT)/docs/build/html/index.html"
137148

138149
## Deployment targets
139150

140151
.PHONY: dist
141152
dist: clean
142-
@echo "Builds source and wheel package ..."
153+
@echo "Building source and wheel package ..."
143154
@-python setup.py sdist
144155
@-python setup.py bdist_wheel
145-
ls -l dist
156+
@-bash -c 'ls -l dist/'

README.rst

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,45 @@ Flyingpigeon
1818
:alt: Join the chat at https://gitter.im/bird-house/birdhouse
1919

2020

21-
A Web Processing Service Testbed
22-
--------------------------------
21+
Flyingpigeon (the bird)
22+
*The pigeon finds its way home over extremely long distances. [..].* ( `Wikipedia <https://en.wikipedia.org/wiki/Pigeon_flying>`_ ).
23+
24+
A Web Processing Service Testbed.
2325

2426
Flyingpigeon is a server providing a sandbox and test environment for new Web Processing Services (OGC WPS). It is part of the `birdhouse`_ ecosystem, which aims to build interoperable services in support to substainable development goals. Once stable, mature and thoroughly tested, Flyingpigeon services are meant to move to stand-alone thematic servers used in production.
2527

2628
The Flyingpigeon software stack as of version 1.0 was published in `Computers & Geosciences <https://www.sciencedirect.com/science/article/pii/S0098300416302801>`_ and can still be accessed from the `release page <https://github.com/bird-house/flyingpigeon/releases/tag/1.0.0>`_. Meanwhile many of the 1.0 processes have migrated to other birdhouse repositories. For example, processes related to extreme weather event assessment can be found in `blackswan`_, while processes focusing on climate indices will be found in `finch`_.
2729

28-
* Documentation: https://flyingpigeon.readthedocs.io
29-
* GitHub repository: https://github.com/bird-house/flyingpigeon
30-
* Birdhouse overview: https://birdhouse.readthedocs.io/en/latest/
30+
Documentation
31+
-------------
32+
33+
Learn more about Flyingpigeon in its official documentation at
34+
https://flyingpigeon.readthedocs.io.
35+
36+
Submit bug reports, questions and feature requests at
37+
https://github.com/bird-house/flyingpigeon/issues
38+
39+
Contributing
40+
------------
41+
42+
You can find information about contributing in our `Developer Guide`_.
43+
44+
Please use bumpversion_ to release a new version.
45+
46+
License
47+
-------
48+
49+
Free software: Apache Software License 2.0
50+
51+
Credits
52+
-------
53+
54+
This package was created with Cookiecutter_ and the `bird-house/cookiecutter-birdhouse`_ project template.
3155

56+
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
57+
.. _`bird-house/cookiecutter-birdhouse`: https://github.com/bird-house/cookiecutter-birdhouse
58+
.. _`Developer Guide`: https://flyingpigeon.readthedocs.io/en/latest/dev_guide.html
59+
.. _bumpversion: https://flyingpigeon.readthedocs.io/en/latest/dev_guide.html#bump-a-new-version
3260
.. _blackswan: https://github.com/bird-house/blackswan
3361
.. _birdhouse: https://birdhouse.readthedocs.io/en/latest/
3462
.. _finch: https://github.com/bird-house/finch

0 commit comments

Comments
 (0)