Skip to content

Commit

Permalink
Merge pull request #83 from multimeric/auto-docs
Browse files Browse the repository at this point in the history
Auto publish to PyPI, Github release and docs on tag
  • Loading branch information
multimeric authored Nov 19, 2024
2 parents 5c6d189 + 26c162f commit 3b51137
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 21 deletions.
49 changes: 39 additions & 10 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
python: ${{ env.python }}

- name: Test core
run: pytest -v --cov=core --cov-report=xml core/
run: pytest --verbose --verbose core/

- uses: tlambert03/setup-qt-libs@v1

Expand Down Expand Up @@ -84,22 +84,51 @@ jobs:
# github secrets (see readme for details)
needs: [test]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
permissions:
id-token: write
pages: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel twine
- name: Build and publish
python -m pip install --upgrade pip setuptools wheel
python -m pip install ./core[docs,deploy]
python -m pip install ./plugin
- name: Build distributions
run: |
python -m build core
python -m build plugin
- name: Build docs
run: mkdocs build

- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

- name: Deploy to GitHub Pages
# Only a non-pr push has permissions to deploy pages
if: github.event_name == 'push'
uses: actions/deploy-pages@v4

- uses: ncipollo/[email protected]
name: Create GitHub release
if: contains(github.ref, 'tags')
with:
artifacts: "core/dist/*,plugin/dist/*"

- name: Release on PyPI
if: contains(github.ref, 'tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
run: |
git tag
python setup.py sdist bdist_wheel
twine upload dist/*
run:
twine upload --skip-existing --non-interactive core/dist/*
twine upload --skip-existing --non-interactive plugin/dist/*
22 changes: 14 additions & 8 deletions core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ line_length = 79

[project]
name = "lls_core"
version = "0.2.7"
version = "1.0.0"
authors = [
{name = "Pradeep Rajasekhar"},
{name = "Lachlan Whitehead"},
{name = "Robert Haase"}
{name = "Robert Haase"},
{name = "Michael Milton"}
]
license = {text = "GPL-3.0-only"}
description = "Core functionality for analysing and visualizing lattice lightsheet and Oblique Plane Microscopy data."
# readme = { file = "README.md", content-type = "text/markdown" }
readme = { file = "README.md", content-type = "text/markdown" }
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -75,9 +76,6 @@ Documentation = "https://github.com/BioimageAnalysisCoreWEHI/napari_lattice/wiki
SourceCode = "https://github.com/BioimageAnalysisCoreWEHI/napari_lattice"
UserSupport = "https://github.com/BioimageAnalysisCoreWEHI/napari_lattice/issues"

[tool.setuptools.package-data]
mypkg = ["*.yaml"]

[project.optional-dependencies]
testing = [
"tox",
Expand All @@ -94,9 +92,13 @@ docs = [
"mkdocs-click",
"mkdocs-material",
# Includes fixes for Pydantic 1.X
"fieldz>0.1.0",
"fieldz>=0.1.0",
"griffe-fieldz"
]
deploy = [
"build",
"twine"
]

[project.scripts]
lls-pipeline = "lls_core.cmds.__main__:main"
Expand Down Expand Up @@ -145,6 +147,10 @@ ignore_unused = [
"griffe-fieldz",

# This is pinned but unused
"fsspec"
"fsspec",

# Used for the deployment, but never imported
"build",
"twine"
]
output_format = "human_detailed"
2 changes: 1 addition & 1 deletion docs/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ These will be imported before the workflow is executed.

The `--workflow` command-line flag, the `LatticeData(workflow=)` Python parameter, and the Workflow tab of the plugin can be used to specify the path to a workflow `.yml` file .

If you're using the Python interface, you need to use [`LatticeData.process_workflow()`](api/#lls_core.LatticeData.process_workflow) rather than `.process()`.
If you're using the Python interface, you need to use [`LatticeData.process_workflow()`](api.md#lls_core.LatticeData.process_workflow) rather than `.process()`.

## Outputs

Expand Down
5 changes: 3 additions & 2 deletions plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ line_length = 79

[project]
name = "napari-lattice"
version = "0.2.7"
version = "1.0.0"
authors = [
{name = "Pradeep Rajasekhar"},
{name = "Lachlan Whitehead"},
{name = "Robert Haase"}
{name = "Robert Haase"},
{name = "Michael Milton"},
]
license = {text = "GPL-3.0-only"}
description = "Napari plugin for analysing and visualizing lattice lightsheet and Oblique Plane Microscopy data."
Expand Down

0 comments on commit 3b51137

Please sign in to comment.