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

190 readme and dev deps improvements #191

Merged
merged 28 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e6976f4
removed upper bounds, some forgotten
veenstrajelmer Oct 18, 2024
013663e
added badges to readme
veenstrajelmer Oct 18, 2024
e29f21d
removed yml method from dev_install
veenstrajelmer Oct 18, 2024
4a7a6ea
publish action also with non-min yml file
veenstrajelmer Oct 18, 2024
170f642
update pyproject.toml with deps from yml
veenstrajelmer Oct 18, 2024
ffe6989
update docs workflow
veenstrajelmer Oct 18, 2024
6fde996
update docs workflow
veenstrajelmer Oct 18, 2024
8ab156a
update docs workflow
veenstrajelmer Oct 18, 2024
8cc5503
update docs workflow
veenstrajelmer Oct 18, 2024
8d5e349
update docs workflow
veenstrajelmer Oct 18, 2024
08cc123
update docs workflow
veenstrajelmer Oct 18, 2024
b440ff5
update docs workflow
veenstrajelmer Oct 18, 2024
ea4936e
update docs workflow
veenstrajelmer Oct 18, 2024
84fcb6c
update docs workflow
veenstrajelmer Oct 18, 2024
a4d9d02
update docs workflow
veenstrajelmer Oct 18, 2024
0d986a6
Merge branch 'main' into 190-readme-and-dev-deps-improvements
veenstrajelmer Oct 18, 2024
5aa1a80
update docs workflow
veenstrajelmer Oct 18, 2024
a92efaa
revert docs.yml
veenstrajelmer Oct 18, 2024
66c9012
revert docs.yml
veenstrajelmer Oct 18, 2024
e7ff922
revert docs.yml
veenstrajelmer Oct 18, 2024
9964433
update docs workflow
veenstrajelmer Oct 18, 2024
06479e6
update docs workflow
veenstrajelmer Oct 18, 2024
e85fbb9
updated publish.yml
veenstrajelmer Oct 18, 2024
3bf409d
remove env file itself
veenstrajelmer Oct 18, 2024
c880018
update docs workflow
veenstrajelmer Oct 18, 2024
2603fc7
formatting
veenstrajelmer Oct 18, 2024
2bd47b7
update docs workflow
veenstrajelmer Oct 18, 2024
c567df0
update docs workflow
veenstrajelmer Oct 18, 2024
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
23 changes: 15 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
name: Build Docs

# We don't want pushes (or PRs) to gh-pages to kick anything off
# Also build for PR's since this also tests whether all notebooks run properly
# However, do not upload to gh-pages if built from PR
on:
push:
branches: [main]
Expand All @@ -11,28 +12,34 @@ on:
jobs:
# Build docs on Linux
Docs:
name: linux docs
name: build docs
runs-on: ubuntu-latest
env:
DOC_VERSION: dev
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout source
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.9"
python-version: "3.11"
channels: conda-forge
channel-priority: strict
environment-file: envs/hydromt-delft3dfm.yml
activate-environment: hydromt-delft3dfm

- name: Install hydromt-delft3dfm
run: flit install
run: |
conda install flit
conda install pandoc # does not work via pip
flit install

- name: list env contents
run: |
pip list
hydromt --models

- name: Build docs
run: |
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: releases
Expand All @@ -62,19 +62,22 @@ jobs:
ls -ltrh dist

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.9"
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
environment-file: envs/hydromt-delft3dfm-min.yml
activate-environment: hydromt-delft3dfm
python-version: "3.11"
channels: conda-forge
channel-priority: strict

- name: Install hydromt-delft3dfm dependencies
run: |
conda install flit
flit install --only-deps

- name: Conda info
run: |
conda info
conda list
pip list

- name: Verify the built dist/wheel is valid
run: |
Expand Down
8 changes: 7 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
HydroMT-Delft3D FM: Delft3D FM plugin for HydroMT
=================================================

|ci| |codecov| |black| |docs_latest| |license| |sonarcloud|
|ci| |codecov| |black| |docs_latest| |license| |sonarcloud| |pypi| |pyversions|

What is the HydroMT-Delft3D FM plugin
-------------------------------------
Expand Down Expand Up @@ -70,3 +70,9 @@ happy to discuss how it can be implemented for your model.
.. |sonarcloud| image:: https://sonarcloud.io/api/project_badges/measure?project=Deltares_hydromt_delft3dfm&metric=alert_status
:alt: Quality Gate Status
:target: https://sonarcloud.io/summary/new_code?id=Deltares_hydromt_delft3dfm

.. |pypi| image:: https://img.shields.io/pypi/v/hydromt_delft3dfm.svg
:target: https://pypi.python.org/pypi/hydromt_delft3dfm

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/hydromt_delft3dfm.svg
:target: https://pypi.org/project/hydromt_delft3dfm
18 changes: 2 additions & 16 deletions docs/dev_guide/dev_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,10 @@ the code folder (where the envs folder and pyproject.toml are located):
$ git clone https://github.com/Deltares/hydromt_delft3dfm.git
$ cd hydromt_delft3dfm

Then, make and activate a new hydromt-delft3dfm conda environment based on the envs/hydromt-delft3dfm.yml
file contained in the repository:
Then, create and activate a new conda environment and install hydromt_delft3dfm as developer:

.. code-block:: console

$ conda env create -f envs/hydromt-delft3dfm.yml
$ conda create -n hydromt-delft3dfm python=3.11 -c conda-forge
$ conda activate hydromt-delft3dfm

If you wish to make changes in HydroMT-Delft3DFM, you should make an editable install of the plugin.
This can be done with:

.. code-block:: console

$ pip install -e .

If you encounter issues with the installation of some packages, you might consider cleaning conda to remove unused packages and caches.
This can be done through the following command from your base environment:

.. code-block:: console

$ conda clean -a
26 changes: 0 additions & 26 deletions envs/hydromt-delft3dfm-min.yml

This file was deleted.

39 changes: 0 additions & 39 deletions envs/hydromt-delft3dfm.yml

This file was deleted.

85 changes: 44 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
[build-system]
requires = ["flit_core >=3.4.0,<4"]
requires = ["flit_core >=3.4.0"]
build-backend = "flit_core.buildapi"

[project]
name = "hydromt_delft3dfm"
authors = [
{ name = "Rinske Hutten", email = "[email protected]" },
{ name = "Xiaohan Li", email = "[email protected]" },
{ name = "Hélène Boisgontier", email = "[email protected]" },
{ name = "Jelmer Veenstra", email = "[email protected]" },
{ name = "Sebastian Hartgring", email = "[email protected]" },
{ name = "Rinske Hutten", email = "[email protected]" },
{ name = "Xiaohan Li", email = "[email protected]" },
{ name = "Hélène Boisgontier", email = "[email protected]" },
{ name = "Jelmer Veenstra", email = "[email protected]" },
{ name = "Sebastian Hartgring", email = "[email protected]" },
]
dependencies = [
"hydromt>=0.10.0, <1", # TODO: move to hydromt>=1: https://github.com/Deltares/hydromt_delft3dfm/issues/137
"geopandas>=0.10, !=1.0.0", # gpd 1.0.0 has sjoin bug: https://github.com/geopandas/geopandas/issues/352
"numpy",
"pandas>=2.0.0",
"xarray",
"hydrolib-core>=0.8.0",
"xugrid>=0.9.0",
"meshkernel>=4.3.0",
"pyproj",
"shapely>=2.0.0",
"scipy",
"universal_pathlib>=0.2", # provides path compatibility between different filesystems
"pyflwdir>=0.5.4",
"networkx",
"hydromt>=0.10.0, <1", # TODO: move to hydromt>=1: https://github.com/Deltares/hydromt_delft3dfm/issues/137
"geopandas>=0.10, !=1.0.0", # gpd 1.0.0 has sjoin bug: https://github.com/geopandas/geopandas/issues/352
"numpy",
"pandas>=2.0.0",
"xarray",
"hydrolib-core>=0.8.0",
"xugrid>=0.9.0",
"meshkernel>=4.3.0",
"pyproj",
"shapely>=2.0.0",
"scipy",
"pyflwdir>=0.5.4",
"networkx",
]
requires-python = ">=3.9"
readme = "README.rst"
classifiers = [
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Hydrology",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Hydrology",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = ['version', 'description']

Expand All @@ -51,18 +50,22 @@ dev = [
"pre-commit", # linting
"pip>=23.1.2", # needed for recursive dependencies
]
test = ["pytest>=2.7.3", "pytest-cov", "black"]
doc = [
"nbsphinx",
"sphinx",
"sphinx_design",
"pydata-sphinx-theme",
"sphinx_autosummary_accessors",
test = [
"pytest>=2.7.3",
"pytest-cov",
]
docs = [
"nbsphinx", # docs notebook examples
"sphinx",
"sphinx_design",
"pydata-sphinx-theme",
"sphinx_autosummary_accessors",
]
examples = [
"jupyterlab", # run examples in jupyter notebook
"notebook", # jupyter integration
"cartopy", # plot examples
"jupyterlab", # run examples in jupyter notebook
"notebook", # jupyter integration
"cartopy", # plot examples
"matplotlib", # plot examples
]

[project.urls]
Expand Down
Loading