Open
Conversation
- Bump Python from 3.9 to 3.11 to match requires-python >= 3.11 - Update actions/checkout from v3 to v4 - Update actions/setup-python from v3 to v5 - Add pyproject.toml, setup.cfg, .python-version to workflow trigger paths (fixes #71) - Remove duplicate broken setup-python step in forcingprocessor_nrds.yaml
This workflow installs Python dependencies, configures AWS, and sets up testing for the forcing processor module.
Updated pytest commands to run with 'uv run' for better compatibility.
h5py 3.15.1 and netcdf4 1.7.4 bundle conflicting HDF5 C libraries, causing RuntimeError in H5DSget_num_scales when both are loaded. h5py 3.14.0 does not exhibit this conflict. See h5py/h5py#2453.
- Dockerfile.forcingprocessor-deps: python3.9 -> python3.11, install uv, replace all pip/pip3 calls with uv pip install --system - Dockerfile.forcingprocessor: pip3 install -> uv pip install --system - Add pyproject.toml, setup.cfg, .python-version to Docker workflow trigger paths (build_test_fp_x86, build_test_fp_arm, build_push_fp, integration_fp_ds_x86, integration_fp_ds_arm64) - Remove redundant uv_test_workflow.yml (covered by existing workflows)
Amazon Linux 2023 ships with Python 3.9 as the default python3. Installing python3.11 adds it as a separate binary but does not change the default. Use alternatives to set python3.11 as the default so uv resolves the correct Python version.
The alternatives command changed the default python3 to 3.11, which broke dnf on ARM since dnf depends on the system Python 3.9. Instead, use uv's --python python3.11 flag to target the correct interpreter without changing the system default.
Buildx stores images in its own cache instead of the local Docker daemon, causing forcingprocessor build to pull the old deps image from Docker Hub (without uv) instead of the locally-built one.
Packages are installed under python3.11 but datastream invokes scripts with python3 (which defaults to 3.9 on Amazon Linux 2023). This symlink is safe in the forcingprocessor image since no dnf operations run here.
Auto-cancels older runs when a new push arrives, preventing concurrent Terraform apply/destroy conflicts on shared resources.
Self-hosted runners accumulate old Docker images (21GB+) and /tmp is a 3.9GB tmpfs. docker save fails silently when space runs out. - Add docker system prune at start of build and test jobs - Use runner.temp (on disk) instead of /tmp (RAM-based tmpfs)
JordanLaserGit
approved these changes
Mar 13, 2026
Collaborator
JordanLaserGit
left a comment
There was a problem hiding this comment.
Great work @kamalcou and @harshavemula-ua!
Added instructions for creating a Python virtual environment using 'uv'.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates the uv Python tooling into the repository, updating dependency management/packaging metadata, Docker build steps, example configs, and CI workflow triggers to align with Python 3.11 and uv-based installs.
Changes:
- Add a pinned
requirements.txtanduv.lock, and migratepyproject.tomlto a uv build backend. - Update Dockerfiles to install/use
uvand move base images to Python 3.11. - Expand GitHub Actions workflow
pathsfilters and bump workflow Python versions to 3.11; update example config and README instructions.
Reviewed changes
Copilot reviewed 18 out of 21 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements.txt | Adds a pinned requirements set for uv/pip installs. |
| pyproject.toml | Introduces PEP 621 project metadata + uv build backend + script entry point. |
| docker/Dockerfile.forcingprocessor-deps | Switches base deps image to Python 3.11 and installs/uses uv. |
| docker/Dockerfile.forcingprocessor | Uses uv to install forcingprocessor + pytest in container. |
| configs/conf_fp.json | Updates example config to use repo-relative paths and local output directory. |
| README.md | Documents uv installation and uv-based run instructions. |
| .python-version | Pins repo Python version to 3.11. |
| .gitignore | Ignores generated data/forcing outputs. |
| .github/workflows/integration_fp_ds_x86.yaml | Expands workflow path triggers and adds concurrency control. |
| .github/workflows/integration_fp_ds_arm64.yaml | Expands workflow path triggers and adds concurrency control. |
| .github/workflows/forcingprocessor_weights.yaml | Updates CI to Python 3.11 and expands path triggers. |
| .github/workflows/forcingprocessor_sources_nwm_google.yaml | Updates CI to Python 3.11 and expands path triggers. |
| .github/workflows/forcingprocessor_sources_nwm_aws.yaml | Updates CI to Python 3.11 and expands path triggers. |
| .github/workflows/forcingprocessor_sources_nomads.yaml | Updates CI to Python 3.11 and expands path triggers. |
| .github/workflows/forcingprocessor_plotting.yaml | Updates CI to Python 3.11 and expands path triggers. |
| .github/workflows/forcingprocessor_output_opts.yaml | Updates CI to Python 3.11 and expands path triggers. |
| .github/workflows/forcingprocessor_nrds.yaml | Updates CI to Python 3.11 and removes conflicting setup-python usage. |
| .github/workflows/build_test_fp_x86.yaml | Expands workflow path triggers for packaging-related files. |
| .github/workflows/build_test_fp_arm.yaml | Expands workflow path triggers and improves cleanup/artifact paths. |
| .github/workflows/build_push_fp.yaml | Expands workflow path triggers for packaging-related files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -1,6 +1,105 @@ | |||
| [project] | |||
| name = "forcingprocessor" | |||
| version = "0.1.0" | |||
Comment on lines
+9
to
+42
| requires-python = ">=3.11" | ||
| dependencies = [ | ||
| "affine==2.4.0", | ||
| "aiohappyeyeballs==2.6.1", | ||
| "aiohttp==3.13.3", | ||
| "aiosignal==1.4.0", | ||
| "attrs==25.4.0", | ||
| "boto3==1.42.49", | ||
| "botocore==1.42.49", | ||
| "certifi==2026.1.4", | ||
| "cffi==2.0.0", | ||
| "cftime==1.6.5", | ||
| "charset-normalizer==3.4.4", | ||
| "click==8.3.1", | ||
| "click-plugins==1.1.1.2", | ||
| "cligj==0.7.2", | ||
| "cloudpickle==3.1.2", | ||
| "contourpy==1.3.3", | ||
| "cryptography==46.0.5", | ||
| "cycler==0.12.1", | ||
| "dask==2026.1.2", | ||
| "decorator==5.2.1", | ||
| "exactextract==0.3.0", | ||
| "fonttools==4.61.1", | ||
| "frozenlist==1.8.0", | ||
| "fsspec==2026.2.0", | ||
| "gcsfs==2026.2.0", | ||
| "geopandas==1.1.2", | ||
| "google-api-core==2.29.0", | ||
| "google-auth==2.48.0", | ||
| "google-auth-oauthlib==1.2.4", | ||
| "google-cloud-core==2.5.0", | ||
| "google-cloud-storage==3.9.0", | ||
| "google-cloud-storage-control==1.10.0", |
Comment on lines
+5
to
+6
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| ENV PATH="/root/.local/bin:${PATH}" |
Comment on lines
+16
to
+22
| ## install requirement files | ||
|
|
||
| ## Run the forcingprocessor | ||
| ``` | ||
| python src/forcingprocessor/processor.py ./configs/conf.json | ||
| uv pip install -r requirements.txt | ||
| ``` | ||
| ## make directory for output data | ||
| ``` |
Comment on lines
9
to
+15
| paths: | ||
| - 'docker/**' | ||
| - 'docker/**' | ||
| - 'src/forcingprocessor/**' | ||
| - '!src/forcingprocessor/README.md' | ||
| - 'pyproject.toml' | ||
| - 'setup.cfg' | ||
| - '.python-version' |
| description = "Tool to convert nwm forcing netcdfs to ngen compatible files" | ||
| readme ="README.md" | ||
| authors = [ | ||
| { name = "Jordan J. Laser", email = " jlaser@lynker.com" } |
Comment on lines
+100
to
+102
| [project.scripts] | ||
| forcingprocessor = "forcingprocessor:main" | ||
|
|
| FROM amazonlinux:2023 AS forcingprocessor_base | ||
|
|
||
| RUN dnf -y install pigz tar git python3.9 python3-pip | ||
| RUN dnf -y install pigz tar git python3.11 python3.11-pip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Short description explaining the high-level reason for the pull request]
UV package integration
requirements.txt
readme.md -- uv installation
.gitignore -- add !requirements.txt
pyproject.toml-- modified
uv.lock
configs/conf_fp.json -- add relative path
Additions
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist
Testing checklist
Target Environment support
Accessibility
Other