Skip to content

Commit

Permalink
[ci/python] Dedupe PyPI stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Jan 12, 2023
1 parent 9acb52c commit 805a1af
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 49 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,50 +84,3 @@ jobs:
# Codecov settings page for this repo, then filled into the GitHub Actions secrets.
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

# TODO: merge with python-packaging.yml -- https://github.com/single-cell-data/TileDB-SOMA/issues/700
- name: Build wheel distribution
run: python -m pip -v wheel --no-deps --wheel-dir=dist-wheel apis/python
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}

- name: Publish package to TestPyPI
if: matrix.os == 'ubuntu-22.04' && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
continue-on-error: true
with:
repository_url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
packages_dir: dist-wheel
verbose: true

# Until general release of the main branch of tiledbsoma we'll follow the convention of tagging releases
# 0.5.0a1, 0.5.1a1, etc -- always with the "a1" suffix -- that way PyPI will automagically make these
# "prereleases". Then:
# pip install tiledbsoma -> 0.1.12 (or whatever the main-old branch is at)
# pip install --pre tiledbsoma -> 0.5.0a1 (or whatever the main branch is at)

# When we're ready for prime time:
# if: matrix.os == 'ubuntu-22.04' && github.event_name == 'release' && !github.event.release.prerelease

# # For now:
# - name: Publish package to PyPI
# if: matrix.os == 'ubuntu-22.04' && github.event_name == 'release' && (contains(${{github.event.release.tag_name}}, "a") || contains(${github.event.release.tag_name}}, "b"))
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
# packages_dir: dist-wheel
# verbose: true

# Notes:
# The above is fine for releases; notes here are for manual ops.
# https://towardsdatascience.com/create-your-own-python-package-and-publish-it-into-pypi-9306a29bc116
# TL;DR:
# o cd apis/python
# o python setup.py sdist
# o python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# - Be sure to use username __token__ and password being the token you set up at test.pypi.org
# o pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple tiledbsoma
48 changes: 46 additions & 2 deletions .github/workflows/python-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
name: sdist
path: apis/python/dist/

# TODO: merge with python-packaging.yml -- https://github.com/single-cell-data/TileDB-SOMA/issues/700
# This step builds wheels and uplods them to GitHub action storage.
# See also https://github.com/single-cell-data/TileDB-SOMA/issues/700.
# See also https://github.com/single-cell-data/TileDB-SOMA/wiki/PyPI-packaging-WIP
# for important transitional context.
wheels:
# Note: tries all supported Python versions as specified in apis/python/setup.py
name: Build wheels on ${{ matrix.os }}
Expand Down Expand Up @@ -69,6 +72,7 @@ jobs:
name: wheels-${{ matrix.platform }}
path: ./wheelhouse/*.whl

# This step locally tries out the built wheels, without publishing to PyPI
smoke-test:
name: Smoke test wheels
needs: wheels
Expand Down Expand Up @@ -99,4 +103,44 @@ jobs:
pip install $whl
- name: Smoke test ${{ matrix.os }}
run: python -c 'import tiledbsoma; print(tiledbsoma.libtiledbsoma.__file__)'
# TODO: more-thorough test
# TODO: more thorough local smoke test

# TODO: publlish to TestPyPI
#- name: Publish package to TestPyPI
# if: matrix.os == 'ubuntu-22.04' && github.event_name == 'release'
# uses: pypa/gh-action-pypi-publish@master
# continue-on-error: true
# with:
# repository_url: https://test.pypi.org/legacy/
# user: __token__
# password: ${{ secrets.TEST_PYPI_TOKEN }}
# packages_dir: dist-wheel
# verbose: true

# TODO: publlish to PyPI
# Until general release of the main branch of tiledbsoma we'll follow the convention of tagging releases
# 0.5.0a1, 0.5.0a2, etc -- always with the "a" in it -- that way PyPI will automagically make these
# "prereleases". Then:
# pip install tiledbsoma -> 0.1.12 (or whatever the main-old branch is at)
# pip install --pre tiledbsoma -> 0.5.0a1 (or whatever the main branch is at)

# For prime time, once we're in 1.x release:
# Not this:
# if: github.event_name == 'release' && !github.event.release.prerelease
# but this:
# if: github.event_name == 'release'
# Reasoning: once we're at 1.x, say we have a 1.3 which is released and a 1.4 which is
# pre-release (at the GitHub tag level) then we do still want to upload that package to PyPI and
# let people install it using `pip install --pre tiledbsoma`.

# For now:
#if: github.event_name == 'release' && (contains(${{github.event.release.tag_name}}, "a") || contains(${github.event.release.tag_name}}, "b"))
#
#steps:
#- name: Publish packages to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
# packages_dir: sdist, dist-wheel
# verbose: true

0 comments on commit 805a1af

Please sign in to comment.