Skip to content

Commit 56e70ec

Browse files
committed
Generate the package skeleton.
1 parent 3c49159 commit 56e70ec

20 files changed

+536
-0
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# vim: filetype=dosini:
2+
[run]
3+
branch = True
4+
source = jsonschema_specifications
5+
dynamic_context = test_function

.flake8

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

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: "Julian"

.github/SECURITY.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
In general, only the latest released `jsonschema-specifications` version is supported and will receive updates.
6+
7+
## Reporting a Vulnerability
8+
9+
To report a security vulnerability, please send an email to `Julian+Security` at `GrayVines.com` with subject line `SECURITY (jsonschema-specifications)`.
10+
11+
I will do my best to respond within 48 hours to acknowledge the message and discuss further steps.
12+
13+
If the vulnerability is accepted, an advisory will be sent out via GitHub's security advisory functionality.
14+
15+
For non-sensitive discussion related to this policy itself, feel free to open an issue on the issue tracker.

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: [published]
8+
schedule:
9+
# Daily at 6:43
10+
- cron: "43 6 * * *"
11+
12+
env:
13+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
14+
PIP_NO_PYTHON_VERSION_WARNING: "1"
15+
PYTHON_LATEST: "3.11"
16+
17+
jobs:
18+
pre-commit:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ env.PYTHON_LATEST }}
25+
- uses: pre-commit/[email protected]
26+
27+
list:
28+
runs-on: ubuntu-latest
29+
outputs:
30+
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Set up nox
34+
uses: wntrblm/[email protected]
35+
- id: noxenvs-matrix
36+
run: |
37+
echo >>$GITHUB_OUTPUT noxenvs=$(
38+
nox --list-sessions |
39+
grep '^* ' |
40+
cut -d ' ' -f 2- |
41+
jq --raw-input --slurp 'split("\n") | map(select(. != ""))'
42+
)
43+
44+
ci:
45+
needs: list
46+
runs-on: ${{ matrix.os }}
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
os: [macos-latest, ubuntu-latest]
51+
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}
52+
53+
steps:
54+
- uses: actions/checkout@v3
55+
- name: Install dependencies
56+
run: >
57+
sudo apt-get update &&
58+
sudo apt-get install -y libenchant-2-dev
59+
if: runner.os == 'Linux'
60+
- name: Install dependencies
61+
run: brew install enchant
62+
if: runner.os == 'macOS'
63+
- name: Set up Python
64+
uses: actions/setup-python@v4
65+
with:
66+
python-version: ${{ env.PYTHON_LATEST }}
67+
- name: Set up nox
68+
uses: wntrblm/[email protected]
69+
- name: Run nox
70+
run: nox -s ${{ matrix.noxenv }}
71+
72+
packaging:
73+
needs: ci
74+
runs-on: ubuntu-latest
75+
76+
steps:
77+
- uses: actions/checkout@v3
78+
- name: Set up Python
79+
uses: actions/setup-python@v4
80+
with:
81+
python-version: ${{ env.PYTHON_LATEST }}
82+
- name: Install dependencies
83+
run: python -m pip install build
84+
- name: Create packages
85+
run: python -m build .
86+
- uses: actions/upload-artifact@v3
87+
with:
88+
name: dist
89+
path: dist
90+
- name: Publish the package
91+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
92+
uses: pypa/gh-action-pypi-publish@release/v1
93+
with:
94+
password: ${{ secrets.pypi_password }}
95+
- name: Create a Release
96+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
97+
uses: actions/github-script@v6
98+
with:
99+
github-token: ${{ secrets.GITHUB_TOKEN }}
100+
101+
script: |
102+
await github.request(`POST /repos/${{ github.repository }}/releases`, {
103+
tag_name: "${{ github.ref }}",
104+
generate_release_notes: true
105+
});
106+

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-ast
6+
- id: check-json
7+
- id: check-toml
8+
- id: check-vcs-permalinks
9+
- id: check-yaml
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
args: [--fix, lf]
14+
- id: trailing-whitespace
15+
- repo: https://github.com/PyCQA/isort
16+
rev: v5.11.3
17+
hooks:
18+
- id: isort
19+
- repo: https://github.com/PyCQA/flake8
20+
rev: "5.0.4"
21+
hooks:
22+
- id: flake8
23+
- repo: https://github.com/asottile/yesqa
24+
rev: v1.4.0
25+
hooks:
26+
- id: yesqa
27+
- repo: https://github.com/asottile/pyupgrade
28+
rev: v2.38.2
29+
hooks:
30+
- id: pyupgrade
31+
- repo: https://github.com/psf/black
32+
rev: 22.8.0
33+
hooks:
34+
- name: black
35+
id: black
36+
args: ["--line-length", "79"]
37+
- repo: https://github.com/pre-commit/mirrors-prettier
38+
rev: "v3.0.0-alpha.4"
39+
hooks:
40+
- id: prettier

README.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=============================
2+
``jsonschema-specifications``
3+
=============================
4+
5+
|PyPI| |Pythons| |CI| |ReadTheDocs|
6+
7+
.. |PyPI| image:: https://img.shields.io/pypi/v/jsonschema-specifications.svg
8+
:alt: PyPI version
9+
:target: https://pypi.org/project/jsonschema-specifications/
10+
11+
.. |Pythons| image:: https://img.shields.io/pypi/pyversions/jsonschema-specifications.svg
12+
:alt: Supported Python versions
13+
:target: https://pypi.org/project/jsonschema-specifications/
14+
15+
.. |CI| image:: https://github.com/python-jsonschema/jsonschema-specifications/workflows/CI/badge.svg
16+
:alt: Build status
17+
:target: https://github.com/python-jsonschema/jsonschema-specifications/actions?query=workflow%3ACI
18+
19+
.. |ReadTheDocs| image:: https://readthedocs.org/projects/jsonschema-specifications/badge/?version=stable&style=flat
20+
:alt: ReadTheDocs status
21+
:target: https://jsonschema-specifications.readthedocs.io/en/stable/

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import importlib.metadata
2+
import re
3+
4+
5+
project = "jsonschema-specifications"
6+
author = "Julian Berman"
7+
copyright = f"2022, {author}"
8+
9+
release = importlib.metadata.version("jsonschema-specifications")
10+
version = release.partition("-")[0]
11+
12+
language = "en"
13+
default_role = "any"
14+
15+
extensions = [
16+
"sphinx.ext.autodoc",
17+
"sphinx.ext.autosectionlabel",
18+
"sphinx.ext.coverage",
19+
"sphinx.ext.doctest",
20+
"sphinx.ext.intersphinx",
21+
"sphinx.ext.napoleon",
22+
"sphinx.ext.viewcode",
23+
"sphinx_copybutton",
24+
"sphinxcontrib.spelling",
25+
"sphinxext.opengraph",
26+
]
27+
28+
pygments_style = "lovelace"
29+
pygments_dark_style = "one-dark"
30+
31+
html_theme = "furo"
32+
33+
# = Builders =
34+
35+
36+
def entire_domain(host):
37+
return r"http.?://" + re.escape(host) + r"($|/.*)"
38+
39+
40+
linkcheck_ignore = [
41+
entire_domain("img.shields.io"),
42+
"https://github.com/python-jsonschema/jsonschema/actions",
43+
"https://github.com/python-jsonschema/jsonschema/workflows/CI/badge.svg",
44+
]
45+
46+
# = Extensions =
47+
48+
# -- autosectionlabel --
49+
50+
autosectionlabel_prefix_document = True
51+
52+
# -- intersphinx --
53+
54+
intersphinx_mapping = {
55+
"python": ("https://docs.python.org/3", None),
56+
}
57+
58+
# -- sphinxcontrib-spelling --
59+
60+
spelling_word_list_filename = "spelling-wordlist.txt"
61+
spelling_show_suggestions = True

0 commit comments

Comments
 (0)