Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 `referencing-http` 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 (referencing-http)`.

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"
107 changes: 107 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: CI

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

env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0

list:
runs-on: ubuntu-latest
outputs:
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
steps:
- uses: actions/checkout@v4
- name: Set up nox
uses: wntrblm/nox@2023.04.22
- id: noxenvs-matrix
run: |
echo >>$GITHUB_OUTPUT noxenvs=$(
nox --list-sessions --json | jq '[.[].session]'
)

ci:
needs: list
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}
posargs: [""]
include:
- os: ubuntu-latest
noxenv: "tests-3.11"
posargs: coverage github

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' && startsWith(matrix.noxenv, 'docs')
- name: Install dependencies
run: brew install enchant
if: runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs')
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
pypy3.10
allow-prereleases: true
- name: Set up nox
uses: wntrblm/nox@2023.04.22
- name: Run nox
run: nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }}

packaging:
needs: ci
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/referencing-http
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install build
- name: Create packages
run: python -m build .
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
generate_release_notes: true
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
- 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/astral-sh/ruff-pre-commit
rev: "v0.1.11"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- name: black
id: black
args: ["--line-length", "79"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
22 changes: 22 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
====================
``referencing-http``
====================

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

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

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

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


.. |ReadTheDocs| image:: https://readthedocs.org/projects/referencing-http/badge/?version=stable&style=flat
:alt: ReadTheDocs status
:target: https://referencing-http.readthedocs.io/en/stable/
17 changes: 17 additions & 0 deletions docs/.readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
builder: dirhtml
configuration: docs/conf.py
fail_on_warning: true

formats: all

python:
install:
- requirements: docs/requirements.txt
53 changes: 53 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import importlib.metadata
import re

project = "referencing-http"
author = "Julian Berman"
copyright = f"2024, {author}"

release = importlib.metadata.version("referencing-http")
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",
"sphinxcontrib.spelling",
"sphinxext.opengraph",
]

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

html_theme = "furo"


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


linkcheck_ignore = [
entire_domain("img.shields.io"),
"https://github.com/Julian/referencing-http/actions",
"https://github.com/Julian/referencing-http/workflows/CI/badge.svg",
# REMOVEME: Once RTD builds the project
entire_domain("referencing-http.readthedocs.io"),
]

# = Extensions =

# -- autosectionlabel --

autosectionlabel_prefix_document = True

# -- 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=referencing-http
furo
pygments-github-lexers
sphinx
sphinxcontrib-spelling
sphinx-copybutton
sphinxext-opengraph
82 changes: 82 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --strip-extras docs/requirements.in
#
alabaster==0.7.13
# via sphinx
babel==2.14.0
# via sphinx
beautifulsoup4==4.12.2
# via furo
certifi==2023.11.17
# via requests
charset-normalizer==3.3.2
# via requests
docutils==0.20.1
# via sphinx
furo==2023.9.10
# via -r docs/requirements.in
idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.2
# via sphinx
markupsafe==2.1.3
# via jinja2
packaging==23.2
# via sphinx
pyenchant==3.2.2
# via sphinxcontrib-spelling
pygments==2.17.2
# via
# furo
# pygments-github-lexers
# sphinx
pygments-github-lexers==0.0.5
# via -r docs/requirements.in
file:.#egg=referencing-http
# via -r docs/requirements.in
requests==2.31.0
# via sphinx
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.5
# via beautifulsoup4
sphinx==7.2.6
# via
# -r docs/requirements.in
# furo
# sphinx-basic-ng
# sphinx-copybutton
# sphinxcontrib-applehelp
# sphinxcontrib-devhelp
# sphinxcontrib-htmlhelp
# sphinxcontrib-qthelp
# sphinxcontrib-serializinghtml
# sphinxcontrib-spelling
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b2
# via furo
sphinx-copybutton==0.5.2
# via -r docs/requirements.in
sphinxcontrib-applehelp==1.0.7
# via sphinx
sphinxcontrib-devhelp==1.0.5
# via sphinx
sphinxcontrib-htmlhelp==2.0.4
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.6
# via sphinx
sphinxcontrib-serializinghtml==1.1.9
# via sphinx
sphinxcontrib-spelling==8.0.0
# via -r docs/requirements.in
sphinxext-opengraph==0.9.1
# via -r docs/requirements.in
urllib3==2.1.0
# via requests
Empty file added docs/spelling-wordlist.txt
Empty file.
Loading