Repository: BioimageAnalysisCoreWEHI/napari_lattice (language: python)

Issue:
Automatic doc building
Currently the docs deployment is a manual `mkdocs gh-deploy`. This could be set up in GitHub actions.
Fix release process
Will need to accomodate the new packages structure. Involves editing the .github workflow.


Discussion / hints:

Fix patch:
diff --git a/core/pyproject.toml b/core/pyproject.toml
index eb1f9c31..41b6b53f 100644
--- a/core/pyproject.toml
+++ b/core/pyproject.toml
@@ -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",
@@ -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",
@@ -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"
@@ -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"  
diff --git a/docs/workflow.md b/docs/workflow.md
index 058a5ee4..610daec2 100644
--- a/docs/workflow.md
+++ b/docs/workflow.md
@@ -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
 
diff --git a/plugin/pyproject.toml b/plugin/pyproject.toml
index 9b92123b..a69aa6a8 100644
--- a/plugin/pyproject.toml
+++ b/plugin/pyproject.toml
@@ -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."


Test patch:
diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml
index 71ae1b9e..1d1c9575 100644
--- a/.github/workflows/test_and_deploy.yml
+++ b/.github/workflows/test_and_deploy.yml
@@ -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
 
@@ -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/release-action@v1.14.0
+        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/*