diff --git a/.github/workflows/pypackaging.yml b/.github/workflows/pypackaging.yml index 92d2f68d62..65498f61fa 100644 --- a/.github/workflows/pypackaging.yml +++ b/.github/workflows/pypackaging.yml @@ -3,9 +3,9 @@ name: Python Packaging on: workflow_dispatch: pull_request: - # push: - # branches: - # - main + push: + branches: + - master release: types: - published @@ -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: @@ -35,20 +38,19 @@ jobs: steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - uses: pypa/cibuildwheel@v2.16 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: @@ -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/ diff --git a/pyproject.toml b/pyproject.toml index ac9c2d2965..e77adaf33a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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="chuck.atkins@kitware.com" }, @@ -27,7 +27,10 @@ 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"] @@ -35,6 +38,10 @@ 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"