Skip to content

Commit

Permalink
Update project metadata, and test publishing from gha
Browse files Browse the repository at this point in the history
  • Loading branch information
scottwittenburg committed Dec 7, 2023
1 parent a0a2f35 commit f748acb
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
40 changes: 32 additions & 8 deletions .github/workflows/pypackaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Python Packaging
on:
workflow_dispatch:
pull_request:
# push:
# branches:
# - main
push:
branches:
- master
release:
types:
- published
Expand All @@ -19,6 +19,9 @@ jobs:

- name: Build SDist
run: pipx run build --sdist
env:
# TODO: debug only, prevents upload failure due to "local" version
SETUPTOOLS_SCM_PRETEND_VERSION: "2.9.2.post431"

- uses: actions/upload-artifact@v3
with:
Expand All @@ -35,20 +38,19 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- uses: pypa/[email protected]
env:
CIBW_BUILD: cp*-manylinux_x86_64
# TODO: debug only, prevents upload failure due to "local" version
SETUPTOOLS_SCM_PRETEND_VERSION: "2.9.2.post431"

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl

upload_all:
upload_pypi:
needs: [build_wheels, make_sdist]
environment: pypi
permissions:
Expand All @@ -61,5 +63,27 @@ jobs:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

upload_test_pypi:
needs: [build_wheels, make_sdist]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
# Upload to Test PyPI for every commit on main branch
# if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
# TODO: debug only, test publishing to testpypi on this PR
if: github.event_name == 'pull_request' && github.event.action == 'synchronize' && github.event.pull_request.head.ref == 'add-pip-packaging'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

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

11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["scikit-build-core", "numpy", "setuptools_scm>=8"]
build-backend = "scikit_build_core.build"

[project]
name = "adios2_scottwittenburg"
name = "adios2"
dynamic = ["version"]
authors = [
{ name="Chuck Atkins", email="[email protected]" },
Expand All @@ -27,14 +27,21 @@ dependencies = [

[project.urls]
Homepage = "https://github.com/ornladios/adios2"
Issues = "https://github.com/ornladios/adios2/issues"
Documentation = "https://adios2.readthedocs.io/"
"Bug Tracker" = "https://github.com/ornladios/adios2/issues"
Discussions = "https://github.com/ornladios/ADIOS2/discussions"
Changelog = "https://github.com/ornladios/ADIOS2/releases"

[tool.scikit-build]
wheel.packages = ["adios2"]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"

[tool.setuptools_scm] # Section required
write_to = "_version.py"
version_scheme = "post-release"

[tool.cibuildwheel.linux]
environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"]

[tool.scikit-build.cmake.define]
ADIOS2_USE_Python = "ON"
Expand Down

0 comments on commit f748acb

Please sign in to comment.