Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds GitHub Action to automatically publish to TestPyPI #25

Merged
merged 37 commits into from
Aug 24, 2023

Conversation

tomaroberts
Copy link
Owner

WIP

  • GHA to push to TestPyPI on pull_request
  • Uses setuptools_scm to dynamically adjust version number with every commit
    • nb: PyPI/TestPyPI don't like default version numbering in setuptools_scm, hence use local_scheme = "no-local-version" option
    • setuptools_scm creates _version.py with each commit and this is propagated through rest of code (such as CLI -v option, etc.)

@tomaroberts tomaroberts temporarily deployed to testpypi August 22, 2023 16:40 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 22, 2023 16:58 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 22, 2023 17:10 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 22, 2023 17:12 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 22, 2023 17:17 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 23, 2023 07:44 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 12:03 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 12:07 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 12:11 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 12:25 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 13:17 — with GitHub Actions Inactive
pip install breaking otherwise - can't find matplotlib version
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 13:26 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 13:34 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:11 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:15 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:21 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:25 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:29 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:36 — with GitHub Actions Inactive
@tomaroberts
Copy link
Owner Author

tomaroberts commented Aug 24, 2023

Mild pain in the ass, but in the end...

  • Adds setuptools-scm to dynamically set version
    • important: fetch-depth 0 to enable GitHub Action environment to see enough of repo history. Without this, setuptools-scm is not able to calculate version number properly as it lacks enough information.
  • Adds GitHub Action to publish every committed version to TestPyPI with unique SemVer version number.
  • Verifies latest TestPyPI build by creating new venv and installing latest version.
    • nb: 2.5 minute wait in GHA to allow TestPyPI to update, which enables verification of latest package version. Might be better to do this with a try statement. But this will do for now.

@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:43 — with GitHub Actions Inactive
@tomaroberts tomaroberts temporarily deployed to testpypi August 24, 2023 15:51 — with GitHub Actions Inactive
@tomaroberts tomaroberts marked this pull request as ready for review August 24, 2023 15:57
@tomaroberts tomaroberts merged commit a24a553 into main Aug 24, 2023
@tomaroberts tomaroberts deleted the 23-gha-testpypi branch August 24, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant