Skip to content

Commit

Permalink
chore: Update template
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Aug 30, 2023
1 parent 10da050 commit 84bb407
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
6 changes: 1 addition & 5 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sphinx-notes/template",
"commit": "c781308dbd84e739727ce09aaf798444ced1e7e4",
"commit": "93c85ed7fe6dc87e11ffd024b762a3c8c9a83a1b",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -14,10 +14,6 @@
"github_repo": "strike",
"pypi_name": "sphinxnotes-strike",
"pypi_owner": "SilverRainZ",
"dependencies": [
"Sphinx >= 4"
],
"additional_docs": [],
"_template": "https://github.com/sphinx-notes/template"
}
},
Expand Down
31 changes: 26 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,56 @@

LANG = en_US.UTF-8

MAKE = make
PY = python3
RM = rm -rf
MAKE = make
PY = python3
RM = rm -rf

# Build sphinx documentation.
.PHONY: docs
docs:
$(MAKE) -C docs/

# Run unittest.
.PHONY: test
test:
$(PY) -m unittest discover -s tests -v

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

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

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

.PHONY: test-upload
test-upload: dist
# Same to the aboved "upload" target, but this publishs to PyPI test server
# <https://test.pypi.org/>.
.PHONY: upload-test
upload-test: dist
$(PY) -m twine upload --repository testpypi $</*

# Keep up to date with the latest template.
# See also https://github.com/sphinx-notes/template.
.PHONY: update-template
update-template:
$(PY) -m cruft update

# Update project version.
.PHONY: bump-version
bump-version:
@echo -n "Please enter the version to bump: "
@read version && $(PY) -m cruft update --variables-to-update "{ \"version\" : \"$$version\" }"
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@

# -- Extensions -------------------------------------------------------------

#
extensions.append('sphinxnotes.any')
from sphinxnotes.any import Schema, Field as F
any_schemas = [
Expand All @@ -89,6 +90,7 @@
#
]
primary_domain = 'any'
#

extensions.append('sphinx.ext.extlinks')
extlinks = {
Expand Down

0 comments on commit 84bb407

Please sign in to comment.