Skip to content

Commit

Permalink
keep sparkling_sim data in wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknight committed Dec 13, 2024
1 parent ad4a678 commit a40745e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 46 deletions.
81 changes: 36 additions & 45 deletions .github/workflows/build-and-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,55 +239,46 @@ jobs:
name: wheels-windows-amd64
path: ./wheelhouse/*.whl

# publish-to-testpypi:
# name: Publish distributions to TestPyPI
# needs: [build-source-dist, build-wheels-manylinux-aarch64, build-wheels-manylinux-x86_64, build-wheels-macos-x86_64, build-wheels-macos-ARM64, build-wheel-windows-amd64]
# runs-on: ubuntu-latest
# strategy:
# matrix:
# distribution:
# - source-dist
# - wheels-manylinux2014-aarch64
# - wheels-manylinux2014-x86_64
# - wheels-macos-x86_64
# - wheels-macos-arm64
# - wheels-windows-amd64

# environment:
# name: testpypi
# url: https://test.pypi.org/p/glm-py
# permissions:
# id-token: write
publish-to-testpypi:
name: Publish distributions to TestPyPI
needs: [build-source-dist, build-wheels-manylinux-aarch64, build-wheels-manylinux-x86_64, build-wheels-macos-x86_64, build-wheels-macos-ARM64, build-wheel-windows-amd64]
runs-on: ubuntu-latest
strategy:
matrix:
distribution:
- source-dist
- wheels-manylinux2014-aarch64
- wheels-manylinux2014-x86_64
- wheels-macos-x86_64
- wheels-macos-arm64
- wheels-windows-amd64

environment:
name: testpypi
url: https://test.pypi.org/p/glm-py
permissions:
id-token: write

# steps:
# - name: Download distribution artifact
# uses: actions/download-artifact@v3
# with:
# name: ${{ matrix.distribution}}
# path: dist/

# - name: Random sleep to avoid PyPI 503
# run: |
# RANDOM_SLEEP=$(( RANDOM % 60 + 1 ))
# sleep $RANDOM_SLEEP

# - name: Publish distribution to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/

# wait-for-testpypi-to-update:
# name: Wait for TestPyPI to update
# needs: publish-to-testpypi
# runs-on: ubuntu-latest
# steps:
# - name: Sleep for 30 seconds
# run: sleep 30s
# shell: bash
steps:
- name: Download distribution artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.distribution}}
path: dist/

- name: Random sleep to avoid PyPI 503
run: |
RANDOM_SLEEP=$(( RANDOM % 60 + 1 ))
sleep $RANDOM_SLEEP
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

wait-for-testpypi-to-update:
name: Wait for TestPyPI to update
needs: [build-source-dist, build-wheels-manylinux-aarch64, build-wheels-manylinux-x86_64, build-wheels-macos-x86_64, build-wheels-macos-ARM64, build-wheel-windows-amd64]
needs: publish-to-testpypi
runs-on: ubuntu-latest
steps:
- name: Sleep for 30 seconds
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include glmpy/bin/*
include glmpy/glmpy.c
include glmpy/glmpy.c
include glmpy/data/sparkling_sim/glm3.json
include glmpy/data/sparkling_sim/nldas_driver.csv
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ toml = ["tomli; python_version < '3.11'"]
[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
"glmpy.data" = ["sparkling_sim/*.json", "sparkling_sim/*.csv"]

[project.urls]
Repository = "https://github.com/AquaticEcoDynamics/glm-py"

Expand Down

0 comments on commit a40745e

Please sign in to comment.