Skip to content
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
11 changes: 8 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
version: 2
updates:
- package-ecosystem: pip
- package-ecosystem: uv
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: monthly
groups:
all-dependencies:
patterns: ["*"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
all-actions:
patterns: ["*"]
25 changes: 10 additions & 15 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,22 @@ jobs:
- { name: "3.14-madev", python: "3.14", tox: py314-marshmallowdev }
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python }}
- run: pip install tox
- run: tox -e${{ matrix.tox }}
enable-cache: true
- run: uv run tox -e${{ matrix.tox }}
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
- name: Install pypa/build
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Install twine
run: python -m pip install twine
- name: Check build
run: python -m twine check --strict dist/*
enable-cache: true
- run: uv build
- run: uvx twine check --strict dist/*
- name: Store the distribution packages
uses: actions/upload-artifact@v7
with:
Expand All @@ -56,11 +51,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
- run: python -m pip install tox
- run: python -m tox -e lint
enable-cache: true
- run: uv run tox -e lint
publish-to-pypi:
name: PyPI release
if: startsWith(github.ref, 'refs/tags/')
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ repos:
hooks:
- id: mypy
additional_dependencies: ["marshmallow>=3.24.1,<5", "types-PyYAML"]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.10.9
hooks:
- id: uv-lock
19 changes: 19 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://docs.readthedocs.com/platform/stable/build-customization.html#install-dependencies-with-uv
version: 2
sphinx:
configuration: docs/conf.py
formats:
- pdf
build:
os: ubuntu-24.04
tools:
python: "3.13"
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs --extra marshmallow
22 changes: 10 additions & 12 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,19 @@ Setting Up for Local Development
$ git clone https://github.com/marshmallow-code/apispec.git
$ cd apispec

2. Install development requirements. **It is highly recommended that you use a virtualenv.**
Use the following command to install an editable version of
apispec along with its development requirements.
2. Install `uv <https://docs.astral.sh/uv/getting-started/installation/>`_.

3. Install development requirements.

::

# After activating your virtualenv
$ pip install -e '.[dev]'
$ uv sync

3. Install the pre-commit hooks, which will format and lint your git staged files.
4. (Optional but recommended) Install the pre-commit hooks, which will format and lint your git staged files.

::

# The pre-commit CLI was installed above
$ pre-commit install
$ uv run pre-commit install --allow-missing-config


Git Branch Structure
Expand Down Expand Up @@ -93,15 +91,15 @@ Running Tests

To run all tests: ::

$ pytest
$ uv run pytest

To run syntax checks: ::

$ tox -e lint
$ uv run tox -e lint

(Optional) To run tests in all supported Python versions in their own virtual environments (must have each interpreter installed): ::

$ tox
$ uv run tox

Documentation
+++++++++++++
Expand All @@ -110,7 +108,7 @@ Contributions to the documentation are welcome. Documentation is written in `reS

To build the docs in "watch" mode: ::

$ tox -e docs-serve
$ uv run tox -e docs-serve

Changes in the `docs/` directory will automatically trigger a rebuild.

Expand Down
19 changes: 12 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,20 @@ Tidelift = "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-a
[project.optional-dependencies]
yaml = ["PyYAML>=3.10"]
marshmallow = ["marshmallow>=3.18.0"]

[dependency-groups]
docs = [
"apispec[marshmallow]",
"pyyaml==6.0.3",
"sphinx==9.1.0",
"sphinx-issues==6.0.0",
"sphinx-rtd-theme==3.1.0",
"marshmallow>=3.18.0",
"pyyaml",
"sphinx-issues",
"sphinx-rtd-theme",
"sphinx>=8.1",
]
tests = ["apispec[yaml,marshmallow]", "openapi-spec-validator==0.8.4", "pytest"]
dev = ["apispec[tests]", "tox", "pre-commit>=3.5,<5.0"]
tests = ["openapi-spec-validator", "pytest"]
dev = [{ include-group = "tests" }, "tox", "tox-uv", "pre-commit>=3.5,<5.0"]

[tool.uv]
default-groups = ["dev"]

[build-system]
requires = ["flit_core<4"]
Expand Down
15 changes: 0 additions & 15 deletions readthedocs.yml

This file was deleted.

9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ envlist=
docs

[testenv]
extras = tests
extras = yaml,marshmallow
dependency_groups = tests
deps =
marshmallow3: marshmallow>=3.18.0,<4.0.0
marshmallowdev: https://github.com/marshmallow-code/marshmallow/archive/dev.tar.gz
Expand All @@ -20,14 +21,16 @@ skip_install = true
commands = pre-commit run --all-files

[testenv:docs]
extras = docs
extras = marshmallow
dependency_groups = docs
commands = sphinx-build docs/ docs/_build {posargs}

; Below tasks are for development only (not run in CI)

[testenv:docs-serve]
deps = sphinx-autobuild
extras = docs
extras = marshmallow
dependency_groups = docs
commands = sphinx-autobuild --port=0 --open-browser --delay=2 docs/ docs/_build {posargs} --watch src --watch CONTRIBUTING.rst --watch README.rst

[testenv:readme-serve]
Expand Down
Loading
Loading