Skip to content

Commit 057773b

Browse files
committed
chore: Update project template to sphinx-notes/cookiecutter@7cadd39d
1 parent 40cdb3c commit 057773b

File tree

18 files changed

+319
-168
lines changed

18 files changed

+319
-168
lines changed

.cruft.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sphinx-notes/cookiecutter",
3-
"commit": "0b7d8aa478b37114cef369a217bd1d463e369d37",
3+
"commit": "7cadd39d13e7e95f37aecb9e998f4d7bb66dbf10",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -14,7 +14,13 @@
1414
"github_repo": "strike",
1515
"pypi_name": "sphinxnotes-strike",
1616
"pypi_owner": "SilverRainZ",
17-
"_template": "https://github.com/sphinx-notes/cookiecutter"
17+
"is_python_project": true,
18+
"python_version": "3.12",
19+
"is_sphinx_extension": true,
20+
"sphinx_version": "7.0",
21+
"development_status": "3 - Alpha",
22+
"_template": "https://github.com/sphinx-notes/cookiecutter",
23+
"_commit": "7cadd39d13e7e95f37aecb9e998f4d7bb66dbf10"
1824
}
1925
},
2026
"directory": null

.github/workflows/lint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Ruff
2+
on: [ push, pull_request ]
3+
4+
jobs:
5+
ruff:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: chartboost/ruff-action@v1

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313

1414
jobs:
1515
pages:
16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-latest
1717
environment:
1818
name: github-pages
1919
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/pypi.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish package distributions to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
pypi:
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/sphinxnotes-strike
14+
permissions:
15+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
- run: pip install build twine && make dist
20+
- uses: pypa/gh-action-pypi-publish@release/v1
21+
with:
22+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish Github Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+" # MAJOR.MINOR (1.0: y, 1.0a0: n, 1.0.1: n)
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: ncipollo/release-action@v1
16+
with:
17+
body: |
18+
Changelog: https://sphinx.silverrainz.me/strike/changelog.html

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,5 @@ poetry.lock
133133

134134
# Sphinx
135135
docs/_build/
136+
# sphinxnotes-any >= 2.5
137+
docs/.any*

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.6.1
4+
hooks:
5+
- id: ruff-check
6+
args: [ --fix ]
7+
- id: ruff-format

Makefile

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,36 @@ LANG = en_US.UTF-8
66
MAKE = make
77
PY = python3
88
RM = rm -rf
9+
GIT = git
10+
OPEN = xdg-open
911

10-
# Build sphinx documentation.
1112
.PHONY: docs
1213
docs:
1314
$(MAKE) -C docs/
1415

15-
# Run unittest.
16+
.PHONY:
17+
view:
18+
$(OPEN) docs/_build/html/index.html
19+
20+
.PHONY: clean
21+
clean:
22+
$(MAKE) -C docs/ clean; $(RM) dist/
23+
24+
.PHONY: fmt
25+
fmt:
26+
ruff format src/ && ruff check --fix src/
27+
1628
.PHONY: test
1729
test:
1830
$(PY) -m unittest discover -s tests -v
1931

32+
################################################################################
33+
# Distribution Package
34+
################################################################################
35+
2036
# Build distribution package, for "install" or "upload".
2137
.PHONY: dist
22-
dist: pyproject.toml
23-
$(RM) dist/ # clean up old dist
38+
dist: pyproject.toml clean
2439
$(PY) -m build
2540

2641
# Install distribution package to user directory.
@@ -39,20 +54,37 @@ install: dist
3954
upload: dist
4055
$(PY) -m twine upload --repository pypi $</*
4156

42-
# Same to the aboved "upload" target, but this publishs to PyPI test server
43-
# <https://test.pypi.org/>.
44-
.PHONY: upload-test
45-
upload-test: dist
46-
$(PY) -m twine upload --repository testpypi $</*
57+
################################################################################
58+
# Cookiecutter Incremental Updates
59+
################################################################################
4760

4861
# Keep up to date with the latest template.
49-
# See also https://github.com/sphinx-notes/cookiecutter.
50-
.PHONY: update-template
51-
update-template:
62+
# See https://github.com/sphinx-notes/cookiecutter.
63+
.PHONY: tmpl-update
64+
tmpl-update:
5265
$(PY) -m cruft update
5366

67+
.PHONY: tmpl-update-done
68+
tmpl-update-done:
69+
$(GIT) commit -m "chore: Update project template to sphinx-notes/cookiecutter@$(shell jq -r '.commit' .cruft.json | head -c8)"
70+
71+
.PHONY: apply-rej
72+
apply-rej:
73+
@for rej in $$(find . -name '*.rej'); do \
74+
echo "applying $$rej..."; \
75+
wiggle --replace $${rej%.rej} $$rej; \
76+
done
77+
78+
# Detect the minimum Python versions needed to run code.
79+
pyvermin:
80+
vermin --eval-annotations --target=3.12- --versions src/
81+
5482
# Update project version.
5583
.PHONY: bump-version
5684
bump-version:
5785
@echo -n "Please enter the version to bump: "
5886
@read version && $(PY) -m cruft update --variables-to-update "{ \"version\" : \"$$version\" }"
87+
88+
################################################################################
89+
# CUSTOM TARGETS
90+
################################################################################

README.rst

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,28 @@
55
sphinxnotes-strike
66
==================
77

8-
.. image:: https://img.shields.io/github/actions/workflow/status/sphinx-notes/strike/pages.yml
8+
.. |docs| image:: https://img.shields.io/github/deployments/sphinx-notes/strike/github-pages
99
:target: https://sphinx.silverrainz.me/strike
1010
:alt: Documentation Status
11-
12-
.. image:: https://img.shields.io/github/license/sphinx-notes/strike
13-
:target: https://github.com/sphinx-notes/strike/LICENSE
11+
.. |license| image:: https://img.shields.io/github/license/sphinx-notes/strike
12+
:target: https://github.com/sphinx-notes/strike/blob/master/LICENSE
1413
:alt: Open Source License
15-
16-
.. image:: https://img.shields.io/pypi/v/sphinxnotes-strike.svg
14+
.. |pypi| image:: https://img.shields.io/pypi/v/sphinxnotes-strike.svg
1715
:target: https://pypi.python.org/pypi/sphinxnotes-strike
1816
:alt: PyPI Package
19-
20-
.. image:: https://img.shields.io/pypi/dm/sphinxnotes-strike
17+
.. |download| image:: https://img.shields.io/pypi/dm/sphinxnotes-strike
2118
:target: https://pypi.python.org/pypi/sphinxnotes-strike
2219
:alt: PyPI Package Downloads
2320

21+
|docs| |license| |pypi| |download|
22+
2423
An extension that adds strikethrough text support to Sphinx.
2524

26-
* Documentation: https://sphinx.silverrainz.me/strike
27-
* Source: https://github.com/sphinx-notes/strike
28-
* Changelog: https://sphinx.silverrainz.me/strike/changelog.html
29-
* Tracker: https://github.com/sphinx-notes/strike/issues
30-
* Download: https://pypi.org/project/sphinxnotes-strike/#files
25+
.. INTRODUCTION START
26+
(MUST written in standard reStructuredText, without Sphinx stuff)
27+
28+
.. INTRODUCTION END
29+
30+
Please refer to Documentation_ for more details.
31+
32+
.. _Documentation: https://sphinx.silverrainz.me/strike

docs/_templates/confval.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)