Skip to content

Commit

Permalink
feat: stage release 6.0 (#2073)
Browse files Browse the repository at this point in the history
- [x] Drop support for 3.8.
- [x] Drop deprecated code.
- [x] Migrate to uv as package manager.
- [x] Migrate to pyright as type checker.
- [x] Remove theme switcher button.
  • Loading branch information
kai687 authored Nov 23, 2024
1 parent fa56de1 commit ba7198f
Show file tree
Hide file tree
Showing 52 changed files with 2,287 additions and 5,200 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI
on: push
jobs:
test:
name: Run CI workflows
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.9
- 3.13
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up nox
run: |
uv tool install nox
- name: Run workflow
run: |
nox -p ${{ matrix.python-version }}
env:
DOCSEARCH_APP_ID: ${{ vars.DOCSEARCH_APP_ID }}
DOCSEARCH_API_KEY: ${{ vars.DOCSEARCH_API_KEY }}
DOCSEARCH_INDEX_NAME: ${{ vars.DOCSEARCH_INDEX_NAME }}
links:
name: Check for broken links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Set up nox
run: |
uv tool install nox
- name: Check links
run: |
nox -s links
env:
DOCSEARCH_APP_ID: ${{ vars.DOCSEARCH_APP_ID }}
DOCSEARCH_API_KEY: ${{ vars.DOCSEARCH_API_KEY }}
DOCSEARCH_INDEX_NAME: ${{ vars.DOCSEARCH_INDEX_NAME }}
build:
name: Build the package
runs-on: ubuntu-latest
needs:
- test
- links
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Build packages
run: |
uv build
- uses: actions/upload-artifact@v4
with:
name: python-packages
path: dist/
publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs:
- build
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- uses: actions/download-artifact@v4
with:
name: python-packages
path: dist/
- name: Upload to PyPI
run: |
uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
release:
name: Create new GitHub release
runs-on: ubuntu-latest
needs:
- publish
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
name: python-packages
path: dist/
- name: Create GitHub release
run: |
gh release create ${{ github.ref_name }} ./dist/**
env:
GITHUB_TOKEN: ${{ github.token }}
5 changes: 0 additions & 5 deletions .github/workflows/index.yml → .github/workflows/crawler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
name: Algolia indexing

on:
push:
branches:
- main
paths:
- "docs/**"

jobs:
index:
runs-on: ubuntu-latest

name: Index docs with Algolia

steps:
- name: Check out repo
uses: actions/checkout@v4

- name: Algolia Crawler
uses: algolia/[email protected]
id: index_after_push
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/lint-docs.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/lint.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__
dist
pip-wheel-metadata/
sphinxawesome_theme.egg-info
docs/autoapi
docs/public
docs/public/xml
.nox
Expand Down
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
default_stages:
- pre-push
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: trailing-whitespace
- id: no-commit-to-branch
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: ruff-format
- repo: local
hooks:
- id: formatting
name: format code
entry: nox -s fmt
pass_filenames: false
language: system
types: [python]
- id: sync
name: sync requirements.txt
- id: requirements
name: Sync requirements.txt
entry: nox -s export
pass_filenames: false
language: system
files: 'pyproject\.toml|poetry\.lock'
files: 'pyproject\.toml|uv\.lock'
8 changes: 3 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py
builder: dirhtml
fail_on_warning: true

python:
install:
- requirements: docs/readthedocs.txt
- requirements: requirements.txt
- method: pip
path: .
path: .

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

1. Install the theme as a Python package:

```console
```sh
pip install sphinxawesome-theme
```

Expand Down
14 changes: 0 additions & 14 deletions docs/_static/feedback.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
flex-direction: column;
padding-top: 1.5rem;
align-items: center;
justify-content: center;
font-size: 0.875rem;
color: hsl(var(--muted-foreground));
}
Expand Down Expand Up @@ -35,16 +34,3 @@
#downvote:hover {
background-color: #fef2f2;
}

.feedback-send {
display: block;
padding: 0.25rem 0.5rem;
border-radius: var(--radius);
border: 1px solid hsl(var(--border));
}

.feedback-send:hover,
.feedback-send:focus {
background-color: hsl(var(--accent));
color: hsl(var(--accent-foreground));
}
14 changes: 10 additions & 4 deletions docs/_templates/feedback.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<div class="feedback">
<div style="font-weight:500">Was this helpful?</div>
<div style="font-weight:bolder">Was this page helpful?</div>
<div class="flex">
<button id="upvote"
class="p-2 hover:text-green-600 hover:bg-green-50 focus:text-green-600 tooltipped tooltipped-s"
<button id="upvote" class="p-2 hover:text-green-600 hover:bg-green-50 focus:text-green-600 tooltipped tooltipped-s"
aria-label="Helpful">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
Expand All @@ -23,5 +22,12 @@
</svg>
</button>
</div>
<a href="{{ feedback_url }}" class="feedback-send">Send feedback</a>
<a href="{{ feedback_url }}"
style="display:flex;align-items:center;text-decoration-line:underline;text-underline-offset:4px">Report
an issue<svg fill="currentColor" height="1em" stroke="none" viewBox="0 96 960 960" width="1em"
xmlns="http://www.w3.org/2000/svg">
<path
d="M188 868q-11-11-11-28t11-28l436-436H400q-17 0-28.5-11.5T360 336q0-17 11.5-28.5T400 296h320q17 0 28.5 11.5T760 336v320q0 17-11.5 28.5T720 696q-17 0-28.5-11.5T680 656V432L244 868q-11 11-28 11t-28-11Z">
</path>
</svg></a>
</div>
Loading

0 comments on commit ba7198f

Please sign in to comment.