diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0ad2e0c..423d1f5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -65,7 +65,7 @@ jobs: - run: | mk python-release owner=vkottler \ - repo=vmklib version=1.10.3 + repo=vmklib version=1.10.4 if: | matrix.python-version == '3.11' && matrix.system == 'ubuntu-latest' diff --git a/.gitignore b/.gitignore index 0ddd92b..ef25f89 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ htmlcov *-stubs coverage*.xml tags +mklocal diff --git a/README.md b/README.md index c1ee416..7a63dc5 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ===================================== generator=datazen version=3.1.2 - hash=97f1a2d2203d25f22ea8befdad7b7a6c + hash=807b9e61be8129dc4eec45349011d181 ===================================== --> -# vmklib ([1.10.3](https://pypi.org/project/vmklib/)) +# vmklib ([1.10.4](https://pypi.org/project/vmklib/)) [![python](https://img.shields.io/pypi/pyversions/vmklib.svg)](https://pypi.org/project/vmklib/) ![Build Status](https://github.com/vkottler/vmklib/workflows/Python%20Package/badge.svg) diff --git a/config b/config index 05d7c89..cebb553 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 05d7c8970b0aa34d7dd31144225f975e7f63d233 +Subproject commit cebb5539075f4f7427002be992b09051bd64645a diff --git a/local/variables/package.yaml b/local/variables/package.yaml index 48b6f1c..5c349c1 100644 --- a/local/variables/package.yaml +++ b/local/variables/package.yaml @@ -1,5 +1,5 @@ --- major: 1 minor: 10 -patch: 3 +patch: 4 entry: mk diff --git a/pyproject.toml b/pyproject.toml index ea5a857..ddf220f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__" [project] name = "vmklib" -version = "1.10.3" +version = "1.10.4" description = "Simplify project workflows by standardizing use of GNU Make." readme = "README.md" requires-python = ">=3.8" @@ -44,6 +44,8 @@ test = [ "mypy", "isort", "yamllint", + "yambs", + "vmklib", "pytest-asyncio", "setuptools-wrapper" ] diff --git a/tasks/conf.py b/tasks/conf.py index c4dc943..c03d36d 100644 --- a/tasks/conf.py +++ b/tasks/conf.py @@ -1,15 +1,52 @@ +# ===================================== +# generator=datazen +# version=3.1.2 +# hash=9f62028523c3b5a953733ca89dcc3018 +# ===================================== """ A module for project-specific task registration. """ # built-in from pathlib import Path +from subprocess import run from typing import Dict # third-party -from vcorelib.task import Phony from vcorelib.task.manager import TaskManager -from vcorelib.task.subprocess.run import is_windows + + +def audit_local_tasks() -> None: + """Ensure that shared task infrastructure is present.""" + + local = Path(__file__).parent.joinpath("mklocal") + + # Also link a top-level file. + top_level = local.parent.parent.joinpath("mklocal") + if not top_level.is_symlink(): + assert not top_level.exists() + top_level.symlink_to(local) + + if local.is_symlink(): + return + + # If it's not a symlink, it shouldn't be any other kind of file. + assert not local.exists() + + # Ensure sub-module implementation is present. + config = local.parent.parent.joinpath("config") + assert config.is_dir() + + # Initialize submodules if we don't see the directory we're looking for. + vmklib = config.joinpath("python", "mklocal") + if not vmklib.is_dir(): + run( + ["git", "-C", str(config.parent), "submodule", "update", "--init"], + check=True, + ) + + # Create the link. + local.symlink_to(vmklib) def register( @@ -20,12 +57,10 @@ def register( ) -> bool: """Register project tasks to the manager.""" - # Don't run yamllint on Windows because it will fail on newlines. - manager.register( - Phony("yaml"), - [] if is_windows() else ["yaml-lint-local", "yaml-lint-manifest.yaml"], + audit_local_tasks() + + from mklocal.python import ( # pylint: disable=import-outside-toplevel + register_python, ) - del project - del cwd - del substitutions - return True + + return register_python(manager, project, cwd, substitutions) diff --git a/vmklib/__init__.py b/vmklib/__init__.py index 9a13d30..6eff456 100644 --- a/vmklib/__init__.py +++ b/vmklib/__init__.py @@ -1,7 +1,7 @@ # ===================================== # generator=datazen # version=3.1.2 -# hash=088bb07ad9cbed56c9ff6946182d6ef9 +# hash=85cd3a6aa7fb306ea62529e095aff22a # ===================================== """ @@ -10,4 +10,4 @@ DESCRIPTION = "Simplify project workflows by standardizing use of GNU Make." PKG_NAME = "vmklib" -VERSION = "1.10.3" +VERSION = "1.10.4" diff --git a/vmklib/dev_requirements.txt b/vmklib/dev_requirements.txt index 06010d3..8011bc6 100644 --- a/vmklib/dev_requirements.txt +++ b/vmklib/dev_requirements.txt @@ -5,5 +5,7 @@ ruff mypy isort yamllint +yambs +vmklib pytest-asyncio setuptools-wrapper diff --git a/vmklib/tasks/python/lint.py b/vmklib/tasks/python/lint.py index 144b537..7181357 100644 --- a/vmklib/tasks/python/lint.py +++ b/vmklib/tasks/python/lint.py @@ -7,6 +7,7 @@ from typing import Dict, List # third-party +from vcorelib.platform import is_windows from vcorelib.task import Inbox, Outbox, Phony from vcorelib.task.manager import TaskManager from vcorelib.task.subprocess.run import SubprocessLogMixin @@ -30,9 +31,15 @@ def source_args(cwd: Path, project: str, **kwargs) -> List[str]: sources = [ cwd.joinpath("tests"), cwd.joinpath(project), - cwd.joinpath("tasks"), cwd.joinpath("setup.py"), ] + + # This breaks on Windows because of symbolic linking. It's okay + # to lose the linting coverage for the not-unit-tested workflow + # code. + if not is_windows(): + sources.append(cwd.joinpath("tasks")) + return list(str(x) for x in filter(lambda x: x.exists(), sources)) async def run(self, inbox: Inbox, outbox: Outbox, *args, **kwargs) -> bool: