diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de3660c..32eaf26 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,7 +121,7 @@ jobs: run: pdm run mike deploy --push -b docs-site develop - name: (version HAS changed) Deploy doc version and set to latest - if: steps.check-version.outputs.current-version + if: steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version run: | # Only pushing on the second command to avoid pushing twice pdm run mike deploy -b docs-site --update-aliases ${{ steps.check-version.outputs.current-version }} latest && pdm run mike set-default ${{ steps.check-version.outputs.current-version }} --push -b docs-site diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 47dba96..1226ac1 100755 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,6 +26,31 @@ jobs: run: | pdm run -v nox --session=qa + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up PDM + uses: pdm-project/setup-pdm@v3 + with: + python-version: "3.12" + cache: true + + # Docs needs credentials to check contributors + - name: Set git credentials + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Install Nox + run: | + pdm sync -d -G nox + + - name: Build docs + run: | + pdm run -v nox --session=docs + tests: runs-on: ${{ matrix.os }} strategy: diff --git a/.gitignore b/.gitignore index c21cce5..14e1649 100755 --- a/.gitignore +++ b/.gitignore @@ -113,6 +113,9 @@ ENV/ env.bak/ venv.bak/ +# mkdocs/mike local build directory: +site/ + # Vscode internals .vscode/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bdc6d44..9323fd1 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,13 @@ exclude: (^notebooks/) repos: + # export python requirements https://pdm.fming.dev/latest/usage/advanced/ + - repo: https://github.com/pdm-project/pdm + rev: 2.9.3 # a PDM release exposing the hook + hooks: + - id: pdm-export + # command arguments, e.g.: + args: ["-o", "requirements.txt", "--without-hashes"] + files: ^pdm.lock$ - repo: local hooks: - id: codespell diff --git a/README.md b/README.md index 13cf2b5..cfb61b1 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Watz Python +# Watz Python SDK [![PyPI](https://img.shields.io/pypi/v/watz.svg)][pypi status] [![Status](https://img.shields.io/pypi/status/watz.svg)][pypi status] @@ -22,7 +22,7 @@ Python SDK for Watz APIs ## Installation -You can install _Watz Python_ via [pip](https://pip.pypa.io/) from [PyPI](https://pypi.org/): +You can install `watz` via [pip](https://pip.pypa.io/) from [PyPI](https://pypi.org/): ```console $ pip install watz @@ -39,8 +39,8 @@ To learn more, see the [Contributor Guide](CONTRIBUTING.md). ## License -Distributed under the terms of the [Apache 2.0 license](LICENSE.md), -_Watz Python_ is free and open source software. +Distributed under the terms of the [Apache 2.0 license](LICENSE.md), the +_Watz Python SDK_ is free and open source software. ## Issues diff --git a/docs/assets/images/logo.svg b/docs/assets/images/logo.svg index 9e6371d..96271cb 100755 --- a/docs/assets/images/logo.svg +++ b/docs/assets/images/logo.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/assets/images/watz-py-0.0.1.zip b/docs/assets/images/watz-py-0.0.1.zip new file mode 100644 index 0000000..e1397a1 Binary files /dev/null and b/docs/assets/images/watz-py-0.0.1.zip differ diff --git a/mkdocs.yml b/mkdocs.yml index 1f236b7..ec37edb 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: "Watz Python" +site_name: "Watz Python SDK" site_url: "https://watz-inc.github.io/watz-py/" # Trailing slash is recommended repo_url: "https://github.com/watz-inc/watz-py" @@ -43,10 +43,10 @@ extra: nav: - Home: - - index.md + - index.md - API: - - reference.md + - reference.md - Contributing: - - CONTRIBUTING.md - - CODE_OF_CONDUCT.md - - LICENSE.md \ No newline at end of file + - CONTRIBUTING.md + - CODE_OF_CONDUCT.md + - LICENSE.md diff --git a/pyproject.toml b/pyproject.toml index a31bd05..4f6cbd3 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,11 @@ [build-system] -requires = ["pdm-backend"] -build-backend = "pdm.backend" +requires = ['hatchling'] +build-backend = 'hatchling.build' +[tool.hatch.build.targets.sdist] +# limit which files are included in the sdist (.tar.gz) asset, +# see https://github.com/pydantic/pydantic/pull/4542 +include = ['/README.md', '/watz', '/tests', '/requirements.txt'] [tool.pdm] [tool.pdm.dev-dependencies] @@ -27,9 +31,6 @@ docs = [ # Weirdly Mike fails without this being explicitly available (don't think nox is installing it) "setuptools>=61.0", ] -[tool.pdm.build] -package-dir = "watz" - [project] name = "watz" diff --git a/watz/__init__.py b/watz/__init__.py index 14bc811..35e2426 100755 --- a/watz/__init__.py +++ b/watz/__init__.py @@ -1,4 +1,4 @@ -"""Watz Python.""" +"""The Watz Python SDK.""" from importlib.metadata import version