I have a flake (A) which contains
packages = {
pythonPackage = python.pkgs.buildPythonPackage {
pname = "my-python-lib";
format = "pyproject";
version = "1.2";
propagatedBuildInputs = with python.pkgs; [
setuptools
];
src = ./.;
};
};
And a flake (B) which has (A) as input and the following
...
my-python-lib = inputs.my-python-lib.packages.${system}.pythonPackage;
...
packages = {
pythonPackage = python.pkgs.buildPythonPackage {
pname = "my-python-app";
format = "pyproject";
version = "1.0";
propagatedBuildInputs = with python.pkgs; [
my-python-lib
setuptools
];
src = ./.;
};
};
However, building pythonPackage
flake (B) results in an error:
error: Python version mismatch in 'python3.12-my-python-app-1.0': The Python derivation 'python3.12-my-python-app-1.0' depends on a Python derivation named 'python3.12-my-python-lib-1.2', but the two derivations use different versions of Python: 'python3.12-my-python-app-1.0' uses /nix/store/kjvgj2n3yn70hmjifg6y0bk9m4rf7jba-python3-3.12.10 'python3.12-my-python-lib-1.2' uses /nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9
I think the python version should not important since both projects only contain pure python files. Looking into the derivation of my-python-lib
, all python files are there.
Both pyproject.toml
have only requires-python = ">=3.12"
in it.
Why do the derivations “depend” on the specific python versions? What should I do?