Closed allgreed closed 6 months ago
I guess that's totally up to you @allgreed :) None of us currently use nix env in our workflow but being present in this field is a good thing right now. Even Hashicorp started actively delving into nix recently.
Sure, I've assigned myself. But if anyone else has bandwidth and desire to deal with this before I do feel free to ping me ;)
Packaging the release binary works ok, but this should stay open as the binary releases are a half-measure ;c
Following expression works, with the caveats described below:
let
nixpkgs = builtins.fetchGit {
url = "https://github.com/nixos/nixpkgs/";
ref = "refs/heads/nixos-unstable";
rev = "e10da1c7f542515b609f8dfbcf788f3d85b14936";
# obtain via `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable`
# 27-04-2022
};
pkgs = import nixpkgs { config = {}; };
pythonCore = pkgs.python38;
myAppEnv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
python = pythonCore;
overrides = with pkgs; poetry2nix.overrides.withDefaults (self: super: {
cryptography = super.cryptography.overridePythonAttrs(old:{
cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
inherit (old) src;
name = "${old.pname}-${old.version}";
sourceRoot = "${old.pname}-${old.version}/src/rust/";
sha256 = "sha256:01h511h6l4qvjxbaw662m1l84pb4wrhwxmnb3qj6ik13mx2m477m";
};
cargoRoot = "src/rust";
nativeBuildInputs = old.nativeBuildInputs ++ (with pkgs.rustPlatform; [
rust.rustc
rust.cargo
cargoSetupHook
]);
});
pyparsing = super.pyparsing.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [
self.flit-core
];
});
});
#editablePackageSources = {
#my-app = ./dtcli;
#};
};
in myAppEnv.env
Following steps need to be taken:
From c4f2a6c923e7af97932d9e2f6758abdacfae6dab Mon Sep 17 00:00:00 2001
From: "Olgierd \"Allgreed\" Kasprowicz" <olgierd.kasprowicz@dynatrace.com>
Date: Mon, 2 May 2022 20:30:13 +0200
Subject: [PATCH] ble---
pyproject.toml | 2 --
1 file changed, 2 deletions(-)diff --git a/pyproject.toml b/pyproject.toml
index 4f57912..ff9d3b0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -35,10 +35,8 @@ flake8-comprehensions = "^3.4.0"
flake8-docstrings = "^1.6.0"
flake8-import-order = "^0.18.1"
flake8-polyfill = "^1.0.2"
-ipython = "^7.22.0"
mypy = "^0.812"
pydocstyle = "^6.0.0"
-pyinstaller = "^4.3"
pytest = "^5.2"
pytest-black = "^0.3.12"
pytest-cov = "^2.11.1"
--
2.25.1
Following commands ran:
python -m venv env
. env/bin/activate
pip install poetry
poetry lock
So basically it works when we remove those 2 dev dependencies and regenerate the lock.
Closing as this is out of scope now
I'd love to use this tool as much as possible with the internal workflow, however, for that I'd need this package to be buildable with nix.
There is some PR #1 , however I was just trying to hack something quickly, clearly, as mentioned by @wbachnik we need to do better than that.
AC:
Follow up ACs (probably worth splitting, but not sure):
Potential low hanging fruits after this issue:
Potentially useful + thoughs:
Current downstream, working nix expression: