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: 0 additions & 11 deletions .codecov.yml

This file was deleted.

24 changes: 15 additions & 9 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Download source
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Python dependencies
python-version: '3.13'
- name: Install Hatch
run: |
python -m pip install --upgrade hatch
pip install hatch
- name: Install dependencies
run: |
hatch run style:pip freeze
- name: Fix code style
run: hatch run style:fix --fix-only
run: |
hatch run style:fix --fix-only
- name: Check if any edits are necessary
run: git diff --color --exit-code
run: |
git diff --color --exit-code
- name: Apply automatic fixes using pre-commit-ci-lite
if: failure() && github.event_name == 'pull_request'
uses: pre-commit-ci/lite-action@v1.0.1
uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
106 changes: 63 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,92 @@ on:
pull_request:
schedule:
- cron: '0 6 * * 6'
defaults:
run:
shell: bash
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-v7.x']
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- python-version: pypy-3.9-v7.x
py: pypy3
# Just to slim down the test matrix:
exclude:
- python-version: '3.9'
- python: '3.14'
os: ubuntu-latest
- python: '3.14'
os: windows-latest
- python: '3.14'
os: macos-latest
- python: '3.13'
os: ubuntu-latest
- python: '3.13'
os: windows-latest
- python: '3.12'
os: macos-latest
- python-version: '3.9'
- python: '3.12'
os: ubuntu-latest
- python: '3.12'
os: windows-latest
- python-version: '3.10'
- python: '3.11'
os: ubuntu-latest
- python: '3.11'
os: macos-latest
- python: '3.10'
os: ubuntu-latest
- python-version: '3.11'
- python: '3.10'
os: macos-latest
- python-version: '3.11'
- python: '3.9'
os: windows-latest
runs-on: ${{ matrix.os }}
- python: '3.9'
os: ubuntu-latest
versions: minimal
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Download source
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
python-version: ${{matrix.python}}
- name: Pin to lowest versions
if: matrix.versions == 'minimal'
run: |
sed -i -E 's/#min //; s/\b >=([0-9])/ ==\1/' pyproject.toml
- name: Install Hatch
run: |
pip install hatch
- name: Install dependencies
run: |
python -m pip install --upgrade hatch
hatch run test:pip freeze
- name: Run tests
run: |
hatch run +py=${{ matrix.py || matrix.python-version }} test:with-coverage
hatch run +py=${{matrix.python}} test:test
- name: Run integration tests
if: matrix.versions != 'minimal'
run: |
hatch run +py=${{ matrix.py || matrix.python-version }} integration:test
shell: bash
- name: Upload Codecov Results
if: success()
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: ${{ matrix.os }}/${{ matrix.python-version }}
fail_ci_if_error: false

lint:
hatch run +py=${{matrix.python}} integration:test
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Download source
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Python dependencies
python-version: '3.13'
- name: Install Hatch
run: |
python -m pip install --upgrade hatch
- name: Setup Node
uses: actions/setup-node@v4
pip install hatch
- name: Install Node
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- name: Install dependencies
run: |
hatch run style:pip freeze
hatch run types:pip freeze
- name: Check with ruff
if: always()
run: hatch run style:lint
run: hatch run style:check
- name: Check with mypy
if: always()
run: hatch run types:check
Expand All @@ -86,11 +106,11 @@ jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'
- name: Install dependencies
run: pip install -U build
- name: Build package
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy docs
on:
push:
pull_request:
schedule:
- cron: '0 6 * * 6'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Download source
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install dependencies
run: pip install --no-deps -r requirements/requirements-docs.txt && pip install .
- name: Build site
run: properdocs build --strict
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v4
with:
path: site
deploy:
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
6 changes: 3 additions & 3 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'
- name: Install dependencies
run: pip install -U build
- name: Build package
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/docs.yml

This file was deleted.

3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

[![PyPI Version][pypi-v-image]][pypi-v-link]
[![Build Status][GHAction-image]][GHAction-link]
[![Coverage Status][codecov-image]][codecov-link]

ProperDocs is a **fast**, **simple** and **downright gorgeous** static site
generator that's geared towards building project documentation. Documentation
Expand Down Expand Up @@ -58,8 +57,6 @@ Everyone interacting in the ProperDocs project's codebases, issue trackers, and
discussion forums is expected to follow the [PyPA Code of Conduct].

<!-- Badges -->
[codecov-image]: https://codecov.io/github/properdocs/properdocs/coverage.svg?branch=master
[codecov-link]: https://codecov.io/github/properdocs/properdocs?branch=master
[pypi-v-image]: https://img.shields.io/pypi/v/properdocs.svg
[pypi-v-link]: https://pypi.org/project/properdocs/
[GHAction-image]: https://github.com/properdocs/properdocs/actions/workflows/ci.yml/badge.svg
Expand Down
17 changes: 9 additions & 8 deletions properdocs/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@

import click

from properdocs import replacement # noqa: F401
from properdocs import __version__, config, utils
from properdocs import (
__version__,
config,
replacement, # noqa: F401
utils,
)

if sys.platform.startswith("win"):
try:
Expand Down Expand Up @@ -122,16 +126,13 @@ def __del__(self):
reload_help = "Enable the live reloading in the development server (this is the default)"
no_reload_help = "Disable the live reloading in the development server."
serve_dirty_help = "Only re-build files that have changed."
serve_clean_help = (
"Build the site without any effects of `properdocs serve` - pure `properdocs build`, then serve."
)
serve_clean_help = "Build the site without any effects of `properdocs serve` - pure `properdocs build`, then serve."
commit_message_help = (
"A commit message to use when committing to the "
"GitHub Pages remote branch. Commit {sha} and ProperDocs {version} are available as expansions"
)
remote_branch_help = (
"The remote branch to commit to for GitHub Pages. This "
"overrides the value specified in config"
"The remote branch to commit to for GitHub Pages. This overrides the value specified in config"
)
remote_name_help = (
"The remote name to commit to for GitHub Pages. This overrides the value specified in config"
Expand Down Expand Up @@ -243,7 +244,7 @@ def callback(ctx, param, value):
__version__,
'-V',
'--version',
message=f'%(prog)s, version %(version)s from { PKG_DIR } (Python { PYTHON_VERSION })',
message=f'%(prog)s, version %(version)s from {PKG_DIR} (Python {PYTHON_VERSION})',
)
@common_options
@color_option
Expand Down
9 changes: 6 additions & 3 deletions properdocs/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import logging
import os
import time
from typing import TYPE_CHECKING, Sequence
from collections.abc import Sequence
from typing import TYPE_CHECKING
from urllib.parse import urljoin, urlsplit

import jinja2
Expand All @@ -16,8 +17,10 @@
from properdocs.structure.files import File, Files, InclusionLevel, get_files, set_exclusions
from properdocs.structure.nav import Navigation, get_navigation
from properdocs.structure.pages import Page
from properdocs.utils import DuplicateFilter # noqa: F401 - legacy re-export
from properdocs.utils import templates
from properdocs.utils import (
DuplicateFilter, # noqa: F401 - legacy re-export
templates,
)

if TYPE_CHECKING:
from properdocs.config.defaults import ProperDocsConfig
Expand Down
Loading
Loading