Skip to content

Commit

Permalink
Add the rest of the usual package scaffolding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Aug 17, 2022
1 parent 9bd60f0 commit 41979dc
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
ban-relative-imports = true
inline-quotes = "
ignore =
B008, # Barring function calls in default args. Ha, no.
B306, # See https://github.com/PyCQA/flake8-bugbear/issues/131
W503, # (flake8 default) old PEP8 boolean operator line breaks
22 changes: 22 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
===========================
``sphinx-json-schema-spec``
===========================

|PyPI| |Pythons| |CI|

.. |PyPI| image:: https://img.shields.io/pypi/v/sphinx-json-schema-spec.svg
:alt: PyPI version
:target: https://pypi.org/project/sphinx-json-schema-spec/

.. |Pythons| image:: https://img.shields.io/pypi/pyversions/sphinx-json-schema-spec.svg
:alt: Supported Python versions
:target: https://pypi.org/project/sphinx-json-schema-spec/

.. |CI| image:: https://github.com/python-jsonschema/sphinx-json-schema-spec/workflows/CI/badge.svg
:alt: Build status
:target: https://github.com/python-jsonschema/sphinx-json-schema-spec/actions?query=workflow%3ACI


A Sphinx extension providing a role which allows linking to sections within the `JSON Schema specifications <https://json-schema.org/>`_.

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.
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

[project]
name = "sphinx_json_schema_spec"
description = ""
readme = "README.rst"
requires-python = ">=3.7"
license = {text = "MIT"}
keywords = ["json schema", "jsonschema", "data validation", "sphinx", "json"]
authors = [
{email = "[email protected]"},
{name = "Julian Berman"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python",
"Framework :: Sphinx :: Extension",
"Topic :: Documentation :: Sphinx",
]
dynamic = ["version"]

dependencies = [
"lxml",
"sphinx>=5.1.1",
]

[project.urls]
Homepage = "https://github.com/python-jsonschema/sphinx-json-schema-spec"
Issues = "https://github.com/python-jsonschema/sphinx-json-schema-spec/issues/"
Funding = "https://github.com/sponsors/Julian"
Source = "https://github.com/python-jsonschema/sphinx-json-schema-spec"

[tool.isort]
from_first = true
include_trailing_comma = true
multi_line_output = 3
Empty file.
2 changes: 2 additions & 0 deletions sphinx_json_schema_spec/tests/test_sphinx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_it_works():
pass
63 changes: 63 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[tox]
envlist =
{py37,py38,py39,py310,py311,pypy3}-{build,tests}
readme
safety
secrets
style
skipsdist = True

[testenv]
passenv = CI
setenv =
coverage: MAYBE_COVERAGE = coverage run -m
coverage: COVERAGE_RCFILE={toxinidir}/.coveragerc
coverage: COVERAGE_DEBUG_FILE={envtmpdir}/coverage-debug
coverage: COVERAGE_FILE={envtmpdir}/coverage-data
changedir = {envtmpdir}
args_are_paths = false
commands =
{envpython} -m pip install {toxinidir}

safety: {envpython} -m safety check

tests,coverage: {envpython} -m {env:MAYBE_COVERAGE:} py.test {posargs:{toxinidir}/sphinx_json_schema_spec/}
tests: {envpython} -m doctest {toxinidir}/README.rst

coverage: {envpython} -m coverage report --show-missing
coverage: {envpython} -m coverage html --directory={envtmpdir}/htmlcov
deps =
safety: safety
tests,coverage: pytest
coverage: coverage

[testenv:build]
deps = build
commands = {envpython} -m build {toxinidir} --outdir {envtmpdir}/dist

[testenv:bandit]
deps = bandit
commands = {envpython} -m bandit --recursive sphinx_json_schema_spec

[testenv:readme]
deps =
build
twine
commands =
{envpython} -m build --outdir {envtmpdir}/dist {toxinidir}
{envpython} -m twine check {envtmpdir}/dist/*

[testenv:secrets]
deps = detect-secrets
commands = {envbindir}/detect-secrets scan {toxinidir}

[testenv:style]
deps =
flake8
flake8-broken-line
flake8-bugbear
flake8-commas
flake8-quotes
flake8-tidy-imports
commands =
{envpython} -m flake8 {posargs} --max-complexity 10 {toxinidir}/sphinx_json_schema_spec

0 comments on commit 41979dc

Please sign in to comment.