From c0dce7af2ee6de59e58aba71f0bb8e22cda0f354 Mon Sep 17 00:00:00 2001 From: jtschwar Date: Mon, 22 Jun 2026 15:39:10 -0700 Subject: [PATCH 1/3] start setting up release please --- .github/workflows/release-please.yaml | 79 +++++++++++++++++++++++++++ release-please-config.json | 28 ++++++++++ 2 files changed, 107 insertions(+) create mode 100644 .github/workflows/release-please.yaml create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..485567d --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,79 @@ +name: Release Please + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + +# cancel in-progress runs that use the same workflow and branch +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + release-please: + name: Create Release PRs + runs-on: ubuntu-latest + # Only run release-please on pushes to main, not on PRs + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + permissions: + contents: write + issues: write + pull-requests: write + steps: + # Generate token using your organization's GitHub App + - name: Generate token + id: generate_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.GH_ACTIONS_HELPER_APP_ID }} + private-key: ${{ secrets.GH_ACTIONS_HELPER_PK }} + + - name: Release Please + uses: googleapis/release-please-action@v4 + id: release + with: + manifest-file: ".release-please-manifest.json" + config-file: "release-please-config.json" + target-branch: "main" + token: ${{ steps.generate_token.outputs.token }} # โ† Changed from secrets.GITHUB_TOKEN + outputs: + paths_released: ${{ steps.release.outputs.paths_released }} + release_created: ${{ steps.release.outputs.release_created }} + + publish-pypi: + name: Build and publish to PyPI + runs-on: ubuntu-latest + needs: release-please + # Only publish when a release is actually created + if: needs.release-please.outputs.release_created == 'true' + environment: + name: pypi + url: https://pypi.org/p/slabpick # โ† Make sure this matches your PyPI package name + permissions: + id-token: write # Required for trusted publishing + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build dependen + run: | + python -m pip install -U pip + python -m pip install build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..e8fa0fe --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,28 @@ +{ + "release-type": "python", + "changelog-sections": [ + { "type": "feat", "section": "โœจ Features" }, + { "type": "fix", "section": "๐Ÿž Bug Fixes" }, + { "type": "perf", "section": "โšก๏ธ Performance Improvements" }, + { "type": "revert", "section": "โ†ฉ๏ธ Reverts" }, + { "type": "docs", "section": "๐Ÿ“ Documentation" }, + { "type": "style", "section": "๐Ÿ’… Styles" }, + { "type": "chore", "section": "๐Ÿงน Miscellaneous Chores" }, + { "type": "refactor", "section": "โ™ป๏ธ Code Refactoring" }, + { "type": "test", "section": "๐Ÿงช Tests" }, + { "type": "build", "section": "๐Ÿ› ๏ธ Build System" }, + { "type": "ci", "section": "โš™ Continuous Integration" } + ], + "packages": { + ".": { + "package-name": "octopi", + "version-file": "octopi/__init__.py", + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": false, + "bump-patch-for-minor-pre-major": false, + "draft": false, + "prerelease": false, + "pull-request-footer": "Merpi on PyPI." + } + } +} From 455375993e810260f378f5030ea0f2eebb9eec70 Mon Sep 17 00:00:00 2001 From: jtschwar Date: Mon, 22 Jun 2026 16:08:13 -0700 Subject: [PATCH 2/3] ci: set up release please for pypi --- .release-please-manifest.json | 4 ++++ pyproject.toml | 6 ++++-- release-please-config.json | 6 +++--- src/slabpick/__init__.py | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..362a783 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + ".": "1.0.0" +} + diff --git a/pyproject.toml b/pyproject.toml index 90055d9..8d9d082 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,7 @@ classifiers = [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", ] -#dynamic = ["version"] -version = "0.1.0" +dynamic = ["version"] dependencies = [ "copick", "pydantic", @@ -32,6 +31,9 @@ readme = "README.md" license = {file = "LICENSE"} keywords = ["cryoet", "cryo-et", "tomography"] +[tool.hatch.version] +path = "src/slabpick/__init__.py" + [project.urls] Repository = "https://github.com/slabpick/slabpick.git" Issues = "https://github.com/slabpick/slabpick/issues" diff --git a/release-please-config.json b/release-please-config.json index e8fa0fe..bf609f0 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -15,14 +15,14 @@ ], "packages": { ".": { - "package-name": "octopi", - "version-file": "octopi/__init__.py", + "package-name": "slabpick", + "version-file": "slabpick/__init__.py", "changelog-path": "CHANGELOG.md", "bump-minor-pre-major": false, "bump-patch-for-minor-pre-major": false, "draft": false, "prerelease": false, - "pull-request-footer": "Merpi on PyPI." + "pull-request-footer": "Slabpick on PyPI." } } } diff --git a/src/slabpick/__init__.py b/src/slabpick/__init__.py index e69de29..d538f87 100644 --- a/src/slabpick/__init__.py +++ b/src/slabpick/__init__.py @@ -0,0 +1 @@ +__version__ = "1.0.0" \ No newline at end of file From 2ba1f5d2068934b63776b99f0b4d33db812be914 Mon Sep 17 00:00:00 2001 From: jtschwar Date: Mon, 22 Jun 2026 16:11:16 -0700 Subject: [PATCH 3/3] add documentation link --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fc80fd..f940484 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ curated in CryoSPARC or by Relion's 2D class averaging routine are also included ## Instructions for use +### Slabpick with CryoSPARC + The `make_minislabs` command will generate either galleries (per-particle projections tiled into mock micrographs) for use in CryoSPARC or particle stacks for use in Relion. @@ -23,4 +25,6 @@ cs_center_picks โ€”cs_file /path/to/picked_particles.cs โ€”map_file path/to/gall 4. After 2D classification, particles can be mapped back to a copick project or a Relion-4 starfile using the `cs_map_particles` command. -Details for use in Relion to follow. \ No newline at end of file +### Slabpick with RELION + +Refer to the [Documentation](https://chanzuckerberg.github.io/py2rely/user-guide/2d-slab-classification/) for details \ No newline at end of file