Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed package, migged to hatch build system, added docs build test to… #3

Merged
merged 3 commits into from
Oct 6, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ ENV/
env.bak/
venv.bak/

# mkdocs/mike local build directory:
site/

# Vscode internals
.vscode/

Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/watz-py-0.0.1.zip
Binary file not shown.
12 changes: 6 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- LICENSE.md
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion watz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Watz Python."""
"""The Watz Python SDK."""

from importlib.metadata import version

Expand Down