Skip to content

Commit

Permalink
Generate the package skeleton.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Dec 27, 2022
1 parent 3c49159 commit 56e70ec
Show file tree
Hide file tree
Showing 20 changed files with 536 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# vim: filetype=dosini:
[run]
branch = True
source = jsonschema_specifications
dynamic_context = test_function
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
ban-relative-imports = true
inline-quotes = "
ignore =
# Barring function calls in default args. Ha, no.
B008,
# See https://github.com/PyCQA/flake8-bugbear/issues/131
B306,
# (flake8 default) old PEP8 boolean operator line breaks
W503,
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: "Julian"
15 changes: 15 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Supported Versions

In general, only the latest released `jsonschema-specifications` version is supported and will receive updates.

## Reporting a Vulnerability

To report a security vulnerability, please send an email to `Julian+Security` at `GrayVines.com` with subject line `SECURITY (jsonschema-specifications)`.

I will do my best to respond within 48 hours to acknowledge the message and discuss further steps.

If the vulnerability is accepted, an advisory will be sent out via GitHub's security advisory functionality.

For non-sensitive discussion related to this policy itself, feel free to open an issue on the issue tracker.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI

on:
push:
pull_request:
release:
types: [published]
schedule:
# Daily at 6:43
- cron: "43 6 * * *"

env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
PYTHON_LATEST: "3.11"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
- uses: pre-commit/[email protected]

list:
runs-on: ubuntu-latest
outputs:
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
steps:
- uses: actions/checkout@v3
- name: Set up nox
uses: wntrblm/[email protected]
- id: noxenvs-matrix
run: |
echo >>$GITHUB_OUTPUT noxenvs=$(
nox --list-sessions |
grep '^* ' |
cut -d ' ' -f 2- |
jq --raw-input --slurp 'split("\n") | map(select(. != ""))'
)
ci:
needs: list
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: >
sudo apt-get update &&
sudo apt-get install -y libenchant-2-dev
if: runner.os == 'Linux'
- name: Install dependencies
run: brew install enchant
if: runner.os == 'macOS'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
- name: Set up nox
uses: wntrblm/[email protected]
- name: Run nox
run: nox -s ${{ matrix.noxenv }}

packaging:
needs: ci
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
- name: Install dependencies
run: python -m pip install build
- name: Create packages
run: python -m build .
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: Publish the package
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
- id: check-json
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix, lf]
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: v5.11.3
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: "5.0.4"
hooks:
- id: flake8
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
hooks:
- id: yesqa
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
hooks:
- id: pyupgrade
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- name: black
id: black
args: ["--line-length", "79"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
hooks:
- id: prettier
21 changes: 21 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
=============================
``jsonschema-specifications``
=============================

|PyPI| |Pythons| |CI| |ReadTheDocs|

.. |PyPI| image:: https://img.shields.io/pypi/v/jsonschema-specifications.svg
:alt: PyPI version
:target: https://pypi.org/project/jsonschema-specifications/

.. |Pythons| image:: https://img.shields.io/pypi/pyversions/jsonschema-specifications.svg
:alt: Supported Python versions
:target: https://pypi.org/project/jsonschema-specifications/

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

.. |ReadTheDocs| image:: https://readthedocs.org/projects/jsonschema-specifications/badge/?version=stable&style=flat
:alt: ReadTheDocs status
:target: https://jsonschema-specifications.readthedocs.io/en/stable/
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
61 changes: 61 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import importlib.metadata
import re


project = "jsonschema-specifications"
author = "Julian Berman"
copyright = f"2022, {author}"

release = importlib.metadata.version("jsonschema-specifications")
version = release.partition("-")[0]

language = "en"
default_role = "any"

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinxcontrib.spelling",
"sphinxext.opengraph",
]

pygments_style = "lovelace"
pygments_dark_style = "one-dark"

html_theme = "furo"

# = Builders =


def entire_domain(host):
return r"http.?://" + re.escape(host) + r"($|/.*)"


linkcheck_ignore = [
entire_domain("img.shields.io"),
"https://github.com/python-jsonschema/jsonschema/actions",
"https://github.com/python-jsonschema/jsonschema/workflows/CI/badge.svg",
]

# = Extensions =

# -- autosectionlabel --

autosectionlabel_prefix_document = True

# -- intersphinx --

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
}

# -- sphinxcontrib-spelling --

spelling_word_list_filename = "spelling-wordlist.txt"
spelling_show_suggestions = True
9 changes: 9 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. include:: ../README.rst


Contents
--------

.. toctree::
:glob:
:maxdepth: 2
7 changes: 7 additions & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
file:.#egg=jsonschema_specifications
furo
pygments-github-lexers
sphinx-copybutton
sphinx>5
sphinxcontrib-spelling>5
sphinxext-opengraph
79 changes: 79 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#
# This file is autogenerated by pip-compile with python 3.11
# To update, run:
#
# pip-compile docs/requirements.in
#
alabaster==0.7.12
# via sphinx
babel==2.11.0
# via sphinx
beautifulsoup4==4.11.1
# via furo
certifi==2022.12.7
# via requests
charset-normalizer==2.1.1
# via requests
docutils==0.19
# via sphinx
furo==2022.12.7
# via -r docs/requirements.in
idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.2
# via sphinx
file:.#egg=jsonschema_specifications
# via -r docs/requirements.in
markupsafe==2.1.1
# via jinja2
packaging==22.0
# via sphinx
pyenchant==3.2.2
# via sphinxcontrib-spelling
pygments==2.13.0
# via
# furo
# pygments-github-lexers
# sphinx
pygments-github-lexers==0.0.5
# via -r docs/requirements.in
pytz==2022.7
# via babel
requests==2.28.1
# via sphinx
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.3.2.post1
# via beautifulsoup4
sphinx==5.3.0
# via
# -r docs/requirements.in
# furo
# sphinx-basic-ng
# sphinx-copybutton
# sphinxcontrib-spelling
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b1
# via furo
sphinx-copybutton==0.5.1
# via -r docs/requirements.in
sphinxcontrib-applehelp==1.0.2
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.0
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxcontrib-spelling==7.7.0
# via -r docs/requirements.in
sphinxext-opengraph==0.7.4
# via -r docs/requirements.in
urllib3==1.26.13
# via requests
Empty file added docs/spelling-wordlist.txt
Empty file.
Empty file added docs/spelling_wordlist.txt
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 56e70ec

Please sign in to comment.