Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.10.4 - Disable some Windows linting #77

Merged
merged 1 commit into from
Aug 3, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ htmlcov
*-stubs
coverage*.xml
tags
mklocal
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion local/variables/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
major: 1
minor: 10
patch: 3
patch: 4
entry: mk
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -44,6 +44,8 @@ test = [
"mypy",
"isort",
"yamllint",
"yambs",
"vmklib",
"pytest-asyncio",
"setuptools-wrapper"
]
Expand Down
55 changes: 45 additions & 10 deletions tasks/conf.py
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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)
4 changes: 2 additions & 2 deletions vmklib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =====================================
# generator=datazen
# version=3.1.2
# hash=088bb07ad9cbed56c9ff6946182d6ef9
# hash=85cd3a6aa7fb306ea62529e095aff22a
# =====================================

"""
Expand All @@ -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"
2 changes: 2 additions & 0 deletions vmklib/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ ruff
mypy
isort
yamllint
yambs
vmklib
pytest-asyncio
setuptools-wrapper
9 changes: 8 additions & 1 deletion vmklib/tasks/python/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
Loading