Open
Conversation
Add pyproject.toml for project configuration and dependencies
Removed jcb and wxflow dependencies, added jinja2, markupsafe, netcdf4, pyyaml, and xarray with specific versions.
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.
Description
This pull request introduces a new
pyproject.tomlfile to establish standardized Python packaging and dependency management for the project. It defines core and optional dependencies, project metadata, and testing and documentation requirements. Additionally, it updates therequirements_gcafs.txtfile to align package naming conventions with PEP 503 and removes local editable installs for certain packages.Python packaging and dependency management:
pyproject.tomlfile, specifying project metadata, core dependencies, optional dependency groups, test and documentation requirements, and build system configuration. This enables modern Python packaging workflows and standardizes dependency management.pyproject.toml, including package directories, package list, and pytest options.Dependency updates and cleanup:
requirements_gcafs.txtto use PEP 503-compliant lowercase package names (e.g.,jinja2,markupsafe,netcdf4,pyyaml) for consistency and compatibility.jcbandwxflowfromrequirements_gcafs.txt, as these are now handled as local editable installs per the note inpyproject.tomlThis gives us the maximum flexibility for our development and CI, as well as a way to generate requirements.txt files for NCO implementations
pyproject.toml usage
In the pyproject.toml there are several sections to install. If you simply do a
pip install .it will only install the core dependencies. This can be seen in https://github.com/bbakernoaa/global-workflow/blob/feature/gcafsv1_requirements/pyproject.toml#L20-L34The optional sections can be seen here https://github.com/bbakernoaa/global-workflow/blob/feature/gcafsv1_requirements/pyproject.toml#L36-L69
pip install .[all].pip install .[gcafs]pip install .[gcafs,testing,docs]Example for transition
To generate the requirements files use
pip-compilewithinpip-tools. For an example of executing this for deploymentThis generates a new file in
versions/requirements_gcafs.txt.Going forward, if applications need a specific requirement that isn't needed by other applications they can add it under their specific section.
Type of change
Change characteristics
How has this been tested?
Checklist