Skip to content

Commit

Permalink
Modernize library (#536)
Browse files Browse the repository at this point in the history
## Overview

Changes:

* Added the cruft configuration back in.
* Fast-forwarded changes.
* Modified existing documentation to remove mentions of RavenPy.

## Additional Information

The library still relies on the older approach to testing data
management. I'd like to update this both here and in RavenPy, as
(despite their complete separation) they use the same testing data sets.

Like `finch`, perhaps we can add this to PyPI as well? I've updated the
PyPI name to `birdhouse-raven` but seeing as this project no longer is
associated with RavenPy, I still feel like the proposal in #379 should
be considered.
  • Loading branch information
Zeitsperre authored Oct 18, 2024
2 parents 8777dc7 + 77c006d commit 270d992
Show file tree
Hide file tree
Showing 53 changed files with 708 additions and 471 deletions.
29 changes: 29 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"template": "https://github.com/bird-house/cookiecutter-birdhouse",
"commit": "2964f01a05703d88c087bb491811d16c703307b6",
"skip": [],
"context": {
"cookiecutter": {
"full_name": "David Huard",
"email": "[email protected]",
"github_username": "Ouranosinc",
"project_name": "Raven",
"project_slug": "raven",
"project_repo_name": "raven",
"project_readthedocs_name": "pavics-raven",
"project_short_description": "Raven offers processes related to hydrological modeling, and in particular, the Raven hydrological modeling framework.",
"version": "0.17.1",
"open_source_license": "MIT license",
"http_port": "9099",
"use_pytest": "y",
"use_black": "n",
"create_author_file": "y",
"_copy_without_render": [
"{{cookiecutter.project_slug}}/templates/*.cfg"
],
"__gh_slug": "Ouranosinc/raven",
"_template": "https://github.com/bird-house/cookiecutter-birdhouse"
}
},
"checkout": null
}
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ jobs:
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1.9.0
with:
cache-downloads: true
cache-environment: false
cache-environment: true
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
micromamba-version: "1.5.10-0" # pinned to avoid the breaking changes with mamba and micromamba (2.0.0).
- name: Install RavenWPS
run: |
python -m pip install --no-user --editable ".[dev]"
Expand Down
142 changes: 112 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,46 +1,75 @@
# installer
#Makefile

# Docker
#Dockerfile
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# PyWPS
custom.cfg
.custom.cfg
*.pid

# C extensions
*.so

# Python / Extensions etc.
*~
*.mo
*.so
*.pyc
*.pyo
*.egg
*.egg-info
*.sqlite
*.bak
__pycache__

+# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg

# Unit test / Coverage reports
*.cover
*.lock
*.log
.cache
.pytest_cache
.coverage
.tox
.coverage.*
.hypothesis/
.pytest_cache/
.tox/
coverage.xml
coverage/
htmlcov/
nosetests.xml
testdata.json
unit_tests/testdata.json
coverage/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Raven specific
Raven_errors.txt

# R
*.Rhistory

# Eclipse / PyDev
.project
.pydevproject
.settings

# PyCharm
*.idea

Expand All @@ -53,6 +82,10 @@ Raven_errors.txt
# Sublime Text Editor
*.sublime*

# Translations
*.mo
*.pot

# buildout
bin
develop-eggs
Expand All @@ -61,38 +94,54 @@ parts
build
dist
downloads
.installed.cfg
.mr.developer.cfg
bootstrap-buildout.py
bootstrap.py
#generated by buildout

*.pid

# sphinx
#docs/Makefile
docs/make.bat
# Sphinx documentation
docs/Makefile
docs/_build/
docs/_html/
docs/build/
docs/doctrees/
docs/html/
docs/build/
docs/make.bat
docs/source/modules.rst
docs/source/output-sanitize.cfg
docs/source/raven.*.rst
docs/source/raven.rst

# PyBuilder
target/

# External Sources
#src/external
src/

# tests
*.log
*.lock
testdata.json
tests/*/*/processor_0
tests/*/*/OstOutput*
tests/*/*/*.nc

# IPython
.ipynb_checkpoints
docs/source/notebooks/*.nc

# Jupyter Notebook
.ipynb_checkpoints

# Flask stuff:
instance/
.webassets-cache

# Dask worker cache
dask-worker-space/

# Scrapy stuff:
.scrapy

# pyenv
.python-version

# gcc/fortran
*.o
*.a
Expand All @@ -102,4 +151,37 @@ docs/source/notebooks/*.nc
# Merge conflict
*.orig

venv
# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# VSCode
.vscode/

# Eclipse / PyDev
.project
.pydevproject
.settings
12 changes: 6 additions & 6 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/asottile/pyupgrade
rev: v3.17.0
rev: v3.18.0
hooks:
- id: pyupgrade
args: [ '--py39-plus' ]
Expand Down Expand Up @@ -40,7 +40,6 @@ repos:
- id: flake8
args: [ '--config=.flake8' ]
additional_dependencies:
- "flake8-alphabetize==0.0.21"
- "flake8-rst-docstrings==0.3.0"
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
Expand All @@ -51,9 +50,9 @@ repos:
hooks:
- id: nbqa-pyupgrade
args: [ '--py39-plus' ]
additional_dependencies: [ 'pyupgrade==v3.15.2' ]
additional_dependencies: [ 'pyupgrade==v3.18.0' ]
- id: nbqa-black
additional_dependencies: [ 'black==24.4.2' ]
additional_dependencies: [ 'black==24.10.0' ]
- id: nbqa-isort
additional_dependencies: [ 'isort==5.13.2' ]
- repo: https://github.com/pycqa/pydocstyle
Expand All @@ -65,14 +64,15 @@ repos:
rev: v0.3.9
hooks:
- id: blackdoc
additional_dependencies: [ 'black==24.4.2' ]
additional_dependencies: [ 'black==24.10.0' ]
- id: blackdoc-autoupdate-black
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args: [ '--config-file=.yamllint.yaml' ]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.3
rev: 0.29.4
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sphinx:
build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"
python: "mambaforge-22.9"

formats: all

Expand Down
Loading

0 comments on commit 270d992

Please sign in to comment.