diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4dfa2c0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,86 @@ +# @Copyright: CEA-LIST/DIASI/SIALV/LVA (2023) +# @Author: CEA-LIST/DIASI/SIALV/LVA +# @License: CECILL-C +# +# This software is a collaborative computer program whose purpose is to +# generate and explore labeled data for computer vision applications. +# This software is governed by the CeCILL-C license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-C +# license as circulated by CEA, CNRS and INRIA at the following URL +# +# http://www.cecill.info + +# This workflow will publish the new version of Pixano Inference to PyPI when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Publish + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + deploy_pypi: + name: Build and publish to PyPI + runs-on: ubuntu-latest + permissions: + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install hatch + + - name: Build package + run: hatch build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + + deploy_docs: + name: Publish documentation website + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure git credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Create cache_id for key creation + run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + + - name: Create cache key with cache_id + uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + + - name: Install dependencies + run: pip install .[documentation] + + - name: Publish documentation website + run: mkdocs gh-deploy --force diff --git a/docs/code/index.md b/docs/api_reference/index.md similarity index 100% rename from docs/code/index.md rename to docs/api_reference/index.md diff --git a/docs/assets/extra.css b/docs/assets/extra.css index 9ef2222..460fcf4 100644 --- a/docs/assets/extra.css +++ b/docs/assets/extra.css @@ -1,3 +1,3 @@ :root { - --md-primary-fg-color: #1e7736; + --md-primary-fg-color: #771e5f; } diff --git a/docs/gen_ref_pages.py b/docs/gen_ref_pages.py index 346b492..a895a7c 100644 --- a/docs/gen_ref_pages.py +++ b/docs/gen_ref_pages.py @@ -8,7 +8,7 @@ import mkdocs_gen_files SRC_PATH = "pixano_inference" -REF_PATH = "code" +REF_PATH = "api_reference" IGNORED_FILES = ["__init__.py", "__version__.py"] nav = mkdocs_gen_files.Nav() diff --git a/docs/getting_started/index.md b/docs/getting_started/index.md new file mode 100644 index 0000000..2f1bc07 --- /dev/null +++ b/docs/getting_started/index.md @@ -0,0 +1,5 @@ +# Getting started with Pixano Inference + +- [Installing Pixano Inference](installing_pixano_inference.md) +- [Using pre-annotation models](pre_annotation.md) +- [Using interactive annotation models](interactive_annotation.md) diff --git a/docs/user/install.md b/docs/getting_started/installing_pixano_inference.md similarity index 100% rename from docs/user/install.md rename to docs/getting_started/installing_pixano_inference.md diff --git a/docs/user/interactive_annotation.md b/docs/getting_started/interactive_annotation.md similarity index 100% rename from docs/user/interactive_annotation.md rename to docs/getting_started/interactive_annotation.md diff --git a/docs/user/pre_annotation.md b/docs/getting_started/pre_annotation.md similarity index 100% rename from docs/user/pre_annotation.md rename to docs/getting_started/pre_annotation.md diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index de22e13..0000000 --- a/docs/index.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide: - - navigation ---- - -# Welcome to the Pixano Inference Documentation! - -Pixano Inference is a library of inference models for Pixano. - -**[Get started](user/)** - -**[Check out the API reference](code/)** - -**[Check out the documentation for Pixano](https://pixano.github.io/)** diff --git a/docs/user/index.md b/docs/user/index.md deleted file mode 100644 index 9be6f9b..0000000 --- a/docs/user/index.md +++ /dev/null @@ -1,7 +0,0 @@ -# Getting started with Pixano Inference - -- [Get started with Pixano](https://pixano.github.io/user/) -- [Install Pixano Inference](install.md) -- Use Pixano Inference - - Check out this Jupyter notebook for using the Pixano Inference models for pre-annotation - - Check out this Jupyter notebook for using the Pixano Inference models for interactive annotation diff --git a/mkdocs.yml b/mkdocs.yml index 9848fdc..21cca53 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Pixano Inference Documentation +site_name: Pixano Documentation theme: name: material logo: assets/pixano_white.png @@ -68,7 +68,7 @@ plugins: - https://arrow.apache.org/docs/objects.inv - https://docs.pydantic.dev/2.4/objects.inv - https://ipython.readthedocs.io/en/8.13.2/objects.inv - - https://pixano.github.io/objects.inv + - https://pixano.github.io/pixano/objects.inv - https://pytorch.org/docs/master/objects.inv - url: https://github.com/GPflow/tensorflow-intersphinx/raw/master/tf2_py_objects.inv base_url: https://www.tensorflow.org/api_docs/python @@ -87,14 +87,14 @@ plugins: heading_level: 1 nav: - - "Home": index.md + - "Home": https://pixano.github.io/ - - "Getting started": - - user/index.md - - "Installing Pixano Inference": user/install.md - - "Pre-annotation": user/pre_annotation.md - - "Interactive annotation": user/interactive_annotation.md + - "Pixano": https://pixano.github.io/pixano/ - - "API reference": code/ - - - "Pixano": https://pixano.github.io + - "Pixano Inference": + - "Getting started": + - getting_started/index.md + - "Installing Pixano Inference": getting_started/installing_pixano_inference.md + - "Pre-annotation": getting_started/pre_annotation.md + - "Interactive annotation": getting_started/interactive_annotation.md + - "API reference": api_reference/