Skip to content

Commit

Permalink
chore: Template upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jun 4, 2023
1 parent 39de5db commit 15c7cd6
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 0.15.7
_commit: 0.15.10
_src_path: gh:pawamoy/copier-pdm.git
author_email: pawamoy@pm.me
author_fullname: Timothée Mazzucotelli
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,29 @@ jobs:
- name: Check for breaking changes in the API
run: pdm run duty check-api

exclude-test-jobs:
runs-on: ubuntu-latest
outputs:
jobs: ${{ steps.exclude-jobs.outputs.jobs }}
steps:
- id: exclude-jobs
run: |
if ${{ github.repository_owner == 'pawamoy-insiders' }}; then
echo 'jobs=[
{"os": "macos-latest"},
{"os": "windows-latest"},
{"python-version": "3.8"},
{"python-version": "3.9"},
{"python-version": "3.10"},
{"python-version": "3.11"}
]' | tr -d '[:space:]' >> $GITHUB_OUTPUT
else
echo 'jobs=[]' >> $GITHUB_OUTPUT
fi
tests:

needs: exclude-test-jobs
strategy:
max-parallel: 4
matrix:
Expand All @@ -67,6 +88,7 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
exclude: ${{ fromJSON(needs.exclude-test-jobs.outputs.jobs) }}

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v3
- name: Install build
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DEFAULT_GOAL := help
SHELL := bash

DUTY = $(shell [ -n "${VIRTUAL_ENV}" ] || echo pdm run) duty
DUTY := $(if $(VIRTUAL_ENV),,pdm run) duty

args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
check_quality_args = files
Expand Down
12 changes: 5 additions & 7 deletions docs/css/mkdocstrings.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@ div.doc-contents:not(.first) {
}

/* Mark external links as such. */
a.external::after,
a.autorefs-external::after {
/* https://primer.style/octicons/arrow-up-right-24 */
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="rgb(0, 0, 0)" d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
content: ' ';

display: inline-block;
vertical-align: middle;
position: relative;
bottom: 0.1em;
margin-left: 0.2em;
margin-right: 0.1em;

height: 0.7em;
width: 0.7em;
border-radius: 100%;
height: 1em;
width: 1em;
background-color: var(--md-typeset-a-color);
}

a.external:hover::after,
a.autorefs-external:hover::after {
background-color: var(--md-accent-fg-color);
}
Expand Down
6 changes: 4 additions & 2 deletions scripts/gen_ref_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import mkdocs_gen_files

nav = mkdocs_gen_files.Nav()
mod_symbol = '<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'

for path in sorted(Path("src").rglob("*.py")):
module_path = path.relative_to("src").with_suffix("")
Expand All @@ -20,13 +21,14 @@
elif parts[-1].startswith("_"):
continue

nav[parts] = doc_path.as_posix()
nav_parts = [f"{mod_symbol} {part}" for part in parts]
nav[tuple(nav_parts)] = doc_path.as_posix()

with mkdocs_gen_files.open(full_doc_path, "w") as fd:
ident = ".".join(parts)
fd.write(f"::: {ident}")

mkdocs_gen_files.set_edit_path(full_doc_path, Path("../") / path)
mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path)

with mkdocs_gen_files.open("reference/SUMMARY.txt", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())

0 comments on commit 15c7cd6

Please sign in to comment.