at master 1.2 kB view raw
1{ pythonOnBuildForHost, runCommand }: 2{ 3 dont-propagate-conflicting-deps = 4 let 5 # customize a package so that its store paths differs 6 mkConflict = pkg: pkg.overrideAttrs { some_modification = true; }; 7 # minimal pyproject.toml for the example project 8 pyprojectToml = builtins.toFile "pyproject.toml" '' 9 [project] 10 name = "my-project" 11 version = "1.0.0" 12 ''; 13 # the source of the example project 14 projectSource = runCommand "my-project-source" { } '' 15 mkdir -p $out/src/my_project 16 cp ${pyprojectToml} $out/pyproject.toml 17 touch $out/src/my_project/__init__.py 18 ''; 19 in 20 # this build must never triger conflicts 21 pythonOnBuildForHost.pkgs.buildPythonPackage { 22 pname = "dont-propagate-conflicting-deps"; 23 version = "0.0.0"; 24 src = projectSource; 25 pyproject = true; 26 dependencies = [ 27 # At least one dependency of `build` should be included here to 28 # keep the test meaningful 29 (mkConflict pythonOnBuildForHost.pkgs.tomli) 30 ]; 31 build-system = [ 32 # setuptools is also needed to build the example project 33 pythonOnBuildForHost.pkgs.setuptools 34 ]; 35 }; 36}