Skip to content

Commit 268dd02

Browse files
committed
chore: Update cookiecutter tempalte
1 parent 09c6f5c commit 268dd02

File tree

15 files changed

+129
-40
lines changed

15 files changed

+129
-40
lines changed

.cruft.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sphinx-notes/template",
3-
"commit": "c781308dbd84e739727ce09aaf798444ced1e7e4",
3+
"commit": "0b7d8aa478b37114cef369a217bd1d463e369d37",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -14,10 +14,6 @@
1414
"github_repo": "snippet",
1515
"pypi_name": "sphinxnotes-snippet",
1616
"pypi_owner": "SilverRainZ",
17-
"dependencies": [
18-
"Sphinx >= 4"
19-
],
20-
"additional_docs": [],
2117
"_template": "https://github.com/sphinx-notes/template"
2218
}
2319
},

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is generated from sphinx-notes/template.
1+
# This file is generated from sphinx-notes/cookiecutter.
22
# You need to consider modifying the TEMPLATE or modifying THIS FILE.
33

44
include LICENSE

Makefile

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,62 @@
1-
# This file is generated from sphinx-notes/template.
1+
# This file is generated from sphinx-notes/cookiecutter.
22
# You need to consider modifying the TEMPLATE or modifying THIS FILE.
33

44
LANG = en_US.UTF-8
55

6-
MAKE = make
7-
PY = python3
8-
RM = rm -rf
6+
MAKE = make
7+
PY = python3
8+
RM = rm -rf
99

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

15+
# Run unittest.
1416
.PHONY: test
1517
test:
1618
$(PY) -m unittest discover -s tests -v
1719

20+
# Build distribution package, for "install" or "upload".
1821
.PHONY: dist
1922
dist: pyproject.toml
2023
$(RM) dist/ # clean up old dist
2124
$(PY) -m build
2225

26+
# Install distribution package to user directory.
27+
#
28+
# NOTE: It may breaks your system-level packages, use at your own risk.
2329
.PHONY: install
2430
install: dist
31+
export PIP_BREAK_SYSTEM_PACKAGES=1 # required by Python 3.11+, see PEP-668
2532
$(PY) -m pip install --user --no-deps --force-reinstall dist/*.whl
2633

34+
# Publish wheel to PyPI offical server <https://pypi.org/> when you want to
35+
# You should have a PyPI account and have PyPI token configured.
36+
#
37+
# See also https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives
2738
.PHONY: upload
2839
upload: dist
2940
$(PY) -m twine upload --repository pypi $</*
3041

31-
.PHONY: test-upload
32-
test-upload: dist
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
3346
$(PY) -m twine upload --repository testpypi $</*
3447

48+
# Keep up to date with the latest template.
49+
# See also https://github.com/sphinx-notes/cookiecutter.
50+
.PHONY: update-template
51+
update-template:
52+
$(PY) -m cruft update
53+
54+
# Update project version.
55+
.PHONY: bump-version
56+
bump-version:
57+
@echo -n "Please enter the version to bump: "
58+
@read version && $(PY) -m cruft update --variables-to-update "{ \"version\" : \"$$version\" }"
59+
3560
# Usage: make cli args=--help
3661
.PHONY: cli
3762
cli:

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. This file is generated from sphinx-notes/template.
1+
.. This file is generated from sphinx-notes/cookiecutter.
22
You need to consider modifying the TEMPLATE or modifying THIS FILE.
33
44
===================
@@ -17,7 +17,7 @@ sphinxnotes-snippet
1717
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
1818
:alt: PyPI Package
1919

20-
.. image:: https://img.shields.io/pypi/dw/sphinxnotes-snippet
20+
.. image:: https://img.shields.io/pypi/dm/sphinxnotes-snippet
2121
:target: https://pypi.python.org/pypi/sphinxnotes-snippet
2222
:alt: PyPI Package Downloads
2323

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is generated from sphinx-notes/template.
1+
# This file is generated from sphinx-notes/cookiecutter.
22
# You need to consider modifying the TEMPLATE or modifying THIS FILE.
33

44
# Minimal makefile for Sphinx documentation

docs/_images/.gitkeep

Whitespace-only changes.
File renamed without changes.

docs/_templates/confval.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
:Type: :py:class:`{{ type }}`
3+
:Default: ``{{ default }}``
4+
{% if choice %}:Choices: {% for c in choice %}``{{ c }}`` {% endfor %}{% endif %}
5+
{% if versionadded %}:Version added: :version:`{{ versionadded }}`{% endif %}
6+
{% if versionchanged %}:Version changed:{% for i in range(0, versionchanged|count -1, 2) %}
7+
:version:`{{ versionchanged[i] }}`
8+
{{ versionchanged[i+1] }}{% endfor %}{% endif %}
9+
10+
{{ content }}
11+

docs/_templates/example.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
{% if style is not defined or style == 'tab' %}
3+
.. tab-set::
4+
5+
.. tab-item:: Result
6+
7+
{% for line in content %}{{ line }}
8+
{% endfor %}
9+
10+
.. tab-item:: reStructuredText
11+
12+
.. code:: rst
13+
14+
{% for line in content %}{{ line }}
15+
{% endfor %}
16+
{% elif style == 'grid' %}
17+
.. grid:: 2
18+
19+
.. grid-item-card:: reStructuredText
20+
21+
.. code:: rst
22+
23+
{% for line in content %}{{ line }}
24+
{% endfor %}
25+
26+
.. grid-item-card:: Result
27+
28+
{% for line in content %}{{ line }}
29+
{% endfor %}
30+
{% endif %}
31+

docs/_templates/version.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
.. list-table::
2-
:align: left
3-
4-
* - :ref:`📅 {{ date }} <any-version.date>`
5-
- :tag:`{{ title }}`
61

2+
:Date: :ref:`📅{{ date }} <any-version.date>`
3+
:Download: :tag:`{{ title }}`
74

85
{% for line in content %}
96
{{ line }}

0 commit comments

Comments
 (0)