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 2, 2023
1 parent 2de4717 commit dbffcbc
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 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.8
_src_path: gh:pawamoy/copier-pdm
author_email: [email protected]
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 @@ -51,8 +51,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 @@ -66,6 +87,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
10 changes: 3 additions & 7 deletions docs/css/mkdocstrings.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ div.doc-contents:not(.first) {
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);
}

Expand Down
4 changes: 3 additions & 1 deletion 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-mod">mod</code>'

for path in sorted(Path("src").rglob("*.py")):
module_path = path.relative_to("src").with_suffix("")
Expand All @@ -20,7 +21,8 @@
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)
Expand Down

0 comments on commit dbffcbc

Please sign in to comment.