-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use uv in CI and update for PEP 639.
- Loading branch information
Showing
4 changed files
with
85 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,35 +7,32 @@ on: | |
tags: | ||
- "v*" | ||
pull_request: | ||
release: | ||
types: [published] | ||
schedule: | ||
# Daily at 7:37 | ||
- cron: "37 7 * * *" | ||
workflow_dispatch: | ||
|
||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: "1" | ||
PIP_NO_PYTHON_VERSION_WARNING: "1" | ||
|
||
jobs: | ||
list: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up nox | ||
uses: wntrblm/[email protected] | ||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
- id: noxenvs-matrix | ||
run: | | ||
echo >>$GITHUB_OUTPUT noxenvs=$( | ||
nox --list-sessions --json | jq '[.[].session]' | ||
uvx nox --list-sessions --json | jq '[.[].session]' | ||
) | ||
ci: | ||
needs: list | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -44,7 +41,7 @@ jobs: | |
posargs: [""] | ||
include: | ||
- os: ubuntu-latest | ||
noxenv: "tests-3.11" | ||
noxenv: tests-3.13 | ||
posargs: coverage github | ||
|
||
steps: | ||
|
@@ -59,39 +56,43 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: | | ||
3.8 | ||
3.9 | ||
3.10 | ||
3.11 | ||
3.12 | ||
3.13 | ||
pypy3.10 | ||
allow-prereleases: true | ||
- name: Set up nox | ||
uses: wntrblm/[email protected] | ||
|
||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
|
||
- name: Run nox | ||
run: nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }} | ||
run: uvx nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }} | ||
|
||
packaging: | ||
needs: ci | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: PyPI | ||
url: https://pypi.org/p/jsonschema-lexer | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
cache: pip | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: python -m pip install build | ||
- name: Create packages | ||
run: python -m build . | ||
enable-cache: true | ||
|
||
- name: Build our distributions | ||
run: uv run --frozen --with 'build[uv]' -m build --installer=uv | ||
|
||
- name: Publish to PyPI | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,21 @@ name = "jsonschema-lexer" | |
description = "A Pygments lexer for JSON Schema" | ||
requires-python = ">=3.10" | ||
readme = "README.rst" | ||
license = "MIT" | ||
license-files = ["COPYING"] | ||
keywords = ["json", "jsonschema"] | ||
authors = [ | ||
{ name = "Julian Berman", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"License :: OSI Approved :: MIT License", | ||
"Intended Audience :: Developers", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.13", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
"Topic :: File Formats :: JSON", | ||
|
@@ -56,24 +58,16 @@ skip_covered = true | |
|
||
[tool.doc8] | ||
ignore = [ | ||
"D000", # see PyCQA/doc8#125 | ||
"D001", # one sentence per line, so max length doesn't make sense | ||
"D000", # see PyCQA/doc8#125 | ||
"D001", # one sentence per line, so max length doesn't make sense | ||
] | ||
|
||
[tool.isort] | ||
combine_as_imports = true | ||
ensure_newline_before_comments = true | ||
from_first = true | ||
include_trailing_comma = true | ||
multi_line_output = 3 | ||
use_parentheses = true | ||
|
||
[tool.pyright] | ||
reportUnnecessaryTypeIgnoreComment = true | ||
strict = ["**/*.py"] | ||
exclude = [ | ||
"**/tests/__init__.py", | ||
"**/tests/test_*.py", | ||
"**/tests/__init__.py", | ||
"**/tests/test_*.py", | ||
] | ||
|
||
[tool.ruff] | ||
|
@@ -85,6 +79,7 @@ ignore = [ | |
"A001", # It's fine to shadow builtins | ||
"A002", | ||
"A003", | ||
"A005", | ||
"ARG", # This is all wrong whenever an interface is involved | ||
"ANN", # Just let the type checker do this | ||
"B006", # Mutable arguments require care but are OK if you don't abuse them | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.