Skip to content

Commit d6dc481

Browse files
committed
Merge branch 'skel'
2 parents 743e1a6 + 59eab19 commit d6dc481

File tree

7 files changed

+91
-31
lines changed

7 files changed

+91
-31
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ on:
99
- v*
1010
pull_request:
1111

12+
env:
13+
UV_SYSTEM_PYTHON: 1
14+
1215
jobs:
13-
checkdeps:
16+
test:
1417
runs-on: ${{ matrix.os }}
1518
strategy:
1619
fail-fast: false
1720
matrix:
18-
python-version: ["3.10", "3.11", "3.12"]
21+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1922
os: [macOS-latest, ubuntu-latest, windows-latest]
2023

2124
steps:
@@ -25,14 +28,48 @@ jobs:
2528
uses: actions/setup-python@v5
2629
with:
2730
python-version: ${{ matrix.python-version }}
31+
- uses: astral-sh/setup-uv@v3
2832
- name: Install
2933
run: |
30-
python -m pip install --upgrade pip
31-
make setup
32-
pip install -U .
34+
uv pip install -e .[test]
3335
- name: Test
3436
run: make test
3537
- name: Lint
36-
run: make lint
38+
run: |
39+
uv pip install -e .[test,dev]
40+
make lint
41+
if: ${{ matrix.python-version != '3.9' && matrix.python-version != '3.8'}}
3742
- name: Checkdeps
3843
run: make checkdeps
44+
45+
build:
46+
needs: test
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: actions/setup-python@v5
51+
with:
52+
python-version: "3.12"
53+
- uses: astral-sh/setup-uv@v3
54+
- name: Install
55+
run: uv pip install build
56+
- name: Build
57+
run: python -m build
58+
- name: Upload
59+
uses: actions/upload-artifact@v3
60+
with:
61+
name: sdist
62+
path: dist
63+
64+
publish:
65+
needs: build
66+
runs-on: ubuntu-latest
67+
if: startsWith(github.ref, 'refs/tags/v')
68+
permissions:
69+
id-token: write
70+
steps:
71+
- uses: actions/download-artifact@v3
72+
with:
73+
name: sdist
74+
path: dist
75+
- uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,9 @@ venv.bak/
105105

106106
# Visual Studio Code
107107
.vscode/
108+
109+
# Vim swapfiles
110+
*.sw[op]
111+
112+
# Setuptools-scm
113+
_version.py

Makefile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
PYTHON?=python
22
SOURCES=checkdeps setup.py
33

4+
UV:=$(shell uv --version)
5+
ifdef UV
6+
VENV:=uv venv
7+
PIP:=uv pip
8+
else
9+
VENV:=python -m venv
10+
PIP:=python -m pip
11+
endif
12+
413
.PHONY: venv
514
venv:
6-
$(PYTHON) -m venv .venv
15+
$(VENV) .venv
716
source .venv/bin/activate && make setup
817
@echo 'run `source .venv/bin/activate` to use virtualenv'
918

@@ -12,7 +21,7 @@ venv:
1221

1322
.PHONY: setup
1423
setup:
15-
python -m pip install -Ue .[dev,test]
24+
$(PIP) install -Ue .[dev,test]
1625

1726
.PHONY: test
1827
test:
@@ -21,13 +30,15 @@ test:
2130

2231
.PHONY: format
2332
format:
24-
python -m ufmt format $(SOURCES)
33+
ruff format
34+
ruff check --fix
2535

2636
.PHONY: lint
2737
lint:
28-
python -m ufmt check $(SOURCES)
29-
python -m flake8 $(SOURCES)
30-
mypy --strict --install-types --non-interactive -p checkdeps
38+
ruff check $(SOURCES)
39+
python -m checkdeps --allow-names checkdeps,toml checkdeps
40+
$(PIP) install types-toml
41+
mypy --strict --non-interactive checkdeps
3142

3243
.PHONY: release
3344
release:

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,18 @@ more self-contained.
4949
* Offer to add missing deps
5050
* Better handling of version-dependent deps in an `if` or `try`/`except`
5151

52+
# Version Compat
53+
54+
Usage of this library should work back to 3.8, but development (and mypy
55+
compatibility) only on 3.10-3.12. Linting requires 3.12 for full fidelity.
56+
57+
# Versioning
58+
59+
This library follows [meanver](https://meanver.org/) which basically means
60+
[semver](https://semver.org/) along with a promise to rename when the major
61+
version changes.
62+
5263
# License
5364

5465
checkdeps is copyright [Tim Hatch](https://timhatch.com/), and licensed under
55-
the MIT license. I am providing code in this repository to you under an open
56-
source license. This is my personal repository; the license you receive to
57-
my code is from me and not from my employer. See the `LICENSE` file for details.
66+
the MIT license. See the `LICENSE` file for details.

checkdeps/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
try:
2+
from ._version import __version__
3+
except ImportError: # pragma: no cover
4+
__version__ = "dev"

setup.cfg

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ author_email = [email protected]
1010

1111
[options]
1212
packages = find:
13+
python_requires = >=3.8
1314
setup_requires =
1415
setuptools_scm >= 8
1516
setuptools >= 65
16-
python_requires = >=3.10
1717
include_package_data = true
1818
install_requires =
1919
click>=7.0
@@ -24,15 +24,11 @@ install_requires =
2424

2525
[options.extras_require]
2626
dev =
27-
black == 23.12.1
28-
# checkdeps == 0.0.2
29-
flake8 == 7.0.0
30-
mypy == 1.8.0
31-
tox == 4.12.1
32-
twine == 4.0.2
33-
ufmt == 2.3.0
34-
usort == 1.0.7
35-
wheel == 0.42.0
27+
ruff == 0.8.0
28+
checkdeps == 0.9.0
29+
mypy == 1.13.0
30+
tox == 4.23.2
31+
3632
test =
3733
coverage >= 6
3834

@@ -59,7 +55,7 @@ skip_covered = True
5955
ignore_missing_imports = True
6056

6157
[tox:tox]
62-
envlist = py{310,311,312}, coverage
58+
envlist = py{38,39,310,311,312,313}, coverage
6359

6460
[testenv]
6561
deps = .[test]
@@ -77,8 +73,5 @@ commands =
7773
coverage combine
7874
coverage report
7975
depends =
80-
py{310,311,312}
76+
py{38,39,310,311,312,313}
8177

82-
[flake8]
83-
ignore = E203, E231, E266, E302, E501, W503
84-
max-line-length = 88

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from setuptools import setup
22

3-
setup(use_scm_version=True)
3+
setup(use_scm_version={"write_to": "checkdeps/_version.py"})

0 commit comments

Comments
 (0)