From 81cbdc61a9ddc67957a7949be49014bfb1a334cb Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Fri, 11 Apr 2025 18:08:06 +0300 Subject: [PATCH 1/3] Update dependencies, workflows, and documentation configurations Upgraded `ruff` pre-commit hook and adjusted Sphinx dependencies for Python versions. Modified GitHub workflows to improve build and documentation processes, introducing targeted `make` commands. Updated `.readthedocs.yaml` to refine package synchronization and system configurations. Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- .github/workflows/codecov.yml | 2 -- .pre-commit-config.yaml | 2 +- .readthedocs.yaml | 4 ++-- pyproject.toml | 4 +++- uv.lock | 4 ++++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 6361e81..8d58e80 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -25,8 +25,6 @@ jobs: fail_ci_if_error: true verbose: true token: ${{ secrets.CODECOV_TOKEN }} - - - uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7577f7d..7412f89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: trailing-whitespace - id: no-commit-to-branch - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.4 + rev: v0.11.5 hooks: - id: ruff-format args: [ --preview, --config=pyproject.toml ] diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 89b3503..d8d5e87 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -13,10 +13,10 @@ formats: all # Set the OS, Python version, and other tools you might need build: - os: ubuntu-24.04 + os: ubuntu-lts-latest tools: python: "3.12" jobs: post_install: - pip install uv - - UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --all-groups --link-mode=copy + - UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group docs --link-mode=copy --frozen --no-group dev diff --git a/pyproject.toml b/pyproject.toml index 7cb01ad..be143f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,12 +24,14 @@ dev = [ "mypy==1.13.0", "pytest-parametrization>=2022", "ruff>=0.8.2", + +] +docs = [ "sybil[pytest]", "sphinx>=8.2.0; python_version >= '3.11'", "sphinx>=7.0.0; python_version < '3.11'", "sphinx-rtd-theme>=3.0.2", ] - [tool.hatch.build.targets.sdist] only-include = ["my_pkg",] # todo: change to your package name source = "." diff --git a/uv.lock b/uv.lock index 0b15f7f..8bbafdb 100644 --- a/uv.lock +++ b/uv.lock @@ -418,6 +418,8 @@ dev = [ { name = "pytest-cov" }, { name = "pytest-parametrization" }, { name = "ruff" }, +] +docs = [ { name = "sphinx", version = "7.4.7", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.10.*'" }, { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, @@ -437,6 +439,8 @@ dev = [ { name = "pytest-cov", specifier = ">=4.0.0" }, { name = "pytest-parametrization", specifier = ">=2022" }, { name = "ruff", specifier = ">=0.8.2" }, +] +docs = [ { name = "sphinx", marker = "python_full_version < '3.11'", specifier = ">=7.0.0" }, { name = "sphinx", marker = "python_full_version >= '3.11'", specifier = ">=8.2.0" }, { name = "sphinx-rtd-theme", specifier = ">=3.0.2" }, From 3bebc3ff2d5e47d0d95335012caf857d01d2d871 Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Fri, 11 Apr 2025 18:09:50 +0300 Subject: [PATCH 2/3] Use `make` instead of `uv sync` in publish workflow. Updated the GitHub Actions `publish.yml` workflow to replace `uv sync --all-extras` with a `make` command. This ensures consistency with the project's build process and aligns with the existing `make test` step. Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7df4d5a..365efaa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v5 - run: uv python install 3.11 - - run: uv sync --all-extras + - run: make - run: make test - run: uv build - run: uv publish --token ${{ secrets.PYPI_API_TOKEN }} From 524722c7c96a3938cffdf08d7fe30806c5b9592a Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Fri, 11 Apr 2025 18:11:32 +0300 Subject: [PATCH 3/3] Add `install-docs` target and update workflow to use it Introduced a new `install-docs` Makefile target to streamline documentation-related dependencies by syncing only the `docs` group. Updated the GitHub Actions workflow to replace the generic `make` command with `make install-docs`, ensuring a focused and efficient build process for docs. Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- .github/workflows/docs.yml | 2 +- Makefile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bd12e5e..5bd916b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,7 @@ jobs: enable-cache: true - run: uv python install 3.11 - - run: make + - run: make install-docs - run: make doc - name: Deploy diff --git a/Makefile b/Makefile index 35e7b8f..f9c4912 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ install: uv sync --all-extras --all-groups --frozen uv tool install pre-commit --with pre-commit-uv --force-reinstall +install-docs: + uv sync --group docs --frozen --no-group dev + update: uv lock uvx pre-commit autoupdate