This commit is contained in:
Tiara Rodney 2025-06-19 17:58:46 +02:00
parent 9de1a7db79
commit 7bb0188a42
No known key found for this signature in database
GPG key ID: 5F43FAB4FBE5B5EB
30 changed files with 93 additions and 194 deletions

View file

@ -1,6 +1,6 @@
WEB2_PACKAGE_ID := html-theme-web2-1.0.0
WEB2_PACKAGE_URL := https://bitbucket.org/byteb4rb1e/html-theme-web2/downloads/$(WEB2_PACKAGE_ID).tar.gz
PYPKG_DIR := src/byteb4rb1e/sphinxcontrib/theme/web2
PYPKG_DIR := src/byteb4rb1e/sphinxcontrib/theme/web20
WITH_GPG = $(shell command -v gpg && echo yes)
PYTHON3=$(if $(wildcard .venv/.*),.venv/bin/python3,python3)
@ -35,10 +35,7 @@ $(PYPKG_DIR)/_static_extra.tar: vendor/$(WEB2_PACKAGE_ID).tar
$(PYPKG_DIR)/_static_extra.tar.sha256: vendor/$(WEB2_PACKAGE_ID).tar.sha256
cp -vf "$<" "$@"
test-reports test-reports/: test-reports/unit test-reports/integration
test-reports/unit:
$(PYTHON3) -m tox -m unit
test-reports test-reports/: test-reports/integration
test-reports/integration:
$(PYTHON3) -m tox -m integration

View file

@ -5,12 +5,9 @@ name = "pypi"
[dev-packages]
tox = "~=4.24.2"
mypy = "~=1.15.0"
autopep8 = "~=2.3.2"
setuptools-scm = "~=8.2.0"
pipenv = "~=2024.4.1"
pylint = "~=3.3.6"
tox = "*"
setuptools-scm = "*"
pipenv = "*"
build = "*"
[requires]

157
Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "d1fc51a334c037b89fa2fd6f634d84d5bbf48801d138aef103211d1111c22b7c"
"sha256": "cc611a65c9337f2c4eeac34c5e620d626382f670a323ae780ff6385cec5e0610"
},
"pipfile-spec": 6,
"requires": {
@ -17,23 +17,6 @@
},
"default": {},
"develop": {
"astroid": {
"hashes": [
"sha256:104fb9cb9b27ea95e847a94c003be03a9e039334a8ebca5ee27dafaf5c5711eb",
"sha256:c332157953060c6deb9caa57303ae0d20b0fbdb2e59b4a4f2a6ba49d0a7961ce"
],
"markers": "python_full_version >= '3.9.0'",
"version": "==3.3.10"
},
"autopep8": {
"hashes": [
"sha256:89440a4f969197b69a995e4ce0661b031f455a9f776d2c5ba3dbd83466931758",
"sha256:ce8ad498672c845a0c3de2629c15b635ec2b05ef8177a6e7c91c74f3e9b51128"
],
"index": "pypi",
"markers": "python_version >= '3.9'",
"version": "==2.3.2"
},
"build": {
"hashes": [
"sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5",
@ -45,19 +28,19 @@
},
"cachetools": {
"hashes": [
"sha256:82e73ba88f7b30228b5507dce1a1f878498fc669d972aef2dde4f3a3c24f103e",
"sha256:f225782b84438f828328fc2ad74346522f27e5b1440f4e9fd18b20ebfd1aa2cf"
"sha256:1c7bb3cf9193deaf3508b7c5f2a79986c13ea38965c5adcff1f84519cf39163e",
"sha256:b4c4f404392848db3ce7aac34950d17be4d864da4b8b66911008e430bc544587"
],
"markers": "python_version >= '3.9'",
"version": "==6.0.0"
"version": "==6.1.0"
},
"certifi": {
"hashes": [
"sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6",
"sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3"
"sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057",
"sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b"
],
"markers": "python_version >= '3.6'",
"version": "==2025.4.26"
"markers": "python_version >= '3.7'",
"version": "==2025.6.15"
},
"chardet": {
"hashes": [
@ -75,14 +58,6 @@
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'",
"version": "==0.4.6"
},
"dill": {
"hashes": [
"sha256:0633f1d2df477324f53a895b02c901fb961bdbf65a17122586ea7019292cbcf0",
"sha256:44f54bf6412c2c8464c14e8243eb163690a9800dbe2c367330883b19c7561049"
],
"markers": "python_version >= '3.8'",
"version": "==0.4.0"
},
"distlib": {
"hashes": [
"sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87",
@ -98,69 +73,6 @@
"markers": "python_version >= '3.9'",
"version": "==3.18.0"
},
"isort": {
"hashes": [
"sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450",
"sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615"
],
"markers": "python_full_version >= '3.9.0'",
"version": "==6.0.1"
},
"mccabe": {
"hashes": [
"sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325",
"sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"
],
"markers": "python_version >= '3.6'",
"version": "==0.7.0"
},
"mypy": {
"hashes": [
"sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e",
"sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22",
"sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f",
"sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2",
"sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f",
"sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b",
"sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5",
"sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f",
"sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43",
"sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e",
"sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c",
"sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828",
"sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba",
"sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee",
"sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d",
"sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b",
"sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445",
"sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e",
"sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13",
"sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5",
"sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd",
"sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf",
"sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357",
"sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b",
"sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036",
"sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559",
"sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3",
"sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f",
"sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464",
"sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980",
"sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078",
"sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"
],
"index": "pypi",
"markers": "python_version >= '3.9'",
"version": "==1.15.0"
},
"mypy-extensions": {
"hashes": [
"sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505",
"sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"
],
"markers": "python_version >= '3.8'",
"version": "==1.1.0"
},
"packaging": {
"hashes": [
"sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484",
@ -171,12 +83,12 @@
},
"pipenv": {
"hashes": [
"sha256:ab26ee98a7d83d342c1f562ee0564094ab1de091e5d5cec4eeaa95fb600de998",
"sha256:e8ea6105c1cdda7d5c19df7bd6439a006751f3d4e017602c791e7b51314adf84"
"sha256:87370bedcf0ff66d226af07ca341ae94afcc08fed90d57ad9fea9ffd44ced4d3",
"sha256:f0a67aa928824e61003d52acea72a94b180800019f03d38a311966f6330bc8d1"
],
"index": "pypi",
"markers": "python_version >= '3.8'",
"version": "==2024.4.1"
"markers": "python_version >= '3.9'",
"version": "==2025.0.3"
},
"platformdirs": {
"hashes": [
@ -194,23 +106,6 @@
"markers": "python_version >= '3.9'",
"version": "==1.6.0"
},
"pycodestyle": {
"hashes": [
"sha256:35863c5974a271c7a726ed228a14a4f6daf49df369d8c50cd9a6f58a5e143ba9",
"sha256:c8415bf09abe81d9c7f872502a6eee881fbe85d8763dd5b9924bb0a01d67efae"
],
"markers": "python_version >= '3.9'",
"version": "==2.13.0"
},
"pylint": {
"hashes": [
"sha256:2b11de8bde49f9c5059452e0c310c079c746a0a8eeaa789e5aa966ecc23e4559",
"sha256:43860aafefce92fca4cf6b61fe199cdc5ae54ea28f9bf4cd49de267b5195803d"
],
"index": "pypi",
"markers": "python_full_version >= '3.9.0'",
"version": "==3.3.7"
},
"pyproject-api": {
"hashes": [
"sha256:43c9918f49daab37e302038fc1aed54a8c7a91a9fa935d00b9a485f37e0f5335",
@ -237,37 +132,21 @@
},
"setuptools-scm": {
"hashes": [
"sha256:136e2b1d393d709d2bcf26f275b8dec06c48b811154167b0fd6bb002aad17d6d",
"sha256:a18396a1bc0219c974d1a74612b11f9dce0d5bd8b1dc55c65f6ac7fd609e8c28"
"sha256:332ca0d43791b818b841213e76b1971b7711a960761c5bea5fc5cdb5196fbce3",
"sha256:3d555e92b75dacd037d32bafdf94f97af51ea29ae8c7b234cf94b7a5bd242a63"
],
"index": "pypi",
"markers": "python_version >= '3.8'",
"version": "==8.2.0"
},
"tomlkit": {
"hashes": [
"sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1",
"sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0"
],
"markers": "python_version >= '3.8'",
"version": "==0.13.3"
"version": "==8.3.1"
},
"tox": {
"hashes": [
"sha256:92e8290e76ad4e15748860a205865696409a2d014eedeb796a34a0f3b5e7336e",
"sha256:d5948b350f76fae436d6545a5e87c2b676ab7a0d7d88c1308651245eadbe8aea"
"sha256:2b8a7fb986b82aa2c830c0615082a490d134e0626dbc9189986da46a313c4f20",
"sha256:b97d5ecc0c0d5755bcc5348387fef793e1bfa68eb33746412f4c60881d7f5f57"
],
"index": "pypi",
"markers": "python_version >= '3.8'",
"version": "==4.24.2"
},
"typing-extensions": {
"hashes": [
"sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4",
"sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af"
],
"markers": "python_version >= '3.9'",
"version": "==4.14.0"
"version": "==4.27.0"
},
"virtualenv": {
"hashes": [

View file

@ -7,7 +7,7 @@ requires = [
build-backend = "setuptools.build_meta"
[project]
name = "byteb4rb1e.sphinxcontrib.theme.web2"
name = "byteb4rb1e.sphinxcontrib.theme.web20"
description = "Functional theme for Sphinx documentation generator"
authors = [
{ name = "Tiara Rodney", email = "tiara.rodney@administratrix.de" }
@ -31,21 +31,27 @@ classifiers = [
"Topic :: Software Development :: Documentation",
]
dependencies = [
"sphinx >= 5.0"
"sphinx >= 5.0",
"byteb4rb1e.sphinxcontrib.ext @ git+https://bitbucket.org/byteb4rb1e/sphinxcontrib.git@a4fd97b55a2bff04b162e2f00dba148b0303f833"
]
dynamic = ["version"]
requires-python = ">=3.9"
[project.entry-points."sphinx.html_themes"]
web2 = "byteb4rb1e.sphinxcontrib.theme.web2"
web20 = "byteb4rb1e.sphinxcontrib.theme.web20"
[tool.setuptools.package-data]
# relative to root dir of package, NOT repository
"byteb4rb1e.sphinxcontrib.theme.web2" = ["*.tar", "*.tar.sha256"]
"byteb4rb1e.sphinxcontrib.theme.web20" = [
"*.tar",
"*.tar.sha256",
"theme.toml",
"**/*.html"
]
[project.urls]
Bitbucket = "https://bitbucket.org/byteb4rb1e/sphinxcontrib-theme-seaharvest"
GitHub = "https://github.com/ByteB4rb1e/sphinxcontrib-theme-seaharvest"
Bitbucket = "https://bitbucket.org/byteb4rb1e/sphinxcontrib-theme-web20"
GitHub = "https://github.com/ByteB4rb1e/sphinxcontrib-theme-web20"
[tool.mypy]
strict = true

View file

@ -1,23 +0,0 @@
"""
Tiara's Sphinx theme reference implementation.
"""
from pathlib import Path
from sys import version_info as python_version
from sphinx import version_info as sphinx_version
from sphinx.locale import _
from sphinx.util.logging import getLogger
logger = getLogger(__name__)
def setup(app):
"""
"""
app.require_sphinx('8.0')
app.add_html_theme('web2', Path(__file__).resolve().parent)
app.add_js_file('assets/script/theme.js')
return {'parallel_read_safe': True, 'parallel_write_safe': True}

View file

@ -0,0 +1,23 @@
"""
Tiara's Sphinx theme reference implementation.
"""
from pathlib import Path
import sphinx.application
from sphinx.util.logging import getLogger
logger = getLogger(__name__)
def setup(app: sphinx.application.Sphinx):
"""
"""
app.require_sphinx('5.0')
app.add_html_theme('web20', Path(__file__).resolve().parent)
app.setup_extension("byteb4rb1e.sphinxcontrib.ext.html_static_archive")
app.config["html_static_archive"] = 'pkg://byteb4rb1e.sphinxcontrib.theme.web20/_static_extra.tar'
app.add_js_file('script/theme.js')
app.add_css_file('style/theme.css')
return {'parallel_read_safe': True, 'parallel_write_safe': True}

View file

@ -1,14 +1,10 @@
[theme]
inherit = "none"
stylesheets = [
"_static/style/seaharvest.css",
]
sidebars = [
"localtoc.html",
"relations.html",
"sourcelink.html",
"searchbox.html",
]
pygments_style = { default = "style_name", dark = "dark_style" }
[options]

View file

@ -0,0 +1,31 @@
from pathlib import Path
import pytest
from byteb4rb1e.sphinxcontrib.testing.pytest.fixtures import (
mock_sphinx_testapp,
mock_sphinx_testsrc_dir
)
def test_default(
mock_sphinx_testapp,
mock_sphinx_testsrc_dir,
) -> None:
"""
"""
src_dir = mock_sphinx_testsrc_dir()
(src_dir / 'conf.py').write_text("""
project = "foobar"
master_doc = "index"
extensions = ["byteb4rb1e.sphinxcontrib.theme"]
html_theme = "web20"
""")
app = mock_sphinx_testapp(srcdir=src_dir)
app.build(force_all=True)
assert (Path(app.outdir) / '_static' / 'style' / 'theme.css').exists()
assert (Path(app.outdir) / '_static' / 'script' / 'theme.js').exists()

View file

@ -0,0 +1,3 @@
pytest_plugins = ["byteb4rb1e.sphinxcontrib.testing.pytest.fixtures"]

12
tox.ini
View file

@ -2,8 +2,7 @@
requires =
tox>=4.19
env_list =
py3{8-12}-{unit}
py3{8-12}-sphinx{5-8}-{integration}
integration-py3{9-13}-sphinx{5-8}
lint
format
@ -35,15 +34,6 @@ deps =
commands =
black --check src tests
[testenv:py3{9-13}-unit]
description = run type check on code base
labels = unit
deps =
{[testenv]deps}
pytest
commands =
pytest tests/unit --junitxml=test-reports/{env_name}.xml
[testenv:py3{9-13}-sphinx{5-7}-integration]
description = run type check on code base
labels = integration