File tree Expand file tree Collapse file tree 6 files changed +72
-58
lines changed Expand file tree Collapse file tree 6 files changed +72
-58
lines changed Original file line number Diff line number Diff line change @@ -13,21 +13,21 @@ jobs:
1313 tests :
1414 runs-on : ubuntu-latest
1515 steps :
16- - uses : actions/checkout@v4
17- - uses : cachix/install-nix-action@v30
18- with :
19- extra_nix_config : |
20- access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
21- - run : nix build
22- - run : nix develop -c pytest -s .
16+ - uses : actions/checkout@v4
17+ - uses : cachix/install-nix-action@v30
18+ with :
19+ extra_nix_config : |
20+ access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
21+ - run : nix build
22+ - run : nix develop -c pytest -s .
2323 build-flake :
2424 runs-on : ubuntu-latest
2525 steps :
26- - uses : actions/checkout@v4
27- - uses : cachix/install-nix-action@v30
28- with :
29- extra_nix_config : |
30- access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
31- - name : List flake structure
32- run : nix flake show
33- - run : nix flake check -vL
26+ - uses : actions/checkout@v4
27+ - uses : cachix/install-nix-action@v30
28+ with :
29+ extra_nix_config : |
30+ access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
31+ - name : List flake structure
32+ run : nix flake show
33+ - run : nix flake check -vL
Original file line number Diff line number Diff line change @@ -18,16 +18,19 @@ python3.pkgs.buildPythonApplication {
1818 nativeBuildInputs = [ installShellFiles ] ++ lib . optional withAutocomplete python3 . pkgs . argcomplete ;
1919 propagatedBuildInputs = [ python3 . pkgs . argcomplete ] ;
2020
21- nativeCheckInputs = [
22- python3 . pkgs . setuptools
23- python3 . pkgs . pylint
24- glibcLocales
21+ nativeCheckInputs =
22+ [
23+ python3 . pkgs . setuptools
24+ python3 . pkgs . pylint
25+ glibcLocales
2526
26- # needed for interactive unittests
27- python3 . pkgs . pytest
28- pkgs . nixVersions . stable or nix_2_4
29- git
30- ] ++ lib . optional withSandboxSupport bubblewrap ++ lib . optional withNom' nix-output-monitor ;
27+ # needed for interactive unittests
28+ python3 . pkgs . pytest
29+ pkgs . nixVersions . stable or nix_2_4
30+ git
31+ ]
32+ ++ lib . optional withSandboxSupport bubblewrap
33+ ++ lib . optional withNom' nix-output-monitor ;
3134
3235 checkPhase = ''
3336 echo -e "\x1b[32m## run nixpkgs-review --help\x1b[0m"
@@ -36,10 +39,13 @@ python3.pkgs.buildPythonApplication {
3639 '' ;
3740 makeWrapperArgs =
3841 let
39- binPath = [
40- pkgs . nixVersions . stable or nix_2_4
41- git
42- ] ++ lib . optional withSandboxSupport bubblewrap ++ lib . optional withNom' nix-output-monitor ;
42+ binPath =
43+ [
44+ pkgs . nixVersions . stable or nix_2_4
45+ git
46+ ]
47+ ++ lib . optional withSandboxSupport bubblewrap
48+ ++ lib . optional withNom' nix-output-monitor ;
4349 in
4450 [
4551 "--prefix PATH : ${ lib . makeBinPath binPath } "
Original file line number Diff line number Diff line change 11import argparse
2+ import string
23from dataclasses import dataclass , field
34from datetime import datetime
45from typing import Any
89
910
1011def comments_query (pr : int ) -> str :
11- return """
12+ return string . Template ( """
1213{
1314 repository(owner: "NixOS", name: "nixpkgs") {
14- pullRequest(number: %d ) {
15+ pullRequest(number: $pr ) {
1516 author { login }
1617 body
1718 createdAt
@@ -46,7 +47,7 @@ def comments_query(pr: int) -> str:
4647 }
4748 }
4849}
49- """ % ( pr )
50+ """ ). substitute ( pr = pr )
5051
5152
5253@dataclass
Original file line number Diff line number Diff line change @@ -60,9 +60,10 @@ def pr_command(args: argparse.Namespace) -> str:
6060 allow = AllowedFeatures (args .allow )
6161
6262 builddir = None
63- with Buildenv (
64- allow .aliases , args .extra_nixpkgs_config
65- ) as nixpkgs_config , ExitStack () as stack :
63+ with (
64+ Buildenv (allow .aliases , args .extra_nixpkgs_config ) as nixpkgs_config ,
65+ ExitStack () as stack ,
66+ ):
6667 review = None
6768 for pr in prs :
6869 builddir = stack .enter_context (Builddir (f"pr-{ pr } " ))
Original file line number Diff line number Diff line change 1- { lib , inputs , ... } :
1+ {
2+ inputs ,
3+ ...
4+ } :
25{
36 imports = [
47 inputs . treefmt-nix . flakeModule
1114 # Used to find the project root
1215 projectRootFile = "flake.lock" ;
1316
14- programs . deno . enable =
15- pkgs . lib . meta . availableOn pkgs . stdenv . hostPlatform pkgs . deno && ! pkgs . deno . meta . broken ;
16- programs . ruff . format = true ;
17- programs . ruff . check = true ;
18- programs . mypy . enable = true ;
19- programs . nixfmt . enable = pkgs . lib . meta . availableOn pkgs . stdenv . buildPlatform pkgs . nixfmt-rfc-style . compiler ;
20- programs . deadnix . enable = true ;
21-
22- programs . mypy . directories = {
23- "." = {
24- directory = "." ;
25- extraPythonPackages = [
26- pkgs . python3 . pkgs . pytest
27- ] ;
17+ programs = {
18+ deno . enable =
19+ pkgs . lib . meta . availableOn pkgs . stdenv . hostPlatform pkgs . deno && ! pkgs . deno . meta . broken ;
20+ ruff = {
21+ format = true ;
22+ check = true ;
23+ } ;
24+ mypy . enable = true ;
25+ nixfmt . enable = pkgs . lib . meta . availableOn pkgs . stdenv . buildPlatform pkgs . nixfmt-rfc-style . compiler ;
26+ deadnix . enable = true ;
27+ mypy . directories = {
28+ "." = {
29+ directory = "." ;
30+ extraPythonPackages = [
31+ pkgs . python3Packages . pytest
32+ ] ;
33+ } ;
2834 } ;
2935 } ;
3036 } ;
You can’t perform that action at this time.
0 commit comments