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

flake.lock: Update #415

Merged
merged 2 commits into from
Nov 15, 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
128 changes: 121 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
Expand Down
1 change: 1 addition & 0 deletions testing/python/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use_repo(non_module_deps, "nixpkgs")
use_repo(non_module_deps, "nixpkgs_python_toolchain")
use_repo(non_module_deps, "nixpkgs_python_configure_test")
use_repo(non_module_deps, "nixpkgs_python_toolchain_python3")
use_repo(non_module_deps, "poetry2nix")
register_toolchains("@nixpkgs_python_toolchain//:all")

use_repo(non_module_deps, "generated_poetry_packages_deps")
Expand Down
5 changes: 3 additions & 2 deletions testing/python/poetry.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
let
nixpkgs = import <nixpkgs> {};
inherit (nixpkgs) lib poetry2nix python3 runCommand;
nixpkgs = import <nixpkgs> { };
poetry2nix = import <poetry2nix> { pkgs = nixpkgs; };
inherit (nixpkgs) python3;

args = {
python = python3;
Expand Down
12 changes: 12 additions & 0 deletions testing/python/poetry2nix.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
poetry2nix =
let
src = lock.nodes.poetry2nix.locked;
in
assert src.type == "github";
fetchTarball {
url = "https://github.com/${src.owner}/${src.repo}/archive/${src.rev}.tar.gz";
sha256 = src.narHash;
};
in import poetry2nix
11 changes: 10 additions & 1 deletion testing/python/tests/nixpkgs_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def nixpkgs_repositories(*, bzlmod):
nix_file_deps = ["//:flake.lock"],
)

nixpkgs_local_repository(
name = "poetry2nix",
nix_file = "//:poetry2nix.nix",
nix_file_deps = ["//:flake.lock"],
)

# Tests implicitly depend on Java
nixpkgs_java_configure(
name = "nixpkgs_java_runtime",
Expand Down Expand Up @@ -43,7 +49,10 @@ def nixpkgs_repositories(*, bzlmod):

nixpkgs_python_repository(
name = "poetry_packages",
repository = "@nixpkgs",
repositories = {
"nixpkgs": "@nixpkgs",
"poetry2nix": "@poetry2nix",
},
nix_file = "//:poetry.nix",
nix_file_deps = [
"//:pyproject.toml",
Expand Down