From 925465f0fe36e53c2457ca1e8dd648cbd359665c Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Tue, 16 Apr 2024 09:10:13 -0700 Subject: [PATCH 1/2] remove build_external from project --- .github/workflows/python-publish.yml | 5 +-- conda-recipe/build.sh | 1 - external/bld.bat | 2 + external/build.sh | 3 ++ external/python-publish.yml | 43 +++++++++++++++++++ .../setup_with_hexwatershed.py | 0 6 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 external/bld.bat create mode 100644 external/build.sh create mode 100644 external/python-publish.yml rename setup_with_hexwatershed.py => external/setup_with_hexwatershed.py (100%) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 967f181..1162c91 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -27,10 +27,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install setuptools wheel - - - name: Build external package - run: python setup.py build_external + python -m pip install setuptools wheel - name: Build source distribution run: | diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index 6e89ee8..cace456 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -1,3 +1,2 @@ #!/bin/bash -$PYTHON setup.py build_external -vv $PYTHON setup.py install --single-version-externally-managed --record=record.txt \ No newline at end of file diff --git a/external/bld.bat b/external/bld.bat new file mode 100644 index 0000000..4ea6d08 --- /dev/null +++ b/external/bld.bat @@ -0,0 +1,2 @@ +"%PYTHON%" setup.py sdist install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/external/build.sh b/external/build.sh new file mode 100644 index 0000000..6e89ee8 --- /dev/null +++ b/external/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +$PYTHON setup.py build_external -vv +$PYTHON setup.py install --single-version-externally-managed --record=record.txt \ No newline at end of file diff --git a/external/python-publish.yml b/external/python-publish.yml new file mode 100644 index 0000000..967f181 --- /dev/null +++ b/external/python-publish.yml @@ -0,0 +1,43 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install setuptools wheel + + - name: Build external package + run: python setup.py build_external + + - name: Build source distribution + run: | + python setup.py bdist_wheel + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.HEXWATERSHED_TOKEN }} diff --git a/setup_with_hexwatershed.py b/external/setup_with_hexwatershed.py similarity index 100% rename from setup_with_hexwatershed.py rename to external/setup_with_hexwatershed.py From d830e6dff258080ccca56bc4fee3bd80c9bbf50f Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Tue, 16 Apr 2024 09:10:58 -0700 Subject: [PATCH 2/2] up version --- CITATION.cff | 2 +- conda-recipe/conda_build_config.yaml | 2 +- conda-recipe/meta.yaml | 2 +- external/setup_with_hexwatershed.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index b3a2945..9a8128e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -5,6 +5,6 @@ authors: given-names: Chang orcid: https://orcid.org/0000-0002-7348-8858 title: "HexWatershed: a mesh-independent flow direction model for hydrologic models" -version: 0.2.26 +version: 0.2.27 doi: 10.5281/zenodo.6425881 date-released: 2022-03-31 \ No newline at end of file diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml index b250c6c..948ddd9 100644 --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -23,7 +23,7 @@ metadata: # Package name name: hexwatershed # Package version - version: "0.2.26" + version: "0.2.27" # Package summary summary: A mesh-independent flow direction model for hydrologic models # Package homepage diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 1827d27..51db091 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,6 +1,6 @@ {% set name = "hexwatershed" %} {% set git_rev = "main" %} -{% set version = "0.2.26" %} +{% set version = "0.2.27" %} package: name: {{ name|lower }} diff --git a/external/setup_with_hexwatershed.py b/external/setup_with_hexwatershed.py index 82c9434..0f4b324 100644 --- a/external/setup_with_hexwatershed.py +++ b/external/setup_with_hexwatershed.py @@ -11,7 +11,7 @@ AUTHOR = "Chang Liao" AUTHOR_EMAIL = "chang.liao@pnnl.gov" URL = "https://github.com/changliao1025/pyhexwatershed" -VERSION = "0.2.26" +VERSION = "0.2.27" REQUIRES_PYTHON = ">=3.8.0" KEYWORDS = ["hexwatershed", "hydrology", diff --git a/setup.cfg b/setup.cfg index a004a6d..6d62d33 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.26 +current_version = 0.2.27 commit = True tag = True diff --git a/setup.py b/setup.py index 24c6219..6ae2c61 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ AUTHOR = "Chang Liao" AUTHOR_EMAIL = "chang.liao@pnnl.gov" URL = "https://github.com/changliao1025/pyhexwatershed" -VERSION = "0.2.26" +VERSION = "0.2.27" REQUIRES_PYTHON = ">=3.8.0" KEYWORDS = ["hexwatershed", "hydrology",