Skip to content

Commit 1696086

Browse files
authored
✨ feat: rewrite as standalone package from virtualenv (#28)
1 parent 375e3a1 commit 1696086

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6133
-2517
lines changed

.github/workflows/check.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: check
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: ["main"]
6+
tags-ignore: ["**"]
7+
pull_request:
8+
schedule:
9+
- cron: "0 8 * * *"
10+
11+
concurrency:
12+
group: check-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
env:
22+
- "3.14"
23+
- "3.13"
24+
- "3.12"
25+
- "3.11"
26+
- "3.10"
27+
- "3.9"
28+
- "3.8"
29+
- type-3.8
30+
- type-3.14
31+
- dev
32+
- pkg_meta
33+
steps:
34+
- uses: actions/checkout@v6
35+
with:
36+
fetch-depth: 0
37+
- name: Install the latest version of uv
38+
uses: astral-sh/setup-uv@v7
39+
with:
40+
enable-cache: true
41+
cache-dependency-glob: "pyproject.toml"
42+
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
- name: Install tox
44+
run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv
45+
- name: Install Python
46+
if: startsWith(matrix.env, '3.') && matrix.env != '3.14'
47+
run: uv python install --python-preference only-managed ${{ matrix.env }}
48+
- name: Setup test suite
49+
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
50+
- name: Run test suite
51+
run: tox run --skip-pkg-install -e ${{ matrix.env }}
52+
env:
53+
PYTEST_ADDOPTS: "-vv --durations=20"
54+
DIFF_AGAINST: HEAD

.github/workflows/check.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release to PyPI
2+
on:
3+
push:
4+
tags: ["*"]
5+
6+
env:
7+
dists-artifact-name: python-package-distributions
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
with:
15+
fetch-depth: 0
16+
- name: Install the latest version of uv
17+
uses: astral-sh/setup-uv@v7
18+
with:
19+
enable-cache: true
20+
cache-dependency-glob: "pyproject.toml"
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Build package
23+
run: uv build --python 3.14 --python-preference only-managed --sdist --wheel . --out-dir dist
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v6
26+
with:
27+
name: ${{ env.dists-artifact-name }}
28+
path: dist/*
29+
30+
release:
31+
needs:
32+
- build
33+
runs-on: ubuntu-latest
34+
environment:
35+
name: release
36+
url: https://pypi.org/project/python-discovery/${{ github.ref_name }}
37+
permissions:
38+
id-token: write
39+
steps:
40+
- name: Download all the dists
41+
uses: actions/download-artifact@v7
42+
with:
43+
name: ${{ env.dists-artifact-name }}
44+
path: dist/
45+
- name: Publish to PyPI
46+
uses: pypa/gh-action-pypi-publish@v1.13.0
47+
with:
48+
attestations: true

.github/workflows/release.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
*.py[cod]
2-
*.swp
3-
__pycache__
4-
/src/py_discovery/_version.py
5-
build
6-
dist
1+
*.pyc
72
*.egg-info
8-
.tox
9-
/.*_cache
3+
dist/
4+
.tox/
5+
/src/python_discovery/_version.py

.pre-commit-config.yaml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v6.0.0
44
hooks:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
7+
- repo: https://github.com/python-jsonschema/check-jsonschema
8+
rev: 0.36.1
9+
hooks:
10+
- id: check-github-workflows
11+
args: ["--verbose"]
712
- repo: https://github.com/codespell-project/codespell
8-
rev: v2.3.0
13+
rev: v2.4.1
914
hooks:
1015
- id: codespell
11-
args: ["--write-changes"]
12-
- repo: https://github.com/tox-dev/tox-ini-fmt
13-
rev: "1.3.1"
14-
hooks:
15-
- id: tox-ini-fmt
16-
args: ["-p", "fix"]
16+
additional_dependencies: ["tomli>=2.4"]
1717
- repo: https://github.com/tox-dev/pyproject-fmt
18-
rev: "2.2.1"
18+
rev: "v2.11.1"
1919
hooks:
2020
- id: pyproject-fmt
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.6.3"
22+
rev: "v0.14.14"
2323
hooks:
2424
- id: ruff-format
2525
- id: ruff
2626
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
27+
- repo: https://github.com/rbubley/mirrors-prettier
28+
rev: "v3.8.1"
29+
hooks:
30+
- id: prettier
31+
additional_dependencies:
32+
- prettier@3.8.1
33+
- "@prettier/plugin-xml@3.4.2"
2734
- repo: meta
2835
hooks:
2936
- id: check-hooks-apply

.readthedocs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
build:
3+
os: ubuntu-lts-latest
4+
tools: {}
5+
commands:
6+
- curl -LsSf https://astral.sh/uv/install.sh | sh
7+
- ~/.local/bin/uv tool install tox --with tox-uv -p 3.14 --managed-python
8+
- ~/.local/bin/tox run -e docs --

.readthedocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ build:
44
tools:
55
python: "3.12"
66
commands:
7-
- pip install tox
8-
- tox r -e docs -- "${READTHEDOCS_OUTPUT}"/html
7+
- pip install tox
8+
- tox r -e docs -- "${READTHEDOCS_OUTPUT}"/html

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# [`py-discovery`](https://py-discovery.readthedocs.io/en/latest/)
1+
# [`python-discovery`](https://python-discovery.readthedocs.io/en/latest/)
22

3-
[![PyPI](https://img.shields.io/pypi/v/py-discovery?style=flat-square)](https://pypi.org/project/py-discovery/)
3+
[![PyPI](https://img.shields.io/pypi/v/python-discovery?style=flat-square)](https://pypi.org/project/python-discovery/)
44
[![Supported Python
5-
versions](https://img.shields.io/pypi/pyversions/py-discovery.svg)](https://pypi.org/project/py-discovery/)
6-
[![Downloads](https://static.pepy.tech/badge/py-discovery/month)](https://pepy.tech/project/py-discovery)
7-
[![check](https://github.com/tox-dev/py-discovery/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/py-discovery/actions/workflows/check.yml)
8-
[![Documentation Status](https://readthedocs.org/projects/py-discovery/badge/?version=latest)](https://py-discovery.readthedocs.io/en/latest/?badge=latest)
5+
versions](https://img.shields.io/pypi/pyversions/python-discovery.svg)](https://pypi.org/project/python-discovery/)
6+
[![Downloads](https://static.pepy.tech/badge/python-discovery/month)](https://pepy.tech/project/python-discovery)
7+
[![check](https://github.com/tox-dev/python-discovery/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/python-discovery/actions/workflows/check.yml)
8+
[![Documentation Status](https://readthedocs.org/projects/python-discovery/badge/?version=latest)](https://python-discovery.readthedocs.io/en/latest/?badge=latest)

docs/_static/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.sidebar-logo img {
2+
max-width: 100%;
3+
width: 100%;
4+
}

0 commit comments

Comments
 (0)