From 8af720732267ee07ba4451f9e5176ab4bc86104f Mon Sep 17 00:00:00 2001 From: jacek szymanski Date: Mon, 27 May 2024 15:41:26 +0200 Subject: [PATCH 1/2] chore: update flake (old python3.8 caused infinite recursion) --- flake.lock | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 9917bc9..b9bb3d4 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1622445595, - "narHash": "sha256-m+JRe6Wc5OZ/mKw2bB3+Tl0ZbtyxxxfnAWln8Q5qs+Y=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "7d706970d94bc5559077eb1a6600afddcd25a7c8", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -17,11 +20,12 @@ }, "nixpkgs": { "locked": { - "lastModified": 1622282707, - "narHash": "sha256-+GOrUDsdneUqrOm9d+9bHXjEVoVcU8tm14WGVzbt6gg=", - "path": "/nix/store/9za793c35j4rnawwf2n2wpbwwnah1rq9-source", - "rev": "6933d068c5d2fcff398e802f7c4e271bbdab6705", - "type": "path" + "lastModified": 1716361217, + "narHash": "sha256-mzZDr00WUiUXVm1ujBVv6A0qRd8okaITyUp4ezYRgc4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "46397778ef1f73414b03ed553a3368f0e7e33c2f", + "type": "github" }, "original": { "id": "nixpkgs", @@ -33,6 +37,21 @@ "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", From 392b78e83d1ab5101920187cc4f02b4667aa8b4e Mon Sep 17 00:00:00 2001 From: jacek szymanski Date: Mon, 27 May 2024 19:31:58 +0200 Subject: [PATCH 2/2] fix: update flake, pyproject.toml to work with current poetry2nix via flake --- flake.lock | 86 +++++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 14 ++++++-- pyproject.toml | 4 +-- 3 files changed, 99 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index b9bb3d4..978ca5f 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,27 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703863825, + "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1716361217, @@ -32,10 +53,38 @@ "type": "indirect" } }, + "poetry2nix": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1715251496, + "narHash": "sha256-vRBfJCKvJtu5sYev56XStirA3lAOPv0EkoEV2Nfc+tc=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "291a863e866972f356967d0a270b259f46bf987f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "2024.5.939250", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "poetry2nix": "poetry2nix" } }, "systems": { @@ -52,6 +101,41 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715940852, + "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 00d649b..45eb867 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,22 @@ { inputs = { flake-utils.url = "github:numtide/flake-utils"; + poetry2nix = { + url = "github:nix-community/poetry2nix/2024.5.939250"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; }; - outputs = { self, flake-utils, nixpkgs }: (flake-utils.lib.eachDefaultSystem ( + outputs = { self, flake-utils, nixpkgs, ... }@inputs: (flake-utils.lib.eachDefaultSystem ( system: let - pkgs = nixpkgs.legacyPackages.${system}; + pkgs = import nixpkgs { + inherit system; + config.packageOverrides = _: { + poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }; + }; + }; openconnect-sso = (import ./nix { inherit pkgs; }).openconnect-sso; in { diff --git a/pyproject.toml b/pyproject.toml index f349a97..8607513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,5 +49,5 @@ pytest-httpserver = "^1.0" target-version = ['py36', 'py37', 'py38'] [build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"