Skip to content

Commit

Permalink
fast-forward cookiecutter, update pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Oct 7, 2024
1 parent e819628 commit d981cca
Show file tree
Hide file tree
Showing 91 changed files with 523 additions and 219 deletions.
6 changes: 3 additions & 3 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
engines:
pylint:
enabled: true
python_version: 3
pylint:
enabled: true
python_version: 3
exclude_paths:
- 'tests/**'
- 'docs/source/conf.py'
3 changes: 2 additions & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/bird-house/cookiecutter-birdhouse.git",
"commit": "231d17eca6986f606d280cc25262d0153efd92c4",
"commit": "d25191ecc41c091d9b4a392f0ac89d70ff27db55",
"context": {
"cookiecutter": {
"full_name": "Carsten Ehbrecht",
Expand All @@ -20,6 +20,7 @@
"_copy_without_render": [
"{{cookiecutter.project_slug}}/templates/*.cfg"
],
"__gh_slug": "roocs/rook",
"_template": "https://github.com/bird-house/cookiecutter-birdhouse.git"
}
},
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ target/
# pyenv
.python-version

# Dask worker cache
dask-worker-space/

# celery beat schedule file
celerybeat-schedule

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: setup.cfg
Expand All @@ -12,7 +12,7 @@ repos:
- id: check-yaml
- id: debug-statements
- repo: https://github.com/ambv/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
args: ["--target-version", "py39"]
Expand Down
39 changes: 39 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---

rules:

brackets:
forbid: false
min-spaces-inside: 1
max-spaces-inside: 1

commas:
min-spaces-after: 1

document-start: disable

float-values:
require-numeral-before-decimal: true

hyphens:
max-spaces-after: 1

indentation:
indent-sequences: whatever
spaces: consistent

key-duplicates:
forbid-duplicated-merge-keys: true

line-length:
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
max: 180
level: warning

new-lines:
type: unix

trailing-spaces: {}

truthy: disable
File renamed without changes.
84 changes: 84 additions & 0 deletions CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
====================================
Contributor Covenant Code of Conduct
====================================

Our Pledge
----------

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

Our Standards
-------------

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

Our Responsibilities
--------------------

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

Scope
-----

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

Enforcement
-----------

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

Attribution
-----------

This Code of Conduct is adapted from the `Contributor Covenant`_, version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

.. _`Contributor Covenant`: https://www.contributor-covenant.org
22 changes: 15 additions & 7 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)
* Remember that this is a volunteer-driven project, and that contributions are welcome :)

Get Started!
------------
Expand All @@ -79,9 +78,10 @@ Ready to contribute? Here's how to set up `rook` for local development.
5. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::

$ flake8 rook tests
$ python setup.py test or pytest
$ tox
$ make lint
$ make test
Or
$ make test-all

To get flake8 and tox, just pip install them into your virtualenv.

Expand All @@ -100,7 +100,7 @@ Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
3. The pull request should work for Python 3.7, 3.8, 3.9, 3.10 and 3.11. Check https://github.com/roocs/rook/actions and make sure that the tests pass for all supported Python versions.
3. The pull request should work for all supported Python versions. Check https://github.com/roocs/rook/actions and make sure that the tests pass for all supported Python versions.

Tips
----
Expand All @@ -117,6 +117,14 @@ A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).
Then run::

$ bump2version patch # possible: major / minor / patch
$ bump-my-version bump patch # possible: major / minor / patch
$ git push
$ git push --tags

Code of Conduct
---------------

Please note that this project is released with a `Contributor Code of Conduct`_.
By participating in this project you agree to abide by its terms.

.. _`Contributor Code of Conduct`: CODE_OF_CONDUCT.rst
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ clean-docs: ## remove documentation artifacts

lint/flake8: ## check style with flake8
@echo "Running flake8 code style checks ..."
@bash -c 'flake8 rook tests'
@bash -c 'ruff check rook tests'

lint: lint/flake8 ## check style

Expand All @@ -128,7 +128,6 @@ notebook-sanitizer: ## download notebook output sanitizer
@echo "Copying notebook output sanitizer ..."
@-bash -c "curl -L $(SANITIZE_FILE) -o $(CURDIR)/docs/source/output-sanitize.cfg --silent"


test-notebooks: notebook-sanitizer ## run notebook-based tests
@echo "Running notebook-based tests"
@bash -c "env WPS_URL=$(WPS_URL) pytest --nbval --rootdir tests/ --verbose $(CURDIR)/docs/source/notebooks/ --sanitize-with $(CURDIR)/docs/source/output-sanitize.cfg --ignore $(CURDIR)/docs/source/notebooks/.ipynb_checkpoints"
Expand Down Expand Up @@ -156,22 +155,17 @@ servedocs: docs ## compile the docs watching for changes
@echo "Compiling the docs and watching for changes ..."
@watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

notebook-sanitizer: ## sanitize notebooks with configuration file
@echo "Copying notebook output sanitizer ..."
@-bash -c "curl -L $(SANITIZE_FILE) -o $(CURDIR)/docs/source/output-sanitize.cfg --silent"

refresh-notebooks: ## refreshing all notebook outputs under docs/source/notebooks
refresh-notebooks: notebook-sanitizer ## refreshing all notebook outputs under docs/source/notebooks
@echo "Refresh all notebook outputs under docs/source/notebooks"
@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)'

## Deployment targets:

dist: clean ## build source and wheel package
@echo "Building source and wheel package ..."
@python setup.py sdist
@python setup.py bdist_wheel
@python -m build --sdist
@bash -c 'ls -l dist/'

release: dist ## upload source and wheel packages
@echo "Uploading source and wheel packages ..."
@bash -c 'twine upload dist/*'
@python -m flit publish dist/*
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Contributing

You can find information about contributing in our `Developer Guide`_.

Please use bump2version_ to release a new version.
Please use bump-my-version_ to release a new version.

Tests
-----
Expand All @@ -61,9 +61,9 @@ Credits

This package was created with Cookiecutter_ and the `bird-house/cookiecutter-birdhouse`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _Cookiecutter: https://github.com/cookiecutter/cookiecutter
.. _`bird-house/cookiecutter-birdhouse`: https://github.com/bird-house/cookiecutter-birdhouse
.. _`Developer Guide`: https://rook-wps.readthedocs.io/en/latest/dev_guide.html
.. _bump2version: https://rook.readthedocs.io/en/latest/dev_guide.html#bump-a-new-version
.. _bump-my-version: https://rook.readthedocs.io/en/latest/dev_guide.html#bump-a-new-version
.. _daops: https://github.com/roocs/daops
.. _locust: https://locust.io/
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../../CHANGELOG.rst
1 change: 0 additions & 1 deletion docs/source/changes.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"hdf5",
"matplotlib",
"netCDF4",
"networkx",
"numba",
"numpy",
"ocgis",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
processes
authors
prov
changes
changelog

Indices and tables
==================
Expand Down
22 changes: 22 additions & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: rook-dev
channels:
- conda-forge
- defaults
dependencies:
- python >=3.9,<3.13
# development
- bump-my-version >=0.26.0
- coverage >=7.5.0
- cruft >=2.15.0
- flit >=3.9.0,<4.0
- nbsphinx >=0.9.5
- nbval >=0.10.0
- ruff >=0.5.7
- sphinx >=7.0.0
- tox >=4.18.0
- watchdog >=4.0.0
# tests
- pytest >=8.0.0
- pytest-cov >=5.0.0
- pytest-timeout >=2.3.1
- beautifulsoup4 >4.12.3
7 changes: 4 additions & 3 deletions environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
name: rook
channels:
- conda-forge
- defaults
dependencies:
- python >=3.9,<3.10
- pywps >=4.5.2,<4.7
- python >=3.9,<3.12
- pywps >=4.6
- sphinx >=7.0.0
- nbsphinx >=0.9.5
- ipython >=8.13.0
- ipython >=8.5.0
13 changes: 5 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: rook
channels:
- conda-forge
- defaults
dependencies:
- python >=3.9,<3.12
- pywps >=4.5.2,<4.7
- jinja2
- click
- psutil
- pywps >=4.6
- jinja2 >=3.1.4
- click >=8.1.7
- psutil >=6.0.0
- requests
- cftime >=1.2.1
- xarray >=0.21,<2023.3.0 # https://github.com/pydata/xarray/issues/7794
Expand All @@ -31,7 +32,3 @@ dependencies:
- aiohttp
# dashboard
- bokeh
# tests
- pytest
- pytest-timeout
- beautifulsoup4
Loading

0 comments on commit d981cca

Please sign in to comment.