Skip to content

Commit

Permalink
Fix PyPI publish, add tests and update action names (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Dec 22, 2023
1 parent 3b318ac commit c1bdb49
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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

name: Publish to PyPI
name: Upload package to PyPI

on:
release:
Expand All @@ -21,18 +21,22 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install setuptools setuptools_scm wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# Build package, test pip install works, then upload to PyPI with twine
run: |
python setup.py sdist bdist_wheel
pip install dist/*.tar.gz
twine upload dist/*
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: build
name: Tests

on:
push:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
mamba install pyyaml python=${{ matrix.python-version }}
python .github/scripts/generate_yml_env_fixed_py.py --pyv ${{ matrix.python-version }} --add "graphviz,opencv" "environment.yml"
python .github/scripts/generate_yml_env_fixed_py.py --pyv ${{ matrix.python-version }} --add "graphviz,opencv,pytransform3d" "environment.yml"
mamba env update -n xdem-dev -f environment-ci-py${{ matrix.python-version }}.yml
- name: Install project
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = [
"setuptools>=42",
"setuptools_scm[toml]>=6.2",
"setuptools>=64",
"setuptools_scm[toml]>=8",
"wheel",
]
build-backend = "setuptools.build_meta"

# To write version to file
[tool.setuptools_scm]
write_to = "xdem/_version.py"
version_file = "xdem/_version.py"
fallback_version = "0.0.1"

[tool.black]
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ scikit-image
scikit-gstat>=1.0
geoutils==0.0.15
pip
setuptools>=42
setuptools_scm[toml]>=6.2
setuptools>=64
setuptools_scm[toml]>=8

0 comments on commit c1bdb49

Please sign in to comment.