Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/dot-config/dependencies-ab7c4…
Browse files Browse the repository at this point in the history
…c4e5b
  • Loading branch information
ssbarnea authored Sep 3, 2024
2 parents 5d9b2a7 + 6872ba0 commit 1dbe39c
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
pypi:
name: Publish to PyPI registry
environment: release
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
id-token: write

Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ env:
jobs:
prepare:
name: prepare
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: Determine matrix
id: generate_matrix
uses: coactions/dynamic-matrix@v1
uses: coactions/dynamic-matrix@v3
with:
min_python: "3.10"
default_python: "3.10"
Expand All @@ -41,7 +41,7 @@ jobs:
platforms: linux,macos
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
needs:
- prepare
defaults:
Expand Down Expand Up @@ -81,18 +81,25 @@ jobs:
- name: Log installed dists
run: python3 -m pip freeze --all

- name: Initialize tox envs ${{ matrix.passed_name }}
run: python3 -m tox --notest --skip-missing-interpreters false -vv -e ${{ matrix.passed_name }}
timeout-minutes: 5 # average is under 1, but macos can be over 3
- run: ${{ matrix.command }}

# sequential run improves browsing experience (almost no speed impact)
- name: tox -e ${{ matrix.passed_name }}
run: python3 -m tox -e ${{ matrix.passed_name }}
- run: ${{ matrix.command2 }}
if: ${{ matrix.command2 }}

- run: ${{ matrix.command3 }}
if: ${{ matrix.command3 }}

- run: ${{ matrix.command4 }}
if: ${{ matrix.command4 }}

- run: ${{ matrix.command5 }}
if: ${{ matrix.command5 }}

- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.name }}.zip
include-hidden-files: true
path: |
.tox/**/log/
.tox/**/.coverage*
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ci:
- deps
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
rev: v0.6.3
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.2
rev: v3.3.3
hooks:
- id: prettier
always_run: true
Expand All @@ -21,7 +21,7 @@ repos:
- prettier-plugin-toml
- prettier-plugin-sort-json
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.8.2
rev: v8.13.3
hooks:
- id: cspell
# entry: codespell --relative
Expand All @@ -32,7 +32,7 @@ repos:
hooks:
- id: markdownlint
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
args:
Expand All @@ -49,7 +49,7 @@ repos:
- id: debug-statements
language_version: python3
- repo: https://github.com/ansible/ansible-lint
rev: v24.6.0
rev: v24.7.0
hooks:
- id: ansible-lint
args: [--fix]
Expand All @@ -63,7 +63,7 @@ repos:
- yaml
entry: yamllint --strict
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.11.2
hooks:
- id: mypy
args: [--python-version, "3.10"]
Expand All @@ -79,7 +79,7 @@ repos:
- typer-config
- typer>=0.12.2
- repo: https://github.com/pycqa/pylint
rev: v3.2.3
rev: v3.2.7
hooks:
- id: pylint
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mkdocs:
configuration: mkdocs.yml

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.11"
commands:
Expand Down
3 changes: 3 additions & 0 deletions samples/integration/ansible-lint.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
alerts
build
docs
drafts
eco
generate_docs
get-version
Expand All @@ -11,6 +13,7 @@ lint2
lower
pkg
pre
prs
py
py-devel
schemas
Expand Down
4 changes: 3 additions & 1 deletion samples/integration/cookiecutter.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
alerts
build
clean-build
clean-coverage
Expand All @@ -8,14 +9,15 @@ clean-tox
coverage
docs
docs2
drafts
install
lint
lint2
lint23
prs
py310
py311
py312
py37
py38
py39
release
Expand Down
3 changes: 3 additions & 0 deletions samples/integration/flask-babel.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
alerts
build
drafts
install
prs
uninstall
3 changes: 3 additions & 0 deletions samples/integration/nox.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
alerts
build
conda_tests
cover
docs
drafts
install
lint
lint2
prs
test
tests(python='3.10', tox_version='<4')
tests(python='3.10', tox_version='latest')
Expand Down
3 changes: 3 additions & 0 deletions samples/integration/podman.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
alerts
binaries
binaries2
binaries23
clean
clean-binaries
docs
drafts
help
install
lint
local-cross
podman-mac-helper
prs
rpm
rpm-install
test
3 changes: 3 additions & 0 deletions samples/integration/typeshed.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
alerts
create_baseline_stubs
drafts
generate_proto_stubs
lint
prs
sync_tensorflow_protobuf_stubs
10 changes: 5 additions & 5 deletions src/mk/pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from rich.panel import Panel
from typer_config.decorators import use_yaml_config

CFG_FILE = "~/.config/mk/mk.yml"
CFG_FILE = os.environ.get("MK_CONFIG_FILE", "~/.config/mk/mk.yml")


class TyperApp(typer.Typer):
Expand Down Expand Up @@ -46,10 +46,10 @@ def drafts() -> None:
"""Pre helps you chain releases on github."""
for repo in app.repos:
repo_link = f"[markdown.link][link=https://github.com/{repo}]{repo}[/][/]"
result = run(
result = run( # noqa: S602
f'gh api repos/{repo}/releases --jq "[.[] | select(.draft)"]',
text=True,
shell=True, # noqa: S602
shell=True,
capture_output=True,
check=True,
)
Expand Down Expand Up @@ -104,10 +104,10 @@ def alerts() -> None:
cmd = "GH_PAGER= gh "
cmd += f"api /repos/{repo}/dependabot/alerts"
cmd += " --jq='.[] | select(.state!=\"fixed\") | .html_url'"
result = run(
result = run( # noqa: S602
cmd,
text=True,
shell=True, # noqa: S602
shell=True,
capture_output=True,
check=False,
)
Expand Down
2 changes: 1 addition & 1 deletion src/mk/tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def actions(self) -> list[Action]:
msg = "Makefile not found"
raise RuntimeError(msg)
with open(self.makefile, encoding="utf-8") as file:
for line in file.readlines():
for line in file:
# Current implementation assumes that descriptions are added
# using double ## after the target name.
# Inspired by https://github.com/containers/podman/blob/master/Makefile#L127
Expand Down
14 changes: 7 additions & 7 deletions src/mk/tools/taskfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def __init__(self, path=".") -> None:

def is_present(self, path: Path) -> bool:
valid_taskfiles = [
"Taskfile.yml"
"taskfile.yml"
"Taskfile.yaml"
"taskfile.yaml"
"Taskfile.dist.yml"
"taskfile.dist.yml"
"Taskfile.dist.yaml"
"Taskfile.yml",
"taskfile.yml",
"Taskfile.yaml",
"taskfile.yaml",
"Taskfile.dist.yml",
"taskfile.dist.yml",
"Taskfile.dist.yaml",
"taskfile.dist.yaml",
]

Expand Down
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{envdir}/.coverage.{envname}}
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
FORCE_COLOR = 1
# To ensure test execution is not affected by user config.
MK_CONFIG_FILE = /dev/null
PIP_CONSTRAINT = {toxinidir}/.config/constraints.txt
PIP_DISABLE_PIP_VERSION_CHECK = 1
PRE_COMMIT_COLOR = always
Expand Down Expand Up @@ -125,8 +127,9 @@ commands =
[testenv:integration]
description = Run integrations tests
setenv =
ANSIBLE_NOCOWS=1
ANSIBLE_FORCE_COLOR=1
ANSIBLE_FORCE_COLOR = 1
ANSIBLE_NOCOWS = 1
MK_CONFIG_FILE = /dev/null
extras =
test
deps =
Expand Down

0 comments on commit 1dbe39c

Please sign in to comment.