Skip to content

Commit 41979dc

Browse files
committed
Add the rest of the usual package scaffolding.
1 parent 9bd60f0 commit 41979dc

File tree

6 files changed

+146
-0
lines changed

6 files changed

+146
-0
lines changed

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
ban-relative-imports = true
3+
inline-quotes = "
4+
ignore =
5+
B008, # Barring function calls in default args. Ha, no.
6+
B306, # See https://github.com/PyCQA/flake8-bugbear/issues/131
7+
W503, # (flake8 default) old PEP8 boolean operator line breaks

README.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
===========================
2+
``sphinx-json-schema-spec``
3+
===========================
4+
5+
|PyPI| |Pythons| |CI|
6+
7+
.. |PyPI| image:: https://img.shields.io/pypi/v/sphinx-json-schema-spec.svg
8+
:alt: PyPI version
9+
:target: https://pypi.org/project/sphinx-json-schema-spec/
10+
11+
.. |Pythons| image:: https://img.shields.io/pypi/pyversions/sphinx-json-schema-spec.svg
12+
:alt: Supported Python versions
13+
:target: https://pypi.org/project/sphinx-json-schema-spec/
14+
15+
.. |CI| image:: https://github.com/python-jsonschema/sphinx-json-schema-spec/workflows/CI/badge.svg
16+
:alt: Build status
17+
:target: https://github.com/python-jsonschema/sphinx-json-schema-spec/actions?query=workflow%3ACI
18+
19+
20+
A Sphinx extension providing a role which allows linking to sections within the `JSON Schema specifications <https://json-schema.org/>`_.
21+
22+
It is intended for use by implementations of JSON Schema (in Python or otherwise) who may wish to interlink to the specification in their own documentation.

pyproject.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[tool.hatch.version]
6+
source = "vcs"
7+
8+
[project]
9+
name = "sphinx_json_schema_spec"
10+
description = ""
11+
readme = "README.rst"
12+
requires-python = ">=3.7"
13+
license = {text = "MIT"}
14+
keywords = ["json schema", "jsonschema", "data validation", "sphinx", "json"]
15+
authors = [
16+
{email = "[email protected]"},
17+
{name = "Julian Berman"},
18+
]
19+
classifiers = [
20+
"Development Status :: 4 - Beta",
21+
"Intended Audience :: Developers",
22+
"License :: OSI Approved :: MIT License",
23+
"Operating System :: OS Independent",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.7",
28+
"Programming Language :: Python :: 3.8",
29+
"Programming Language :: Python :: 3.9",
30+
"Programming Language :: Python :: Implementation :: CPython",
31+
"Programming Language :: Python :: Implementation :: PyPy",
32+
"Programming Language :: Python",
33+
"Framework :: Sphinx :: Extension",
34+
"Topic :: Documentation :: Sphinx",
35+
]
36+
dynamic = ["version"]
37+
38+
dependencies = [
39+
"lxml",
40+
"sphinx>=5.1.1",
41+
]
42+
43+
[project.urls]
44+
Homepage = "https://github.com/python-jsonschema/sphinx-json-schema-spec"
45+
Issues = "https://github.com/python-jsonschema/sphinx-json-schema-spec/issues/"
46+
Funding = "https://github.com/sponsors/Julian"
47+
Source = "https://github.com/python-jsonschema/sphinx-json-schema-spec"
48+
49+
[tool.isort]
50+
from_first = true
51+
include_trailing_comma = true
52+
multi_line_output = 3

sphinx_json_schema_spec/tests/__init__.py

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_it_works():
2+
pass

tox.ini

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[tox]
2+
envlist =
3+
{py37,py38,py39,py310,py311,pypy3}-{build,tests}
4+
readme
5+
safety
6+
secrets
7+
style
8+
skipsdist = True
9+
10+
[testenv]
11+
passenv = CI
12+
setenv =
13+
coverage: MAYBE_COVERAGE = coverage run -m
14+
coverage: COVERAGE_RCFILE={toxinidir}/.coveragerc
15+
coverage: COVERAGE_DEBUG_FILE={envtmpdir}/coverage-debug
16+
coverage: COVERAGE_FILE={envtmpdir}/coverage-data
17+
changedir = {envtmpdir}
18+
args_are_paths = false
19+
commands =
20+
{envpython} -m pip install {toxinidir}
21+
22+
safety: {envpython} -m safety check
23+
24+
tests,coverage: {envpython} -m {env:MAYBE_COVERAGE:} py.test {posargs:{toxinidir}/sphinx_json_schema_spec/}
25+
tests: {envpython} -m doctest {toxinidir}/README.rst
26+
27+
coverage: {envpython} -m coverage report --show-missing
28+
coverage: {envpython} -m coverage html --directory={envtmpdir}/htmlcov
29+
deps =
30+
safety: safety
31+
tests,coverage: pytest
32+
coverage: coverage
33+
34+
[testenv:build]
35+
deps = build
36+
commands = {envpython} -m build {toxinidir} --outdir {envtmpdir}/dist
37+
38+
[testenv:bandit]
39+
deps = bandit
40+
commands = {envpython} -m bandit --recursive sphinx_json_schema_spec
41+
42+
[testenv:readme]
43+
deps =
44+
build
45+
twine
46+
commands =
47+
{envpython} -m build --outdir {envtmpdir}/dist {toxinidir}
48+
{envpython} -m twine check {envtmpdir}/dist/*
49+
50+
[testenv:secrets]
51+
deps = detect-secrets
52+
commands = {envbindir}/detect-secrets scan {toxinidir}
53+
54+
[testenv:style]
55+
deps =
56+
flake8
57+
flake8-broken-line
58+
flake8-bugbear
59+
flake8-commas
60+
flake8-quotes
61+
flake8-tidy-imports
62+
commands =
63+
{envpython} -m flake8 {posargs} --max-complexity 10 {toxinidir}/sphinx_json_schema_spec

0 commit comments

Comments
 (0)