Skip to content

Make installation of the raven_hydro library optional#486

Merged
Zeitsperre merged 12 commits intomasterfrom
optional-raven-hydro
Apr 15, 2025
Merged

Make installation of the raven_hydro library optional#486
Zeitsperre merged 12 commits intomasterfrom
optional-raven-hydro

Conversation

@Zeitsperre
Copy link
Copy Markdown
Member

@Zeitsperre Zeitsperre commented Apr 14, 2025

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • CHANGELOG.rst has been updated (with summary of main changes).
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.

What kind of change does this PR introduce?

  • Moves the raven-hydro and RHF-handling code to the top-level imports.
  • Adds a new ravenpy[raven-hydro] pip recipe.
  • Adds a test that temporarily renders the raven_hydro and raven binary invisible using monkeypatch to test import behaviour.

Does this PR introduce a breaking change?

Yes. raven-hydro now needs to be explicitly installed. Users should be told to use the pip recipe, since the raven-hydro package hosted on conda-forge needs to be installed with an explicitly-defined version (e.g. ==0.4.0).

Other information:

I haven't yet tested this on Windows. Path patching might be exactly the same.

@Zeitsperre Zeitsperre requested a review from huard April 14, 2025 17:59
@Zeitsperre
Copy link
Copy Markdown
Member Author

FYI @RondeauG and @sebastienlanglois

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 14, 2025

Coverage Status

coverage: 82.083% (+0.05%) from 82.037%
when pulling 8c40e55 on optional-raven-hydro
into 598795f on master.

@RondeauG
Copy link
Copy Markdown
Collaborator

RondeauG commented Apr 14, 2025

What does it change, in concrete terms? Do we need to add raven-hydro to our YAML/pyproject files?

Edit: Since I think that we want its features in xHydro?

@Zeitsperre
Copy link
Copy Markdown
Member Author

Zeitsperre commented Apr 14, 2025

If you install RavenPy from PyPI, it will no longer come with the requirement of the source package raven-hydro (i.e. users will need to install that themselves or pass $ pip install ravenpy[raven-hydro] to get it).

If the raven-hydro Python/conda package isn't found, you need to set the PATH to the raven binary/executable; If it doesn't find either, the package will fail with a RuntimeError. Since the raven version string is provided via the Python package, the default version in this case will read 0.0.0.

I want to keep raven-hydro in the conda package, so if you use conda entirely, there will be zero changes. For a pure Python installation, compiling raven-hydro was already required, but this makes it so that you need to do that explicitly.

@Zeitsperre Zeitsperre mentioned this pull request Apr 14, 2025
5 tasks
Copy link
Copy Markdown
Collaborator

@huard huard left a comment

Choose a reason for hiding this comment

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

Nice improvement.

### What kind of change does this PR introduce?

* Raises the minimum version of `pydantic` to v2.11
* Addresses ~6500 `DeprecationWarning`s emitted from `pydantic`

### Does this PR introduce a breaking change?

Not really. Newer `pydantic` has been added as a dependency.
@Zeitsperre Zeitsperre merged commit c926eeb into master Apr 15, 2025
17 checks passed
@Zeitsperre Zeitsperre deleted the optional-raven-hydro branch April 15, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make raven-hydro dependency optional

4 participants