Skip to content

Commit

Permalink
Merge staging-next into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 22, 2024
2 parents dff1c46 + f197f54 commit 4685474
Show file tree
Hide file tree
Showing 148 changed files with 1,866 additions and 4,145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-nixf-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
echo "$errors"
else
# just print in plain text
echo "$errors" | sed 's/^:://'
echo "${errors/::/}"
echo # add one empty line
fi
failedFiles+=("$dest")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/editorconfig-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz
- name: Checking EditorConfig
run: |
cat "$HOME/changed_files" | nix-shell -p editorconfig-checker --run 'xargs -r editorconfig-checker -disable-indent-size'
< "$HOME/changed_files" nix-shell -p editorconfig-checker --run 'xargs -r editorconfig-checker -disable-indent-size'
- if: ${{ failure() }}
run: |
echo "::error :: Hey! It looks like your changes don't follow our editorconfig settings. Read https://editorconfig.org/#download to configure your editor so you never see this error again."
7 changes: 7 additions & 0 deletions .github/workflows/lint-actions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash actionlint shellcheck -I nixpkgs=../..
set -euo pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR/../.."
actionlint
1 change: 1 addition & 0 deletions ci/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt

# PostgreSQL and related stuff
/pkgs/servers/sql/postgresql @NixOS/postgres
/pkgs/development/tools/rust/cargo-pgrx @NixOS/postgres
/nixos/modules/services/databases/postgresql.md @NixOS/postgres
/nixos/modules/services/databases/postgresql.nix @NixOS/postgres
/nixos/tests/postgresql @NixOS/postgres
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2505.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
After you run ALTER EXTENSION, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull requests [#6797](https://github.com/timescale/timescaledb/pull/6797).
PostgreSQL 13 is no longer supported in TimescaleDB v2.16.

- Support for CUDA 10 has been dropped, as announced in the 24.11 release notes.

- `kanata` was updated to v1.7.0, which introduces several breaking changes.
See the release notes of
[v1.7.0](https://github.com/jtroo/kanata/releases/tag/v1.7.0)
Expand Down
82 changes: 49 additions & 33 deletions nixos/lib/test-driver/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{ lib
, python3Packages
, enableOCR ? false
, qemu_pkg ? qemu_test
, coreutils
, imagemagick_light
, netpbm
, qemu_test
, socat
, ruff
, tesseract4
, vde2
, extraPythonPackages ? (_ : [])
, nixosTests
{
lib,
python3Packages,
enableOCR ? false,
qemu_pkg ? qemu_test,
coreutils,
imagemagick_light,
netpbm,
qemu_test,
socat,
ruff,
tesseract4,
vde2,
extraPythonPackages ? (_: [ ]),
nixosTests,
}:
let
fs = lib.fileset;
in
python3Packages.buildPythonApplication {
pname = "nixos-test-driver";
version = "1.1";
pyproject = true;

src = fs.toSource {
root = ./.;
fileset = fs.unions [
Expand All @@ -27,37 +30,50 @@ python3Packages.buildPythonApplication {
./extract-docstrings.py
];
};
pyproject = true;

propagatedBuildInputs = [
coreutils
netpbm
python3Packages.colorama
python3Packages.junit-xml
python3Packages.ptpython
qemu_pkg
socat
vde2
]
++ (lib.optionals enableOCR [ imagemagick_light tesseract4 ])
build-system = with python3Packages; [
setuptools
];

dependencies =
with python3Packages;
[
colorama
junit-xml
ptpython
]
++ extraPythonPackages python3Packages;

nativeBuildInputs = [
python3Packages.setuptools
];
propagatedBuildInputs =
[
coreutils
netpbm
qemu_pkg
socat
vde2
]
++ lib.optionals enableOCR [
imagemagick_light
tesseract4
];

passthru.tests = {
inherit (nixosTests.nixos-test-driver) driver-timeout;
};

doCheck = true;
nativeCheckInputs = with python3Packages; [ mypy ruff black ];

nativeCheckInputs = with python3Packages; [
mypy
ruff
];

checkPhase = ''
echo -e "\x1b[32m## run mypy\x1b[0m"
mypy test_driver extract-docstrings.py
echo -e "\x1b[32m## run ruff\x1b[0m"
echo -e "\x1b[32m## run ruff check\x1b[0m"
ruff check .
echo -e "\x1b[32m## run black\x1b[0m"
black --check --diff .
echo -e "\x1b[32m## run ruff format\x1b[0m"
ruff format --check --diff .
'';
}
6 changes: 1 addition & 5 deletions nixos/lib/test-driver/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ find = {}
test_driver = ["py.typed"]

[tool.ruff]
target-version = "py312"
line-length = 88

lint.select = ["E", "F", "I", "U", "N"]
Expand All @@ -35,11 +36,6 @@ ignore_missing_imports = true
module = "junit_xml.*"
ignore_missing_imports = true

[tool.black]
line-length = 88
target-version = ['py39']
include = '\.pyi?$'

[tool.mypy]
warn_redundant_casts = true
disallow_untyped_calls = true
Expand Down
27 changes: 14 additions & 13 deletions nixos/lib/test-driver/test_driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import signal
import tempfile
import threading
from contextlib import contextmanager
from collections.abc import Callable, Iterator
from contextlib import AbstractContextManager, contextmanager
from pathlib import Path
from typing import Any, Callable, ContextManager, Dict, Iterator, List, Optional, Union
from typing import Any

from colorama import Fore, Style

Expand Down Expand Up @@ -44,17 +45,17 @@ class Driver:
and runs the tests"""

tests: str
vlans: List[VLan]
machines: List[Machine]
polling_conditions: List[PollingCondition]
vlans: list[VLan]
machines: list[Machine]
polling_conditions: list[PollingCondition]
global_timeout: int
race_timer: threading.Timer
logger: AbstractLogger

def __init__(
self,
start_scripts: List[str],
vlans: List[int],
start_scripts: list[str],
vlans: list[int],
tests: str,
out_dir: Path,
logger: AbstractLogger,
Expand All @@ -73,7 +74,7 @@ def __init__(
vlans = list(set(vlans))
self.vlans = [VLan(nr, tmp_dir, self.logger) for nr in vlans]

def cmd(scripts: List[str]) -> Iterator[NixStartScript]:
def cmd(scripts: list[str]) -> Iterator[NixStartScript]:
for s in scripts:
yield NixStartScript(s)

Expand Down Expand Up @@ -119,7 +120,7 @@ def subtest(self, name: str) -> Iterator[None]:
self.logger.error(f'Test "{name}" failed with error: "{e}"')
raise e

def test_symbols(self) -> Dict[str, Any]:
def test_symbols(self) -> dict[str, Any]:
@contextmanager
def subtest(name: str) -> Iterator[None]:
return self.subtest(name)
Expand Down Expand Up @@ -207,7 +208,7 @@ def create_machine(
self,
start_command: str | dict,
*,
name: Optional[str] = None,
name: str | None = None,
keep_vm_state: bool = False,
) -> Machine:
tmp_dir = get_tmp_dir()
Expand Down Expand Up @@ -236,11 +237,11 @@ def check_polling_conditions(self) -> None:

def polling_condition(
self,
fun_: Optional[Callable] = None,
fun_: Callable | None = None,
*,
seconds_interval: float = 2.0,
description: Optional[str] = None,
) -> Union[Callable[[Callable], ContextManager], ContextManager]:
description: str | None = None,
) -> Callable[[Callable], AbstractContextManager] | AbstractContextManager:
driver = self

class Poll:
Expand Down
Loading

0 comments on commit 4685474

Please sign in to comment.