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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
os: [macOS-latest, ubuntu-latest, windows-latest]
exclude:
- python-version: "3.7"
Expand All @@ -31,17 +31,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v3
- name: Install
run: |
uv pip install -e .[test]
uv pip install -e .[test,dev]
- name: Test
run: make test
run: |
git config --global user.name "Unit Test"
git config --global user.email "example@example.com"
make test
- name: Lint
run: |
uv pip install -e .[test,dev]
make lint
if: ${{ matrix.python-version != '3.9' && matrix.python-version != '3.8' && matrix.python-version != '3.7' }}

build:
needs: test
Expand All @@ -50,14 +54,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.14"
- uses: astral-sh/setup-uv@v3
- name: Install
run: uv pip install build
- name: Build
run: python -m build
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist
Expand All @@ -69,7 +73,7 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,9 @@ venv.bak/

# Visual Studio Code
.vscode/

# Vim swapfiles
*.sw[op]

# Setuptools-scm
_version.py
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
PYTHON?=python
SOURCES=vmodule setup.py
ifeq ($(OS),Windows_NT)
ACTIVATE:=.venv/Scripts/activate
else
ACTIVATE:=.venv/bin/activate
endif

.PHONY: venv
venv:
$(PYTHON) -m venv .venv
source .venv/bin/activate && make setup
@echo 'run `source .venv/bin/activate` to use virtualenv'
UV:=$(shell uv --version)
ifdef UV
VENV:=uv venv
PIP:=uv pip
else
VENV:=python -m venv
PIP:=python -m pip
endif

# The rest of these are intended to be run within the venv, where python points
# to whatever was used to set up the venv.
.venv:
$(VENV) .venv

.PHONY: setup
setup:
python -m pip install -Ue .[dev,test]
setup: .venv
source $(ACTIVATE) && $(PIP) install -Ue .[dev,test]

.PHONY: test
test:
python -m coverage run -m vmodule.tests $(TESTOPTS)
python -m coverage run -m pytest $(TESTOPTS)
python -m coverage report

.PHONY: format
format:
python -m ufmt format $(SOURCES)
ruff format
ruff check --fix

.PHONY: lint
lint:
python -m ufmt check $(SOURCES)
python -m flake8 $(SOURCES)
ruff check
python -m checkdeps --allow-names vmodule vmodule
mypy --strict --install-types --non-interactive vmodule

.PHONY: release
release:
rm -rf dist
python setup.py sdist bdist_wheel
twine upload dist/*
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ sets concurrent.futures to INFO

# Version Compat

Usage of this library should work back to 3.7, but development (and mypy
compatibility) only on 3.10-3.12. Linting requires 3.12 for full fidelity.
This library is compatile with Python 3.10+, but should be linted under the
newest stable version.

# Versioning

This library follows [meanver](https://meanver.org/) which basically means
[semver](https://semver.org/) along with a promise to rename when the major
version changes.

# License

vmodule is copyright [Tim Hatch](https://timhatch.com/), and licensed under
the MIT license. I am providing code in this repository to you under an open
source license. This is my personal repository; the license you receive to
my code is from me and not from my employer. See the `LICENSE` file for details.
the MIT license. See the `LICENSE` file for details.
31 changes: 11 additions & 20 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,23 @@ author_email = tim@timhatch.com

[options]
packages = find:
python_requires = >=3.7
python_requires = >=3.10
setup_requires =
setuptools_scm < 8; python_version<'3.8'
setuptools_scm >= 8; python_version>='3.8'
setuptools_scm >= 8
setuptools >= 65
include_package_data = true
install_requires =

[options.extras_require]
dev =
black == 23.12.1
checkdeps == 0.9.0
flake8 == 7.0.0
mypy == 1.8.0
tox == 4.12.1
twine == 4.0.2
ufmt == 2.3.0
usort == 1.0.7
wheel == 0.42.0
mypy == 1.19.1
ruff == 0.15.6
tox == 4.50.0
tox-uv == 1.33.4
test =
coverage >= 6
pytest >= 8

[options.entry_points]
# console_scripts =
Expand All @@ -42,8 +38,7 @@ strict = true

[coverage:run]
branch = True
include = vmodule/*
omit = vmodule/tests/*
source = vmodule,tests

[coverage:report]
fail_under = 90
Expand All @@ -55,13 +50,12 @@ skip_covered = True
ignore_missing_imports = True

[tox:tox]
envlist = py{37,38,39,310,311,312}, coverage
envlist = py{310,311,312,313,314}, coverage

[testenv]
deps = .[test]
allowlist_externals = make
commands =
make test
coverage run -m pytest
setenv =
COVERAGE_FILE={toxworkdir}/.coverage.{envname}

Expand All @@ -73,8 +67,5 @@ commands =
coverage combine
coverage report
depends =
py{37,38,39,310,311,312}
py{10,311,312,313,314}

[flake8]
ignore = E203, E231, E266, E302, E501, W503
max-line-length = 88
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from setuptools import setup

setup(use_scm_version=True)
setup(use_scm_version={"write_to": "vmodule/_version.py"})
Empty file added tests/conftest.py
Empty file.
File renamed without changes.
4 changes: 2 additions & 2 deletions vmodule/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
try:
from .version import __version__
except ImportError:
from ._version import __version__
except ImportError: # pragma: no cover
__version__ = "dev"

import logging
Expand Down
5 changes: 0 additions & 5 deletions vmodule/tests/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions vmodule/tests/__main__.py

This file was deleted.

Loading