Skip to content

Commit ab54863

Browse files
committed
Initial packaging setup.
1 parent 8aa335c commit ab54863

19 files changed

+660
-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 = referencing
5+
dynamic_context = test_function

.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

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

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: [published]
8+
schedule:
9+
# Daily at 8:33
10+
- cron: '33 8 * * *'
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.11"
20+
- uses: pre-commit/[email protected]
21+
22+
ci:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Install dependencies
28+
run: >
29+
sudo apt-get update &&
30+
sudo apt-get install -y libenchant-dev
31+
if: runner.os == 'Linux'
32+
- name: Install dependencies
33+
run: brew install enchant podman
34+
if: runner.os == 'macOS'
35+
- name: Set up Python
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: "3.11"
39+
- name: Set up nox
40+
uses: wntrblm/[email protected]
41+
- name: Run nox
42+
run: nox
43+
44+
packaging:
45+
needs: ci
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v3
50+
- name: Set up Python
51+
uses: actions/setup-python@v4
52+
with:
53+
python-version: "3.11"
54+
- name: Install dependencies
55+
run: python -m pip install build
56+
- name: Create packages
57+
run: python -m build .
58+
- name: Set up nox
59+
uses: wntrblm/[email protected]
60+
- name: Publish to PyPI
61+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
62+
uses: pypa/gh-action-pypi-publish@release/v1
63+
with:
64+
user: __token__
65+
password: ${{ secrets.pypi_password }}
66+
- name: Create a Release
67+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
68+
uses: softprops/action-gh-release@v1
69+
with:
70+
files: |
71+
dist/*
72+
generate_release_notes: true

.gitignore

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
105+
__pypackages__/
106+
107+
# Celery stuff
108+
celerybeat-schedule
109+
celerybeat.pid
110+
111+
# SageMath parsed files
112+
*.sage.py
113+
114+
# Environments
115+
.env
116+
.venv
117+
env/
118+
venv/
119+
ENV/
120+
env.bak/
121+
venv.bak/
122+
123+
# Spyder project settings
124+
.spyderproject
125+
.spyproject
126+
127+
# Rope project settings
128+
.ropeproject
129+
130+
# mkdocs documentation
131+
/site
132+
133+
# mypy
134+
.mypy_cache/
135+
.dmypy.json
136+
dmypy.json
137+
138+
# Pyre type checker
139+
.pyre/
140+
141+
# pytype static type analyzer
142+
.pytype/
143+
144+
# Cython debug symbols
145+
cython_debug/
146+
147+
# PyCharm
148+
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
149+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
150+
# and can be added to the global gitignore or merged into this file. For a more nuclear
151+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
152+
#.idea/
153+
154+
# User defined
155+
_cache

README.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
===============
2+
``referencing``
3+
===============
4+
5+
|PyPI| |Pythons| |CI|
6+
7+
.. |PyPI| image:: https://img.shields.io/pypi/v/referencing.svg
8+
:alt: PyPI version
9+
:target: https://pypi.org/project/referencing/
10+
11+
.. |Pythons| image:: https://img.shields.io/pypi/pyversions/referencing.svg
12+
:alt: Supported Python versions
13+
:target: https://pypi.org/project/referencing/
14+
15+
.. |CI| image:: https://github.com/Julian/referencing/workflows/CI/badge.svg
16+
:alt: Build status
17+
:target: https://github.com/Julian/referencing/actions?query=workflow%3ACI
18+
19+
.. image:: https://results.pre-commit.ci/badge/github/python-jsonschema/referencing/main.svg
20+
:alt: pre-commit.ci status
21+
:target: https://results.pre-commit.ci/latest/github/python-jsonschema/referencing/main
22+
23+
24+
A (very early) playground for exploring:
25+
26+
* the budding JSON `reference specification(s) <https://github.com/json-schema-org/referencing>`_ (currently housed within the JSON Schema organization but intended to be more broadly applicable)
27+
28+
* a newer / better integration of reference resolution into `jsonschema <https://pypi.org/project/jsonschema/>`_, likely built on top of the more generic interface which will come out of the above
29+
30+
What's here (if any of it even functions) is highly experimental and will change.

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)

0 commit comments

Comments
 (0)