From db36bef32a1e4bfcc6a4c86d48dafa0a2a8fe211 Mon Sep 17 00:00:00 2001 From: btschwertfeger Date: Tue, 30 Apr 2024 05:54:44 +0200 Subject: [PATCH] cleanup --- .github/workflows/cicd.yaml | 160 ++++++++++++++++++------------------ CHANGELOG.md | 46 ++++++++++- Makefile | 3 +- README.md | 3 + doc/getting_started.rst | 3 + 5 files changed, 131 insertions(+), 84 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index d3e7ca7..ad93cdc 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -21,15 +21,15 @@ concurrency: cancel-in-progress: true jobs: - # ## Checks the code logic, style and more - # ## - # Pre-Commit: - # uses: ./.github/workflows/_pre_commit.yaml + ## Checks the code logic, style and more + ## + Pre-Commit: + uses: ./.github/workflows/_pre_commit.yaml - # ## Discover vulnerabilities - # ## - # CodeQL: - # uses: ./.github/workflows/_codeql.yaml + ## Discover vulnerabilities + ## + CodeQL: + uses: ./.github/workflows/_codeql.yaml ## Builds the package on multiple OS for multiple ## Python versions @@ -46,79 +46,79 @@ jobs: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - # ## Build the documentation - # ## - # Build-Doc: - # needs: [Pre-Commit] - # uses: ./.github/workflows/_build_doc.yaml - # with: - # os: ubuntu-latest - # python-version: "3.11" + ## Build the documentation + ## + Build-Doc: + needs: [Pre-Commit] + uses: ./.github/workflows/_build_doc.yaml + with: + os: ubuntu-latest + python-version: "3.11" - # ## Run the unit tests for Python 3.8 until 3.11 - # ## - # Test: - # needs: [Pre-Commit] - # uses: ./.github/workflows/_test.yaml - # strategy: - # matrix: - # os: [ubuntu-latest, windows-latest] - # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - # with: - # os: ${{ matrix.os }} - # python-version: ${{ matrix.python-version }} + ## Run the unit tests for Python 3.8 until 3.11 + ## + Test: + needs: [Pre-Commit] + uses: ./.github/workflows/_test.yaml + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + with: + os: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} - # ## Generates and uploads the coverage statistics to codecov - # ## - # CodeCov: - # if: | - # (success() && github.actor == 'btschwertfeger') - # && (github.event_name == 'push' || github.event_name == 'release') - # needs: [Pre-Commit] - # uses: ./.github/workflows/_codecov.yaml - # with: - # os: ubuntu-latest - # python-version: "3.11" - # secrets: inherit + ## Generates and uploads the coverage statistics to codecov + ## + CodeCov: + if: | + (success() && github.actor == 'btschwertfeger') + && (github.event_name == 'push' || github.event_name == 'release') + needs: [Pre-Commit] + uses: ./.github/workflows/_codecov.yaml + with: + os: ubuntu-latest + python-version: "3.11" + secrets: inherit - # ## Uploads the package to test.pypi.org on master if triggered by - # ## a regular commit/push. - # ## - # UploadTestPyPI: - # if: | - # ( - # success() - # && github.actor == 'btschwertfeger' - # && github.ref == 'refs/heads/master' - # ) - # && (github.event_name == 'push' || github.event_name == 'release') - # needs: - # - Build - # - Build-Doc - # - Test - # - CodeQL - # name: Upload current version to Test PyPI - # uses: ./.github/workflows/_pypi_publish.yaml - # with: - # REPOSITORY_URL: https://test.pypi.org/legacy/ - # secrets: - # API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} + ## Uploads the package to test.pypi.org on master if triggered by + ## a regular commit/push. + ## + UploadTestPyPI: + if: | + ( + success() + && github.actor == 'btschwertfeger' + && github.ref == 'refs/heads/master' + ) + && (github.event_name == 'push' || github.event_name == 'release') + needs: + - Build + - Build-Doc + - Test + - CodeQL + name: Upload current version to Test PyPI + uses: ./.github/workflows/_pypi_publish.yaml + with: + REPOSITORY_URL: https://test.pypi.org/legacy/ + secrets: + API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} - # ## Upload the python-kraken-sdk to Production PyPI - # ## - # UploadPyPI: - # if: | - # success() && - # github.actor == 'btschwertfeger' && - # github.event_name == 'release' - # needs: - # - Build - # - Build-Doc - # - Test - # - CodeQL - # name: Upload the current release to PyPI - # uses: ./.github/workflows/_pypi_publish.yaml - # with: - # REPOSITORY_URL: https://upload.pypi.org/legacy/ - # secrets: - # API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + ## Upload the python-kraken-sdk to Production PyPI + ## + UploadPyPI: + if: | + success() && + github.actor == 'btschwertfeger' && + github.event_name == 'release' + needs: + - Build + - Build-Doc + - Test + - CodeQL + name: Upload the current release to PyPI + uses: ./.github/workflows/_pypi_publish.yaml + with: + REPOSITORY_URL: https://upload.pypi.org/legacy/ + secrets: + API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index aef6031..8da2403 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,50 @@ ## [Unreleased](https://github.com/btschwertfeger/python-cmethods/tree/HEAD) -[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v2.0.2...HEAD) +[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v2.2.1...HEAD) **Merged pull requests:** -- Fix typos and update pre-commit hooks [\#64](https://github.com/btschwertfeger/python-cmethods/pull/64) ([btschwertfeger](https://github.com/btschwertfeger)) +- Bump actions/checkout from 4.1.2 to 4.1.4 [\#90](https://github.com/btschwertfeger/python-cmethods/pull/90) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump actions/upload-artifact from 4.3.1 to 4.3.2 [\#89](https://github.com/btschwertfeger/python-cmethods/pull/89) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump codecov/codecov-action from 4.2.0 to 4.3.0 [\#87](https://github.com/btschwertfeger/python-cmethods/pull/87) ([dependabot[bot]](https://github.com/apps/dependabot)) + +## [v2.2.1](https://github.com/btschwertfeger/python-cmethods/tree/v2.2.1) (2024-04-10) + +[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v2.2.0...v2.2.1) + +**Merged pull requests:** + +- Fix missing function documentation [\#85](https://github.com/btschwertfeger/python-cmethods/pull/85) ([btschwertfeger](https://github.com/btschwertfeger)) + +## [v2.2.0](https://github.com/btschwertfeger/python-cmethods/tree/v2.2.0) (2024-04-09) + +[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v2.1.0...v2.2.0) + +**Implemented enhancements:** + +- Add a command-line interface [\#82](https://github.com/btschwertfeger/python-cmethods/issues/82) +- Resolve "Add a command-line interface" [\#83](https://github.com/btschwertfeger/python-cmethods/pull/83) ([btschwertfeger](https://github.com/btschwertfeger)) + +**Merged pull requests:** + +- Bump codecov/codecov-action from 4.1.0 to 4.2.0 [\#80](https://github.com/btschwertfeger/python-cmethods/pull/80) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump actions/setup-python from 5.0.0 to 5.1.0 [\#79](https://github.com/btschwertfeger/python-cmethods/pull/79) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Adjust GitHub Action permissions [\#75](https://github.com/btschwertfeger/python-cmethods/pull/75) ([btschwertfeger](https://github.com/btschwertfeger)) +- Bump actions/upload-artifact from 3.1.0 to 4.3.1 [\#74](https://github.com/btschwertfeger/python-cmethods/pull/74) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump actions/checkout from 3.1.0 to 4.1.2 [\#72](https://github.com/btschwertfeger/python-cmethods/pull/72) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump ossf/scorecard-action from 2.1.2 to 2.3.1 [\#71](https://github.com/btschwertfeger/python-cmethods/pull/71) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Update the documentation + project maintenance [\#70](https://github.com/btschwertfeger/python-cmethods/pull/70) ([btschwertfeger](https://github.com/btschwertfeger)) +- Add `scorecard.yml` workflow [\#69](https://github.com/btschwertfeger/python-cmethods/pull/69) ([btschwertfeger](https://github.com/btschwertfeger)) + +## [v2.1.0](https://github.com/btschwertfeger/python-cmethods/tree/v2.1.0) (2024-03-10) + +[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v2.0.2...v2.1.0) + +**Implemented enhancements:** + +- Adjustments using `adjust` require the input data of the control period to have the same size for the time dimension [\#66](https://github.com/btschwertfeger/python-cmethods/issues/66) +- Resolve "Adjustments using `adjust` require the input data of the control period to have the same size for the time dimension" [\#67](https://github.com/btschwertfeger/python-cmethods/pull/67) ([btschwertfeger](https://github.com/btschwertfeger)) ## [v2.0.2](https://github.com/btschwertfeger/python-cmethods/tree/v2.0.2) (2024-02-02) @@ -14,8 +53,9 @@ **Merged pull requests:** -- Update documentation -- QM and QDM formulas [\#62](https://github.com/btschwertfeger/python-cmethods/pull/62) ([btschwertfeger](https://github.com/btschwertfeger)) - Bump GitHub action versions [\#59](https://github.com/btschwertfeger/python-cmethods/pull/59) ([btschwertfeger](https://github.com/btschwertfeger)) +- Fix typos and update pre-commit hooks [\#64](https://github.com/btschwertfeger/python-cmethods/pull/64) ([btschwertfeger](https://github.com/btschwertfeger)) +- Update documentation -- QM and QDM formulas [\#62](https://github.com/btschwertfeger/python-cmethods/pull/62) ([btschwertfeger](https://github.com/btschwertfeger)) ## [v2.0.1](https://github.com/btschwertfeger/python-cmethods/tree/v2.0.1) (2024-02-01) diff --git a/Makefile b/Makefile index d204477..5c2c962 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ VENV := venv PYTHON := $(VENV)/bin/python3 TESTS := tests PYTEST_OPTS := -vv +ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) .PHONY: help help: @@ -82,7 +83,7 @@ ruff-fix: .PHONY: changelog changelog: docker run -it --rm \ - -v "$(PWD)":/usr/local/src/your-app/ \ + -v $(ROOT_DIR):/usr/local/src/your-app/ \ githubchangeloggenerator/github-changelog-generator \ -u btschwertfeger \ -p python-cmethods \ diff --git a/README.md b/README.md index 61b292f..c4b74a4 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,9 @@ https://python-cmethods.readthedocs.io/en/stable/ ## 3. Installation +> For optimal compatibility on macOS, ensure that 'hdf5' and 'netcdf' are +> pre-installed using Homebrew (`brew install hdf5 netcdf`). + ```bash python3 -m pip install python-cmethods ``` diff --git a/doc/getting_started.rst b/doc/getting_started.rst index dc21d8a..0fb97d8 100644 --- a/doc/getting_started.rst +++ b/doc/getting_started.rst @@ -9,6 +9,9 @@ Getting Started Installation ------------ +(For optimal compatibility on macOS, ensure that 'hdf5' and 'netcdf' are +pre-installed using Homebrew (``brew install hdf5 netcdf``).) + The `python-cmethods`_ module can be installed using the package manager pip: .. code-block:: bash