Skip to content

Commit 258bfcd

Browse files
committed
Set up the package scaffolding.
1 parent 9185b30 commit 258bfcd

20 files changed

+705
-0
lines changed

.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 `referencing-http` 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 (referencing-http)`.
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/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- dependabot
5+
- pre-commit-ci

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: [published]
8+
schedule:
9+
# Daily at 5:41
10+
- cron: "41 5 * * *"
11+
12+
env:
13+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
14+
PIP_NO_PYTHON_VERSION_WARNING: "1"
15+
16+
jobs:
17+
pre-commit:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.x"
24+
- uses: pre-commit/action@v3.0.0
25+
26+
list:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Set up nox
33+
uses: wntrblm/nox@2023.04.22
34+
- id: noxenvs-matrix
35+
run: |
36+
echo >>$GITHUB_OUTPUT noxenvs=$(
37+
nox --list-sessions --json | jq '[.[].session]'
38+
)
39+
40+
ci:
41+
needs: list
42+
runs-on: ${{ matrix.os }}
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
os: [macos-latest, ubuntu-latest]
47+
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}
48+
posargs: [""]
49+
include:
50+
- os: ubuntu-latest
51+
noxenv: "tests-3.11"
52+
posargs: coverage github
53+
54+
steps:
55+
- uses: actions/checkout@v4
56+
- name: Install dependencies
57+
run: sudo apt-get update && sudo apt-get install -y libenchant-2-dev
58+
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
59+
- name: Install dependencies
60+
run: brew install enchant
61+
if: runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs')
62+
- name: Set up Python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: |
66+
3.8
67+
3.9
68+
3.10
69+
3.11
70+
3.12
71+
pypy3.10
72+
allow-prereleases: true
73+
- name: Set up nox
74+
uses: wntrblm/nox@2023.04.22
75+
- name: Run nox
76+
run: nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }}
77+
78+
packaging:
79+
needs: ci
80+
runs-on: ubuntu-latest
81+
environment:
82+
name: PyPI
83+
url: https://pypi.org/p/referencing-http
84+
permissions:
85+
contents: write
86+
id-token: write
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
- name: Set up Python
91+
uses: actions/setup-python@v5
92+
with:
93+
python-version: "3.x"
94+
- name: Install dependencies
95+
run: python -m pip install build
96+
- name: Create packages
97+
run: python -m build .
98+
- name: Publish to PyPI
99+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
100+
uses: pypa/gh-action-pypi-publish@release/v1
101+
- name: Create a Release
102+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
103+
uses: softprops/action-gh-release@v1
104+
with:
105+
files: |
106+
dist/*
107+
generate_release_notes: true

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-ast
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/astral-sh/ruff-pre-commit
16+
rev: "v0.1.11"
17+
hooks:
18+
- id: ruff
19+
args: [--fix, --exit-non-zero-on-fix]
20+
- repo: https://github.com/PyCQA/isort
21+
rev: 5.13.2
22+
hooks:
23+
- id: isort
24+
- repo: https://github.com/psf/black
25+
rev: 23.12.1
26+
hooks:
27+
- name: black
28+
id: black
29+
args: ["--line-length", "79"]
30+
- repo: https://github.com/pre-commit/mirrors-prettier
31+
rev: "v4.0.0-alpha.8"
32+
hooks:
33+
- id: prettier

README.rst

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

docs/.readthedocs.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
7+
8+
sphinx:
9+
builder: dirhtml
10+
configuration: docs/conf.py
11+
fail_on_warning: true
12+
13+
formats: all
14+
15+
python:
16+
install:
17+
- requirements: docs/requirements.txt

docs/conf.py

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

docs/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. include:: ../README.rst
2+
3+
4+
Contents
5+
--------
6+
7+
.. toctree::
8+
:glob:
9+
:maxdepth: 2

docs/requirements.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
file:.#egg=referencing-http
2+
furo
3+
pygments-github-lexers
4+
sphinx
5+
sphinxcontrib-spelling
6+
sphinx-copybutton
7+
sphinxext-opengraph

docs/requirements.txt

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile --strip-extras docs/requirements.in
6+
#
7+
alabaster==0.7.13
8+
# via sphinx
9+
babel==2.14.0
10+
# via sphinx
11+
beautifulsoup4==4.12.2
12+
# via furo
13+
certifi==2023.11.17
14+
# via requests
15+
charset-normalizer==3.3.2
16+
# via requests
17+
docutils==0.20.1
18+
# via sphinx
19+
furo==2023.9.10
20+
# via -r docs/requirements.in
21+
idna==3.6
22+
# via requests
23+
imagesize==1.4.1
24+
# via sphinx
25+
jinja2==3.1.2
26+
# via sphinx
27+
markupsafe==2.1.3
28+
# via jinja2
29+
packaging==23.2
30+
# via sphinx
31+
pyenchant==3.2.2
32+
# via sphinxcontrib-spelling
33+
pygments==2.17.2
34+
# via
35+
# furo
36+
# pygments-github-lexers
37+
# sphinx
38+
pygments-github-lexers==0.0.5
39+
# via -r docs/requirements.in
40+
file:.#egg=referencing-http
41+
# via -r docs/requirements.in
42+
requests==2.31.0
43+
# via sphinx
44+
snowballstemmer==2.2.0
45+
# via sphinx
46+
soupsieve==2.5
47+
# via beautifulsoup4
48+
sphinx==7.2.6
49+
# via
50+
# -r docs/requirements.in
51+
# furo
52+
# sphinx-basic-ng
53+
# sphinx-copybutton
54+
# sphinxcontrib-applehelp
55+
# sphinxcontrib-devhelp
56+
# sphinxcontrib-htmlhelp
57+
# sphinxcontrib-qthelp
58+
# sphinxcontrib-serializinghtml
59+
# sphinxcontrib-spelling
60+
# sphinxext-opengraph
61+
sphinx-basic-ng==1.0.0b2
62+
# via furo
63+
sphinx-copybutton==0.5.2
64+
# via -r docs/requirements.in
65+
sphinxcontrib-applehelp==1.0.7
66+
# via sphinx
67+
sphinxcontrib-devhelp==1.0.5
68+
# via sphinx
69+
sphinxcontrib-htmlhelp==2.0.4
70+
# via sphinx
71+
sphinxcontrib-jsmath==1.0.1
72+
# via sphinx
73+
sphinxcontrib-qthelp==1.0.6
74+
# via sphinx
75+
sphinxcontrib-serializinghtml==1.1.9
76+
# via sphinx
77+
sphinxcontrib-spelling==8.0.0
78+
# via -r docs/requirements.in
79+
sphinxext-opengraph==0.9.1
80+
# via -r docs/requirements.in
81+
urllib3==2.1.0
82+
# via requests

docs/spelling-wordlist.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)