Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt PEP 517 and PEP 621, use raven-hydro package #278

Merged
merged 70 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2dfcd0f
update pre-commit hooks
Zeitsperre Apr 19, 2023
c1f547d
remove MANIFEST.in
Zeitsperre Apr 19, 2023
d41b6e4
remove requirement files
Zeitsperre Apr 19, 2023
5b25eba
update dynamic package fields
Zeitsperre Apr 19, 2023
102870f
update setup.cfg for new structure
Zeitsperre Apr 19, 2023
d939260
use relative imports to deal with import resolution issues
Zeitsperre Apr 19, 2023
2dece38
replace setup.py with pyproject.toml
Zeitsperre Apr 19, 2023
c34ccd9
note that clisops is mocked
Zeitsperre Apr 19, 2023
baa3385
readability
Zeitsperre Apr 19, 2023
46ff437
fix CLI entrypoint
Zeitsperre Apr 19, 2023
bb3bbd8
update installation instructions and remove tox/Makefile calls to obs…
Zeitsperre Apr 19, 2023
503395b
remove check-manifest skip
Zeitsperre Apr 19, 2023
79b482c
add pytest markers
Zeitsperre Apr 19, 2023
58b23d0
add gdal to RtD build
Zeitsperre Apr 19, 2023
94c9864
comment out tox GDAL compile
Zeitsperre Apr 19, 2023
f61235b
Merge branch 'master' into adopt_pep517-621
Zeitsperre May 3, 2023
9c5ed30
update xclim, simplify build procedure
Zeitsperre May 9, 2023
859a3e4
Merge branch 'master' into adopt_pep517-621
Zeitsperre May 9, 2023
f934ec1
Update pyproject.toml
Zeitsperre May 10, 2023
b6fcbba
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 10, 2023
31175e1
WIP - add raven-hydro to tox build
Zeitsperre May 10, 2023
48ba8ad
try a workaround to not have ReadTheDocs run `--upgrade-strategy eager`
Zeitsperre May 12, 2023
c314021
dependency management
Zeitsperre May 12, 2023
f3d59e6
GDAL
Zeitsperre May 12, 2023
6d32f07
typo
Zeitsperre May 12, 2023
3b19b0c
fix deprecations
Zeitsperre May 12, 2023
b2d1412
typos
Zeitsperre May 12, 2023
c866eb5
add pooch
Zeitsperre May 12, 2023
b83cdc4
simplify installation process further
Zeitsperre May 12, 2023
1fae833
add a windows build
Zeitsperre May 12, 2023
db9795e
synchronize and simplify
Zeitsperre May 12, 2023
bc3a3b7
add a macOS pip build
Zeitsperre May 12, 2023
1f64551
fix sed call
Zeitsperre May 12, 2023
8c6a500
fix owslib version
Zeitsperre May 12, 2023
5b4a99f
fix owslib version
Zeitsperre May 12, 2023
c1b2cd1
tweaks
Zeitsperre May 12, 2023
a3619f0
tweaks
Zeitsperre May 12, 2023
21513fd
update to newest geopandas API
Zeitsperre May 15, 2023
8bdbcd8
add pyogrio
Zeitsperre May 15, 2023
a7c3d4c
remove lots of redundant dependencies, make mention to update install…
Zeitsperre May 19, 2023
6d748aa
update contributor documentation
Zeitsperre May 19, 2023
59c2bff
port remaining enhancements from experimental branch
Zeitsperre May 19, 2023
be6fe55
update installation instructions
Zeitsperre May 23, 2023
ebb5729
add raven-hydro to requirements
Zeitsperre May 23, 2023
17fc9fa
add raven-hydro to requirements, pin pydantic to 1.10.8+
Zeitsperre May 23, 2023
6065713
drop python3.9, install raven-hydro in conda by sdist
Zeitsperre May 23, 2023
c75901e
==
Zeitsperre May 23, 2023
2df1f85
do not drop Python3.8, build raven-hydro from sources always
Zeitsperre May 23, 2023
f6c256e
use raven-hydro conda package
Zeitsperre May 24, 2023
6cc0c1d
update CI
Zeitsperre May 24, 2023
4dad1fe
install conda, force cache update
Zeitsperre May 24, 2023
312ba8d
try Python3.10
Zeitsperre May 24, 2023
f053d7a
Merge branch 'master' into adopt_pep517-621
huard May 24, 2023
d72f712
install climpred via PyPI
Zeitsperre May 24, 2023
4de60f5
Add a macos conda build
Zeitsperre May 24, 2023
870af30
pin netcdf4 at or below 1.6.0
Zeitsperre May 24, 2023
51bbc7f
pin netcdf4 below 1.6.3
Zeitsperre May 24, 2023
78b470f
unable to pin netcdf, constrain python
Zeitsperre May 24, 2023
ad5b88d
mark dap test as online
Zeitsperre May 24, 2023
575d854
use a context manager to access netcdf data within a session-scope py…
Zeitsperre May 24, 2023
7785bf5
try context manager approach
Zeitsperre May 24, 2023
b0806b5
adjust test
Zeitsperre May 24, 2023
d10039c
adjust CI - drop windows
Zeitsperre May 24, 2023
9a84f58
update CI for more build coverage
Zeitsperre May 25, 2023
1617fb1
update conda environment information
Zeitsperre May 25, 2023
153e61d
Update documentation to reflect changes
Zeitsperre May 25, 2023
75b51c9
attempt to fix domain lookup bug
Zeitsperre May 25, 2023
698b740
pin raven-hydro to v0.2.1
Zeitsperre May 25, 2023
85b5c64
allow errors for macOS
Zeitsperre May 25, 2023
8701053
allow errors for macOS on PyPI
Zeitsperre May 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,33 @@ repos:
rev: v3.4.0
hooks:
- id: pyupgrade
args: [ --py38-plus ]
args: [ '--py38-plus' ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: .rvc|.rvh|.rvi|.rvp|.rvt|.tpl|.txt|setup.cfg
- id: end-of-file-fixer
exclude: .ipynb|.rvc|.rvh|.rvi|.rvp|.rvt|.tpl|.txt
- id: check-json
- id: check-toml
- id: check-yaml
args: [ --allow-multiple-documents ]
args: [ '--allow-multiple-documents' ]
- id: debug-statements
- id: pretty-format-json
args: [ '--autofix', '--no-ensure-ascii', '--no-sort-keys' ]
- id: debug-statements
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: rst-inline-touching-normal
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.0
hooks:
- id: toml-sort-fix
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
exclude: ^docs/
args: [ --target-version=py38 ]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
Expand All @@ -40,19 +42,16 @@ repos:
rev: 5.12.0
hooks:
- id: isort
args: [ --settings-file=setup.cfg ]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-pyupgrade
args: [ --py38-plus ]
additional_dependencies: [ pyupgrade==3.3.1 ]
additional_dependencies: [ 'pyupgrade==3.3.1' ]
- id: nbqa-black
args: [ --target-version=py38 ]
additional_dependencies: [ black==23.3.0 ]
additional_dependencies: [ 'black==23.3.0' ]
- id: nbqa-isort
args: [ --settings-file=setup.cfg ]
additional_dependencies: [ isort==5.12.0 ]
additional_dependencies: [ 'isort==5.12.0' ]
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
Expand All @@ -62,16 +61,12 @@ repos:
rev: v0.3.8
hooks:
- id: blackdoc
additional_dependencies: [ black==23.3.0 ]
additional_dependencies: [ 'black==23.3.0' ]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.31.0
hooks:
- id: yamllint
args: [ '--config-file', '.yamllint.yaml' ]
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
args: [ '--config-file=.yamllint.yaml' ]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.0
hooks:
Expand All @@ -91,5 +86,5 @@ ci:
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: [ check-manifest ]
skip: [ ]
submodules: false
36 changes: 0 additions & 36 deletions MANIFEST.in

This file was deleted.

8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ release: dist ## package and upload a release
twine upload dist/*

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
flit build
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py install
python -m pip install --no-user .

develop: clean ## install the package and development dependencies in editable mode to the active Python's site-packages
python -m pip install --no-user --editable ".[dev]"
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Raven_ is an hydrological modeling framework that lets hydrologists build hydrol

Note that version 0.20 includes major changes compared to the previous 0.12 release, and breaks backward compatibility. The benefits of these changes are a much more intuitive interface for configuring and running the model.


Features
--------

Expand Down
45 changes: 5 additions & 40 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Custom Installation (Python/Pip)
--------------------------------

.. warning::
The following instructions will only work on POSIX-like systems (Unix/Linux; not supported on Windows).
As of April 2023, this installation method does not install the `raven-hydro` hydrological model. You must install the `raven-hydro` model and add it to your `bin` or append it to your `$PATH` manually. This may change in the future

If you wish to install RavenPy and its C-libraries manually, compiling the `Raven` binaries for your system,
If you wish to install RavenPy and its C-libraries manually, compiling the `Raven` binary for your system,
you can install the entire system directly, placing them in the `bin` folder of your environment.
In order to perform this from Ubuntu/Debian:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point to the Raven documentation ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make sure that the Install docs are clear on what needs to be done now, ie. use conda or compile yourself.

Expand All @@ -48,51 +48,25 @@ Then, from your python environment, run:
.. code-block:: console

$ pip install ravenpy[gis]
$ pip install ravenpy[gis] --verbose --install-option="--with-binaries"

.. warning::

It is imperative that the Python dependencies are pre-installed before running the `--with-binaries`
option; This install step will fail otherwise.

If desired, the core functions of `RavenPy` can be installed without its GIS functionalities as well.
This implementation of RavenPy is much lighter on dependencies and can be installed easily with `pip`,
without the need for `conda` or `virtualenv`.

The only libraries required for RavenPy in this approach are a C++ compiler and the NetCDF4 development libraries.

.. code-block:: console

$ sudo apt-get install gcc libnetcdf-dev

.. code-block:: console

$ pip install ravenpy
$ pip install ravenpy --verbose --install-option="--with-binaries"

.. warning::

It is imperative that the Python dependencies are pre-installed before running the `--with-binaries`
option; This install step will fail otherwise.

If for any reason you prefer to install without the binaries, from a fresh python environment, run the following:

.. code-block:: console

(ravenpy-env) $ pip install ravenpy[gis]

But then you will be in charge of providing ``raven`` binaries on your PATH, or setting values for the
``RAVENPY_RAVEN_BINARY_PATH`` environment variable (as an absolute path) in the
terminal/command prompt/shell used at runtime.

.. note::

The `virtualenv <https://virtualenv.pypa.io/en/latest/>`_ implementation also works well, but the
GIS system libraries it depends on (specifically `GDAL` and `GEOS`) can be more difficult to configure.

Development Installation (from sources)
---------------------------------------

.. warning::
As of April 2023, this installation method does not install the `raven-hydro` hydrological model. You must install the `raven-hydro` model and add it to your `bin` or append it to your `$PATH` manually. This may change in the future

The sources for RavenPy can be obtained from the GitHub repo:

.. code-block:: console
Expand All @@ -116,15 +90,6 @@ You can then install RavenPy with:
# for the python dependencies
(ravenpy) $ pip install --editable ".[dev]"

.. warning::

The following command will only work on POSIX-like systems (Unix/Linux; not supported on Windows).

.. code-block:: console

# for the Raven binaries
(ravenpy) $ pip install --editable "." --install-option="--with-binaries"

Install the pre-commit hook (to make sure that any code you contribute is properly formatted):

.. code-block:: console
Expand Down
2 changes: 2 additions & 0 deletions environment-rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ dependencies:
- python >=3.8,<3.11
- autodoc-pydantic
- click
# - clisops # mocked
- gdal
- ipykernel
- ipython
- jupyter_client
Expand Down
8 changes: 4 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ dependencies:
- lxml
- matplotlib
- netCDF4
- numpy < 1.24
- owslib >=0.24.1,<0.29
- pandas < 2.0
- numpy
- owslib >=0.29.1
- pandas <2.0
- pint >=0.20
- pip
- pre-commit
Expand All @@ -39,6 +39,6 @@ dependencies:
- spotpy
- statsmodels
- xarray <2022.11.0 # Pinned due to incompatibility with climpred @ 2.2.0
- xclim >=0.40
- xclim >=0.41
- xskillscore
- wheel
Loading