diff --git a/python/pyproject.toml b/python/pyproject.toml index f172780..706778e 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -74,6 +74,7 @@ dev = [ "setuptools", "types-appdirs", "types-colorama", + "types-setuptools", "types-tqdm", ] @@ -88,50 +89,21 @@ line-length = 100 extend-select = ["I"] [tool.dev-cmd.commands] -clean = [ - "python", - "-c", - """\ -import os -import shutil -import sys - -import colors - - -# The MyPy cache can get corrupted by swithing Pythons with `uv ... --python ...' and re-building -# the .venv is cheap; so we clean these as a more restricted form than `git clean -fdx` -for cache_dir in '.mypy_cache', '.venv': - if os.path.exists(cache_dir): - shutil.rmtree(cache_dir, ignore_errors=True) - print(colors.green(f"Removed directory `{cache_dir}`."), file=sys.stderr) - """ -] - fmt = ["ruff", "format"] check-fmt = ["ruff", "format", "--diff"] lint = ["ruff", "check", "--fix"] check-lint = ["ruff", "check"] -type-check = ["mypy", "insta_science", "scripts", "test-support", "tests"] -type-check-38 = [ - "mypy", "--python-version", "3.8", "insta_science", "scripts", "test-support", "tests" -] -type-check-39 = [ - "mypy", "--python-version", "3.9", "insta_science", "scripts", "test-support", "tests" -] -type-check-310 = [ - "mypy", "--python-version", "3.10", "insta_science", "scripts", "test-support", "tests" -] -type-check-311 = [ - "mypy", "--python-version", "3.11", "insta_science", "scripts", "test-support", "tests" -] -type-check-312 = [ - "mypy", "--python-version", "3.12", "insta_science", "scripts", "test-support", "tests" -] -type-check-313 = [ - "mypy", "--python-version", "3.13", "insta_science", "scripts", "test-support", "tests" +type-check = [ + "mypy", + "--python-version", "{-py:{markers.python_version}}", + "--cache-dir", ".mypy_cache_{markers.python_version}", + "setup.py", + "insta_science", + "scripts", + "test-support", + "tests", ] [tool.dev-cmd.commands.release] @@ -148,15 +120,8 @@ accepts-extra-args = true checks = [ "fmt", "lint", - [ - "type-check-38", - "type-check-39", - "type-check-310", - "type-check-311", - "type-check-312", - "type-check-313", - ], - "test" + ["type-check-py3.{8..13}"], + "test", ] ci = [["check-fmt", "check-lint", "type-check"], "test"] diff --git a/python/setup.py b/python/setup.py index f47fbcc..d94ea9a 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,6 +1,8 @@ # Copyright 2025 Science project contributors. # Licensed under the Apache License, Version 2.0 (see LICENSE). +from __future__ import annotations + import atexit import shutil import tempfile diff --git a/python/uv.lock b/python/uv.lock index 2b31020..d69f697 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -88,18 +88,19 @@ wheels = [ [[package]] name = "dev-cmd" -version = "0.11.1" +version = "0.12.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aioconsole" }, { name = "ansicolors" }, { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "packaging" }, { name = "tomli", marker = "python_full_version < '3.11'" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/71/05/9fd907b1ad956cd8979faa2e5bd00c4866c03e97b42172702c8f29dc0bc4/dev_cmd-0.11.1.tar.gz", hash = "sha256:4a9d30bb399b7cb6e1948c882ad883d54a6e8b77cb65f0c377220ccf7927ace3", size = 41158 } +sdist = { url = "https://files.pythonhosted.org/packages/de/a2/823d13b9e22cdf13c10374502af2112e0c0dd6b60a49acda2e2777471ada/dev_cmd-0.12.0.tar.gz", hash = "sha256:dc032b71eb812f4dcba36fa36df3b8a88a8b2d3eb84763fbd8e5081608421b9f", size = 38949 } wheels = [ - { url = "https://files.pythonhosted.org/packages/70/0f/c4c66db5807a9a1527982eebd4ba62a2f76efcc6fb8b7e9d2c63bc3b4cc2/dev_cmd-0.11.1-py3-none-any.whl", hash = "sha256:395f0ac099e8ec40736b3865602c809082b84bb28c9bd062fd06ba35e7b9954e", size = 27068 }, + { url = "https://files.pythonhosted.org/packages/70/49/698970311e1031492906d42f1add367ee17795d7403a9ec320eae0801f4e/dev_cmd-0.12.0-py3-none-any.whl", hash = "sha256:01e2eb3c7878246080fa17f4068db0c59a39a5d4375cf92cbc4070aea69624a5", size = 32469 }, ] [[package]] @@ -187,7 +188,6 @@ wheels = [ [[package]] name = "insta-science" -version = "0.5.0" source = { editable = "." } dependencies = [ { name = "ansicolors" }, @@ -214,6 +214,7 @@ dev = [ { name = "setuptools", version = "75.8.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9'" }, { name = "types-appdirs" }, { name = "types-colorama" }, + { name = "types-setuptools" }, { name = "types-tqdm" }, ] @@ -242,6 +243,7 @@ dev = [ { name = "setuptools" }, { name = "types-appdirs" }, { name = "types-colorama" }, + { name = "types-setuptools" }, { name = "types-tqdm" }, ] @@ -510,6 +512,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl", hash = "sha256:4195d62d6d3e043a4eaaf08ff8a62184584d2e8684e9d2aa178c7915a7da3747", size = 15836 }, ] +[[package]] +name = "types-setuptools" +version = "75.8.0.20250110" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f7/42/5713e90d4f9683f2301d900f33e4fc2405ad8ac224dda30f6cb7f4cd215b/types_setuptools-75.8.0.20250110.tar.gz", hash = "sha256:96f7ec8bbd6e0a54ea180d66ad68ad7a1d7954e7281a710ea2de75e355545271", size = 48185 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/a3/dbfd106751b11c728cec21cc62cbfe7ff7391b935c4b6e8f0bdc2e6fd541/types_setuptools-75.8.0.20250110-py3-none-any.whl", hash = "sha256:a9f12980bbf9bcdc23ecd80755789085bad6bfce4060c2275bc2b4ca9f2bc480", size = 71521 }, +] + [[package]] name = "types-tqdm" version = "4.67.0.20241221"