Skip to content

Commit

Permalink
Merge pull request #120 from bird-house/upstream-changes
Browse files Browse the repository at this point in the history
Upstream changes
  • Loading branch information
Zeitsperre authored Oct 3, 2024
2 parents 231d17e + 6ac70a8 commit a062df0
Show file tree
Hide file tree
Showing 68 changed files with 1,522 additions and 998 deletions.
4 changes: 0 additions & 4 deletions .coveragerc

This file was deleted.

5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ updates:
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "pip"
directory: "/CI"
schedule:
interval: "monthly"
28 changes: 13 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ on:
pull_request:

concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on master.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on main.
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- tox-env: py37
python-version: "3.7"
- tox-env: py38
python-version: "3.8"
- tox-env: py39
python-version: "3.9"
- tox-env: py310
Expand All @@ -29,24 +25,26 @@ jobs:
python-version: "3.11"
- tox-env: py312
python-version: "3.12"
- tox-env: pypy38-nogdal
python-version: "pypy-3.8"
- tox-env: pypy310-nogdal
- tox-env: pypy39
python-version: "pypy-3.9"
- tox-env: pypy310
python-version: "pypy-3.10"
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive
- name: Install packages
run: |
sudo apt-get -y install pandoc
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
cache: "pip"
- name: Install CI dependencies
run: |
pip install tox
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Test with pytest and tox ⚙️
run: tox -e ${{ matrix.tox-env }}
run: |
python -m tox -e ${{ matrix.tox-env }}
16 changes: 13 additions & 3 deletions CHANGES.rst → CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
CHANGES
********

0.6.0
=====
1.0.0 (2024-10-03)
==================

Changes:

* Replace `search` by `parse` in the bumpversion config for `docs/conf.py` to support the `version|release` expression.
* Replace `search` by `parse` in the bumpversion config for `docs/conf.py` to support the `version|release` expression. (#107, #108).
* Dropped Travis CI and migrated to using GitHub Actions for CI/CD (#112).
* Updated PyWPS to 4.5.0 (#112).
* Ported upstream changes from `cookiecutter-pypackage` and re-enabled testing (#115).
* Added a Makefile command for running `nb-val` with `lax` flags (#116).
* Updated the package metadata to reflect the current state of the project (#117).
* Dropped support for Python2 as well as Python3.8 and below (#120).
* Top-level documentation has been updated to reflect the changes in the project (#120).
* Now using `bump-my-version` for version management and `pre-commit` for code formatting (#120).
* Projects now use a `src`-based directory structure (#120).
* Both the top-level package and rendered templates are now PEP 517 and PEP 621 compliant (`pyproject.toml`) (#120).

0.5.0 (2020-10-07)
==================
Expand Down
1 change: 1 addition & 0 deletions CI/requirements_ci.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tox==4.18.0
62 changes: 62 additions & 0 deletions CI/requirements_ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --generate-hashes --output-file=CI/requirements_ci.txt CI/requirements_ci.in
#
cachetools==5.4.0 \
--hash=sha256:3ae3b49a3d5e28a77a0be2b37dbcb89005058959cb2323858c2657c4a8cab474 \
--hash=sha256:b8adc2e7c07f105ced7bc56dbb6dfbe7c4a00acce20e2227b3f355be89bc6827
# via tox
chardet==5.2.0 \
--hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \
--hash=sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970
# via tox
colorama==0.4.6 \
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
# via tox
distlib==0.3.8 \
--hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \
--hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64
# via virtualenv
filelock==3.15.4 \
--hash=sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb \
--hash=sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7
# via
# tox
# virtualenv
packaging==24.1 \
--hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \
--hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124
# via
# pyproject-api
# tox
platformdirs==4.2.2 \
--hash=sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee \
--hash=sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3
# via
# tox
# virtualenv
pluggy==1.5.0 \
--hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \
--hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669
# via tox
pyproject-api==1.7.1 \
--hash=sha256:2dc1654062c2b27733d8fd4cdda672b22fe8741ef1dde8e3a998a9547b071eeb \
--hash=sha256:7ebc6cd10710f89f4cf2a2731710a98abce37ebff19427116ff2174c9236a827
# via tox
tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# pyproject-api
# tox
tox==4.18.0 \
--hash=sha256:0a457400cf70615dc0627eb70d293e80cd95d8ce174bb40ac011011f0c03a249 \
--hash=sha256:5dfa1cab9f146becd6e351333a82f9e0ade374451630ba65ee54584624c27b58
# via -r requirements_ci.in
virtualenv==20.26.3 \
--hash=sha256:4c43a2a236279d9ea36a0d76f98d84bd6ca94ac4e0f4a3b9d46d05e10fea542a \
--hash=sha256:8cc4a31139e796e9a7de2cd5cf2489de1217193116a8fd42328f1bd65f434589
# via tox
3 changes: 1 addition & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ development. Please note this documentation assumes you already have

.. code-block:: bash
$ pip install -rrequirements_dev.txt
$ pip install -r requirements_dev.txt
$ pytest ./tests
If you get any errors while installing cryptography package (something like
Expand Down Expand Up @@ -233,4 +233,3 @@ To write and run your new test, follow these steps:
.. cookiecutter: https://github.com/audreyr/cookiecutter-pypackage
.. virtualenv: https://virtualenv.pypa.io/en/stable/installation
.. git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) Audrey Roy Greenfeld and individual contributors.
Copyright (c) 2018, Audrey Roy Greenfeld and individual contributors.

Copyright (c) 2019, Carsten Ehbrecht, Long Vu, Trevor James Smith, David Huard, and individual contributors.

All rights reserved.

Expand Down
19 changes: 18 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
include CHANGELOG.rst
include CONTRIBUTING.rst
include LICENSE
include Makefile
include requirements_dev.txt
include README.rst
include cookiecutter.json
include tox.ini

exclude .editorconfig
exclude .gitignore
exclude .readthedocs.yml

recursive-include {{cookiecutter.project_slug}} *
recursive-include docs *.rst conf.py Makefile *.svg *.ico
recursive-include hooks *.py
recursive-include tests *.py
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-exclude .github *
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
COOKIES_DIR=$(CURDIR)/cookies
BAKE_OPTIONS=--no-input --output-dir $(COOKIES_DIR)
COOKIES_DIR = $(CURDIR)/cookies
BAKE_OPTIONS ?= --no-input
NO_CRUFT = generated_with_cruft=n

.DEFAULT_GOAL := all

Expand Down Expand Up @@ -30,7 +31,8 @@ clean:
.PHONY: bake
bake:
@echo "Creating a new project with default settings"
@bash -c 'cookiecutter $(BAKE_OPTIONS) . --overwrite-if-exists'
@mkdir -p "cookies"
@bash -c 'cookiecutter $(BAKE_OPTIONS) . --output-dir $(COOKIES_DIR) --overwrite-if-exists $(NO_CRUFT)'

.PHONY: docs
docs:
Expand All @@ -40,8 +42,8 @@ docs:
@-bash -c 'xdg-open $(CURDIR)/docs/build/html/index.html'

# generate project using defaults and watch for changes
# watch: bake
# watchmedo shell-command -p '*.*' -c 'make bake -e BAKE_OPTIONS=$(BAKE_OPTIONS)' -W -R -D \{{cookiecutter.project_slug}}/
watch: bake
watchmedo shell-command -p '*.*' -c 'make bake -e BAKE_OPTIONS=$(BAKE_OPTIONS)' -W -R -D \{{cookiecutter.project_slug}}/
#
# replay last cookiecutter run and watch for changes
# replay: BAKE_OPTIONS=--replay
Expand Down
59 changes: 29 additions & 30 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ Cookiecutter_ template for a Python package.

*A Cookiecutter template for a Birdhouse bird package*

Cookiecutter_ is a command-line utility to create projects from templates. This `cookiecutter-birdhouse`
template creates a barebone PyWPS server adhering to Birdhouse conventions. It comes complete with a
framework for installation, configuration, deployment, documentation and tests. It even includes a
:file:`Dockerfile` for containerization! Create your project then get started writing new WPS
processes in minutes.
Cookiecutter_ is a command-line utility to create projects from templates. This `cookiecutter-birdhouse` template creates a barebones PyWPS server adhering to Birdhouse conventions.
It comes complete with a framework for installation, configuration, deployment, documentation and tests.
It even includes a `Dockerfile` for containerization!
Create your project then get started writing new WPS processes in minutes.

You may at any time update your project using the latest cookiecutter template using Cruft_.

* GitHub repo: https://github.com/bird-house/cookiecutter-birdhouse/
* Documentation: http://cookiecutter-birdhouse.readthedocs.io/en/latest/
* Free software: BSD license

* Discord: https://discord.gg/PWXJr3upUE

.. warning::

Expand All @@ -47,24 +46,24 @@ You may at any time update your project using the latest cookiecutter template u
Features
--------

* Testing setup with ``unittest`` and ``python setup.py test`` or ``pytest``
* Testing setup with ``pytest`` and ``tox``
* GitHub_Workflows_: Ready for GitHub Workflows Continuous Integration testing
* Tox_ testing: Setup to easily test for Python 3.7, 3.8, 3.9, 3.10, and 3.11
* Tox_ testing: Setup to easily test for Python 3.9, 3.10, 3.11, and 3.12
* Sphinx_ docs: Documentation ready for generation with, for example, ReadTheDocs_
* bump2version_: Pre-configured version bumping with a single command
* bump-my-version_: Pre-configured version bumping with a single command
* Auto-release to PyPI_ when you push a new tag to master (optional)
* A :file:`Makefile` to install the code, start, stop and poll the server and more
* A `Makefile` to install the code, start, stop, poll the server and more

Installation
------------

Prior to installing cookiecutter-birdhouse, the cookiecutter and cruft packages must be installed in your environment.
Prior to installing cookiecutter-birdhouse, the `cookiecutter` and `cruft` packages must be installed in your environment.
This is achieved via the following commands:

.. code-block:: console
$ conda install -c conda-forge cookiecutter
$ pip install cruft
$ python -m pip install cookiecutter
$ python -m pip install cruft
With cookiecutter and cruft installed, the cookiecutter-birdhouse template can be installed with:

Expand All @@ -91,9 +90,11 @@ Once cookiecutter clones the template, you will be asked a series of questions r
3 - BSD license
4 - ISC license
5 - GNU General Public License v3
Choose from 1, 2, 3, 4, 5 [1]:
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]:
http_port [5000]:
use_pytest [y]:
use_black [y]:
create_author_file [y]:
The answer to all those questions are recorded in the ``.cruft.json`` file in
Expand Down Expand Up @@ -122,12 +123,11 @@ To keep the generated bird up-to-date with the cookiecutter template:
$ cruft update # uses configurations in the .cruft.json file
Cruft can be configured to ignore template changes to certain files, see
https://cruft.github.io/cruft/#updating-a-project. Potential files to
ignore:
https://cruft.github.io/cruft/#updating-a-project.
Potential files to ignore:

* demonstration files, because they are meant to be erased
* environment files and list of processes, list of tutorial notebooks since they
naturally are different between each bird
* environment files and list of processes, list of tutorial notebooks since they naturally are different between each bird

See cruft_skip_ example.

Expand All @@ -142,11 +142,11 @@ This will create the ``.cruft.json`` file so subsequently ``cruft update`` can
be used. You will need to answer the same questions as ``cruft create``
above.

Note that after ``cruft link``, the ``commit`` field in the ``.cruft.json``
file will initially be wrong if you selected the default value. To ensure a
proper subsequent ``cruft update``, you need to edit the ``.cruft.json`` file
and put the proper last commit of the cookiecutter used in that ``commit``
field. See cruft_link_ example.
.. note::

After ``cruft link``, the ``commit`` field in the ``.cruft.json`` file will initially be wrong if you selected the default value.
To ensure a proper subsequent ``cruft update``, you need to edit the ``.cruft.json`` file and put the proper last commit of the cookiecutter used in that ``commit`` field.
See cruft_link_ example.

Development
-----------
Expand Down Expand Up @@ -190,12 +190,12 @@ Make a new version of this Cookiecutter in the following steps:

* Make sure everything is commit to GitHub.
* Update ``CHANGES.rst`` with the next version.
* Dry Run: ``bump2version --dry-run --verbose --new-version 0.3.1 patch``
* Do it: ``bump2version --new-version 0.3.1 patch``
* ... or: ``bump2version --new-version 0.4.0 minor``
* Dry Run: ``bump-my-version bump --dry-run --verbose --new-version 0.3.1 patch``
* Do it: ``bump-my-version bump --new-version 0.3.1 patch``
* ... or: ``bump-my-version bump --new-version 0.4.0 minor``
* Push it: ``git push --tags``

See the bump2version_ documentation for details.
See the bump-my-version_ documentation for details.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _Cruft: https://cruft.github.io/cruft/
Expand All @@ -206,8 +206,7 @@ See the bump2version_ documentation for details.
.. _Tox: http://testrun.org/tox/
.. _Sphinx: http://sphinx-doc.org/
.. _ReadTheDocs: https://readthedocs.io/
.. _bump2version: https://pypi.org/project/bump2version/
.. _bump-my-version: https://github.com/callowayproject/bump-my-version
.. _0.2.x: https://github.com/bird-house/cookiecutter-birdhouse/tree/0.2.x
.. _Poetry: https://python-poetry.org/
.. _PyPi: https://pypi.python.org/pypi
.. _PyPI: https://pypi.python.org/pypi
.. _Mkdocs: https://pypi.org/project/mkdocs/
Loading

0 comments on commit a062df0

Please sign in to comment.