-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add parameter to ignore collisions possible ? #24
Comments
Hey, Basically Though I cannot reproduce your collision. I couldn't find any package named "sorts" If you find that any list of requirements produces a collision, then this is a potential bug in either mach-nix, nixpkgs, or the package itself. Please file an issue here in this case, and we will see how to proceed. |
Thanks @DavHau, indeed I get the collision error as well when adding the override as you wrote (snippet, list of requirements as above):
|
Could you provide the requirements which cause the collision, so I have a better chance debugging it? |
The ~/.config/nixpkgs/program/python/default.nix I am using in home.nix (
Getting:
|
OK, I think I get the problem now. You are trying to mix two different python environments. The First of all, it is not really necessary to manually mix python packages from nixpkgs into mach-nix. All python packages from nixpkgs are available to mach-nix already, just put them into the requirements of mach-nix like this: let
pkgs = import <unstable>;
myMachnix =
let
mach-nix = import (builtins.fetchGit {
url = "https://github.com/DavHau/mach-nix/";
ref = "2.0.0";
});
in
mach-nix.mkPython {
disable_checks = true;
requirements = ''
notebook
pyls-mypy
pyls-isort
pyls-black
'';
providers = {
# python-jsonrpc-server seems to cause a strange bug when installing from pypi.
# We change its provider to nixpkgs
python-jsonrpc-server = "nixpkgs";
};
};
in
myMachnix If you really need to mix two environments, then you could use the lower level mach nix function let
pkgs = import <unstable> {};
machnix_src = builtins.fetchGit {
url = "https://github.com/DavHau/mach-nix/";
ref = "2.0.0";
};
machnix = import machnix_src;
autoPatchelfHook = import "${machnix_src}/mach_nix/nix/auto_patchelf_hook.nix" {inherit (pkgs) fetchurl makeSetupHook writeText;};
result = machnix.machNix {
requirements = ''
notebook
'';
python = pkgs.python3;
};
overrides_machnix = result.overrides pkgs.pythonManylinuxPackages.manylinux1 pkgs.autoPatchelfHook;
my_python = pkgs.python3.override {
packageOverrides = overrides_machnix;
};
in
my_python.withPackages (ps: with ps; (result.select_pkgs ps) ++ [
python-language-server
pyls-mypy
pyls-isort
pyls-black
]) EDIT: Another bug prevents prevents this from working: #27 |
Some of the checks despite setting |
I think I got your example now:
is working no problems. |
Hi,
this project is amazing, thanks for sharing it.
I wonder if I could add nix packages (
pyls-mypy
and sorts) when they cause collisions as inI hoped something along the lines (snippet incomplete) of
would do. But it seems I had to add the override to myMachnix as well. I just don't know how to do that.
The text was updated successfully, but these errors were encountered: