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
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

20 changes: 10 additions & 10 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ jobs:
build:
runs-on: ubuntu-latest
name: Build Docs
container: python:3.12
container: python:3.13
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
persist-credentials: false
- name: Git config
run: |
git config --system --add safe.directory /__w/certwrangler/certwrangler
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
prune-cache: false
- name: Install build deps
run: |
apt update
apt install -y graphviz graphviz-dev
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install .[docs,dev]
- name: Build
run: |
make -C docs html
uv run --locked --no-default-groups --group tox tox -e docs
- name: Setup Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/build/html/
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
28 changes: 28 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pre-commit

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
prune-cache: false
- name: Run tox
run: uv run --locked --no-default-groups --group tox tox -e style
47 changes: 25 additions & 22 deletions .github/workflows/tox.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
name: tox
name: tests

on:
push:
branches: [ "main" ]
branches: ["main"]
paths-ignore: ["docs/**", "README.md"]
pull_request:
branches: [ "main" ]
branches: ["main"]
paths-ignore: ["docs/**", "README.md"]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
name: "Python ${{ matrix.python }} ${{ matrix.tox }}"
container: python:${{ matrix.python }}
name: "Tox suite ${{ matrix.tox }}"
strategy:
fail-fast: false
matrix:
include:
- {python: '3.13', tox: test}
- {python: '3.12', tox: test}
- {python: '3.11', tox: test}
- {python: '3.10', tox: test}
- {python: '3.9', tox: test}
- {python: '3.9', tox: type}
- {python: '3.9', tox: style}
- { tox: "py3.13" }
- { tox: "py3.12" }
- { tox: "py3.11" }
- { tox: "py3.10" }
- { tox: "typing" }
steps:
- uses: actions/checkout@v4
- name: Git config
run: git config --system --add safe.directory /__w/certwrangler/certwrangler
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
python -m pip install tox
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
prune-cache: false
- name: Run tox
run: tox run -e ${{ matrix.tox }}
run: uv run --locked --no-default-groups --group tox tox -e ${{ matrix.tox }}
Comment thread
mdavidbennett marked this conversation as resolved.
# Taken from https://brunoscheufler.com/blog/2022-04-09-the-required-github-status-check-that-wasnt
test-success:
runs-on: ubuntu-latest
name: "Python Tests Successful"
name: "Tox Tests Successful"
needs: test
if: success() # only run when all tests have passed
outputs:
Expand All @@ -48,7 +51,7 @@ jobs:
run: echo "success=true" >> $GITHUB_OUTPUT
test-rollup-result:
runs-on: ubuntu-latest
name: "Roll-up Test Results"
name: "Roll-up Tox Test Results"
if: always() # always run, so we never skip the check
needs: [test, test-success]
steps:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ nosetests.xml
coverage.xml
*,cover
.hypothesis/
.pytest_cache/

# mypy
.mypy_cache/

# Translations
*.mo
Expand All @@ -89,3 +93,7 @@ target/

#pyenv
venv

# uv and ruff
.venv/
.ruff_cache/
22 changes: 9 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 25.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.15
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 6.0.1
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 7.2.0
hooks:
- id: flake8
# Run the linter.
- id: ruff-check
# Run the formatter.
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.1
rev: v2.8.0
hooks:
- id: pyproject-fmt
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true
},
"editor.formatOnSave": true,
Expand Down
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

5 changes: 1 addition & 4 deletions docs/source/_ext/linkcode_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ def linkcode_resolve(domain, info):

filename = os.path.relpath(fn, start=os.path.dirname(certwrangler.__file__))

if lineno:
linespec = f"#L{lineno}-L{lineno + len(source) - 1}"
else:
linespec = ""
linespec = f"#L{lineno}-L{lineno + len(source) - 1}" if lineno else ""

# This is what we'd want to do if we switch over to versioned docs:

Expand Down
19 changes: 19 additions & 0 deletions docs/source/development/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Documentation

Certwrangler uses the [Sphinx](https://www.sphinx-doc.org) documentation framework. The documentation source files are under the `docs` directory.

Documentation can be built through tox like so:

```shell
uv run tox -e docs
```

The docs will be rendered to `docs/build/html`.

A development HTTP server with the docs can be launched on localhost with the following:

```shell
uv run tox -e docs-auto
```

This uses `sphinx-autobuild`, which will automatically rebuild the docs any time one of the source files for the docs is updated. This is useful for generating a live preview of the docs while making edits.
Loading
Loading