Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
".": "1.0.0"
}

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
### Slabpick with RELION

Refer to the [Documentation](https://chanzuckerberg.github.io/py2rely/user-guide/2d-slab-classification/) for details
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
28 changes: 28 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -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": "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": "Slabpick on PyPI."
}
}
}
1 change: 1 addition & 0 deletions src/slabpick/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0"