Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0346b63
kupfer: fix build
FRidh Nov 3, 2020
a3546fc
pythonPackages: rename requiredPythonModules to computeRequiredPython…
FRidh Nov 2, 2020
6f845f7
WIP: Python: wrap and patch using `requiredPythonModules` instead of …
FRidh Nov 3, 2020
100bde9
treewide: buildPython*: use requiredPythonModules instead of propagat…
FRidh Nov 3, 2020
d212ce8
treewide: replace pythonPath with requiredPythonModules
FRidh Nov 3, 2020
72ad983
WIP treewide: replace pythonPath with requiredPythonModules (part 2)
FRidh Nov 3, 2020
1076686
diffoscope: add non-Python dependencies to PATH
FRidh Nov 3, 2020
f9463e3
pythonPackages.pygobject3: cairo is not a Python dep
FRidh Nov 3, 2020
d89fe1d
treewide: replace pythonPath for non-buildPython* packages
FRidh Nov 3, 2020
2bd1f6f
buildPythonPackage: warn if propagatedBuildInputs is used
FRidh Nov 7, 2020
cf30233
claws-mail: fix eval
FRidh Nov 7, 2020
c3ccb03
fixup: filter null
FRidh Nov 7, 2020
3be4af6
claws-mail-gtk3: fix eval
FRidh Nov 7, 2020
654c9fa
meson: don't remove propagated-build-inputs
FRidh Nov 7, 2020
e902845
gtk-doc: no need to clear Python from propagated-build-inputs anymore
FRidh Nov 8, 2020
911e3fd
Python: get rid of propagation altogether
FRidh Nov 8, 2020
1a9747c
treewide: further convert propagatedBuildInputs to requiredPythonModules
FRidh Nov 8, 2020
7ddbdff
fixup get rid of propagation altogether
FRidh Nov 10, 2020
702b962
python.pkgs.matplotlib: fix expression
FRidh Nov 10, 2020
3ddd951
python2.pkgs.pysqlite: fix expression
FRidh Nov 10, 2020
53803de
gtklick: fix expression
FRidh Nov 10, 2020
9f50f97
gtklick: fix expression
FRidh Nov 10, 2020
0b98236
mirage-im: fix evaluation
FRidh Nov 10, 2020
59f09ca
pythonPackages.cairocffi: fix expression
FRidh Nov 10, 2020
3c132e3
yle-dl: fix expression
FRidh Nov 10, 2020
5cbcd53
pythonPackages: revert to python as parameter
FRidh Nov 10, 2020
2d63a8c
pythonPackages.pendulum: remove unused parameter poetry
FRidh Nov 10, 2020
478ca41
pythonPackages.jsbeautifier: its in the package set, so buildPythonPa…
FRidh Nov 10, 2020
0502eae
fixup diffoscope
FRidh Nov 10, 2020
d6cf227
fixup buildPython*: enhance warning
FRidh Nov 10, 2020
ca69df7
python.pkgs.binwalk: fix expression
FRidh Nov 10, 2020
74e16e9
pythonPackages.hidapi: fix expression
FRidh Nov 10, 2020
8f5c223
libvirt: use python3 as nativeBuildInput
FRidh Nov 11, 2020
9489646
pythonPackages.pyscard: wrap non-Python executables
FRidh Nov 11, 2020
b7ae8be
pythonPackages.trezor: fix buildInputs
FRidh Nov 11, 2020
a7bc5e8
pythonPackages.gst-python: fix buildInputs
FRidh Nov 11, 2020
90835a3
pythonPackages.pyparted: fix buildInputs
FRidh Nov 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
26 changes: 12 additions & 14 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ that we introduced with the `let` expression.

Our example, `toolz`, does not have any dependencies on other Python packages or
system libraries. According to the manual, `buildPythonPackage` uses the
arguments `buildInputs` and `propagatedBuildInputs` to specify dependencies. If
arguments `buildInputs` and `requiredPythonModules` to specify dependencies. If
something is exclusively a build-time dependency, then the dependency should be
included in `buildInputs`, but if it is (also) a runtime dependency, then it
should be added to `propagatedBuildInputs`. Test dependencies are considered
should be added to `requiredPythonModules`. Test dependencies are considered
build-time dependencies and passed to `checkInputs`.

The following example shows which arguments are given to `buildPythonPackage` in
Expand All @@ -450,7 +450,7 @@ buildPythonPackage rec {
};

checkInputs = [ pytest ];
propagatedBuildInputs = [ numpy multipledispatch dateutil ];
requiredPythonModules = [ numpy multipledispatch dateutil ];

meta = with lib; {
homepage = "https://github.com/ContinuumIO/datashape";
Expand All @@ -464,7 +464,7 @@ buildPythonPackage rec {
We can see several runtime dependencies, `numpy`, `multipledispatch`, and
`dateutil`. Furthermore, we have one `checkInputs`, i.e. `pytest`. `pytest` is a
test runner and is only used during the `checkPhase` and is therefore not added
to `propagatedBuildInputs`.
to `requiredPythonModules`.

In the previous case we had only dependencies on other Python packages to consider.
Occasionally you have also system libraries to consider. E.g., `lxml` provides
Expand Down Expand Up @@ -518,7 +518,7 @@ buildPythonPackage rec {

buildInputs = [ pkgs.fftw pkgs.fftwFloat pkgs.fftwLongDouble];

propagatedBuildInputs = [ numpy scipy ];
requiredPythonModules = [ numpy scipy ];

# Tests cannot import pyfftw. pyfftw works fine though.
doCheck = false;
Expand Down Expand Up @@ -671,9 +671,9 @@ mode is activated.

In the following example we create a simple environment that has a Python 3.8
version of our package in it, as well as its dependencies and other packages we
like to have in the environment, all specified with `propagatedBuildInputs`.
like to have in the environment, all specified with `requiredPythonModules`.
Indeed, we can just add any package we like to have in our environment to
`propagatedBuildInputs`.
`requiredPythonModules`.

```nix
with import <nixpkgs> {};
Expand All @@ -682,7 +682,7 @@ with python38Packages;
buildPythonPackage rec {
name = "mypackage";
src = ./path/to/package/source;
propagatedBuildInputs = [ pytest numpy pkgs.libsndfile ];
requiredPythonModules = [ pytest numpy pkgs.libsndfile ];
}
```

Expand Down Expand Up @@ -843,7 +843,7 @@ buildPythonPackage rec {

checkInputs = [ hypothesis ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ attrs py setuptools six pluggy ];
requiredPythonModules = [ attrs py setuptools six pluggy ];

meta = with lib; {
maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ];
Expand Down Expand Up @@ -898,8 +898,6 @@ following are specific to `buildPythonPackage`:
* `pipInstallFlags ? []`: A list of strings. Arguments to be passed to `pip
install`. To pass options to `python setup.py install`, use
`--install-option`. E.g., `pipInstallFlags=["--install-option='--cpp_implementation'"]`.
* `pythonPath ? []`: List of packages to be added into `$PYTHONPATH`. Packages
in `pythonPath` are not propagated (contrary to `propagatedBuildInputs`).
* `preShellHook`: Hook to execute commands before `shellHook`.
* `postShellHook`: Hook to execute commands after `shellHook`.
* `removeBinByteCode ? true`: Remove bytecode from `/bin`. Bytecode is only
Expand All @@ -920,7 +918,7 @@ because their behaviour is different:
* `checkInputs ? []`: Dependencies needed for running the `checkPhase`. These
are added to `nativeBuildInputs` when `doCheck = true`. Items listed in
`tests_require` go here.
* `propagatedBuildInputs ? []`: Aside from propagating dependencies,
* `requiredPythonModules ? []`: Aside from propagating dependencies,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need fixing

`buildPythonPackage` also injects code into and wraps executables with the
paths included in this list. Items listed in `install_requires` go here.

Expand Down Expand Up @@ -980,7 +978,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "035w8gqql36zlan0xjrzz9j4lh9hs0qrsgnbyw07qs7lnkvbdv9x";
};

propagatedBuildInputs = with python3Packages; [ tornado_4 python-daemon ];
requiredPythonModules = with python3Packages; [ tornado_4 python-daemon ];

meta = with lib; {
...
Expand Down Expand Up @@ -1539,7 +1537,7 @@ configure alternatives](#sec-overlays-alternatives-blas-lapack)".
In a `setup.py` or `setup.cfg` it is common to declare dependencies:

* `setup_requires` corresponds to `nativeBuildInputs`
* `install_requires` corresponds to `propagatedBuildInputs`
* `install_requires` corresponds to `requiredPythonModules`
* `tests_require` corresponds to `checkInputs`

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/taskserver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ let
EOF
'';

propagatedBuildInputs = [ pkgs.pythonPackages.click ];
requiredPythonModules = [ pkgs.pythonPackages.click ];
};

in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ python3.pkgs.buildPythonApplication {
glib
];

propagatedBuildInputs = with python3.pkgs; [
requiredPythonModules = with python3.pkgs; [
pygobject3
ordered-set
];
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/azure-agent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let
utillinux # for (u)mount, fdisk, sfdisk, mkswap
parted
];
pythonPath = [ pythonPackages.pyasn1 ];
requiredPythonModules = [ pythonPackages.pyasn1 ];

configurePhase = false;
buildPhase = false;
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/audio/carla/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ stdenv.mkDerivation rec {
python3Packages.wrapPython pkgconfig which wrapQtAppsHook
];

pythonPath = with python3Packages; [
requiredPythonModules = with python3Packages; [
rdflib pyliblo
] ++ optional withFrontend pyqt5;

buildInputs = [
file liblo alsaLib fluidsynth ffmpeg_3 jack2 libpulseaudio libsndfile
] ++ pythonPath
] ++ requiredPythonModules
++ optional withQt qtbase
++ optional withGtk2 gtk2
++ optional withGtk3 gtk3;
Expand All @@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
postFixup = ''
# Also sets program_PYTHONPATH and program_PATH variables
wrapPythonPrograms
wrapPythonProgramsIn "$out/share/carla/resources" "$out $pythonPath"
wrapPythonProgramsIn "$out/share/carla/resources" "$out $requiredPythonModules"

find "$out/share/carla" -maxdepth 1 -type f -not -name "*.py" -print0 | while read -d "" f; do
patchPythonScript "$f"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/cozy-audiobooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ python3Packages.buildPythonApplication rec {
gst-plugins-base
]);

propagatedBuildInputs = with python3Packages; [
requiredPythonModules = with python3Packages; [
apsw
cairo
dbus-python
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/curseradio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "11bf0jnj8h2fxhpdp498189r4s6b47vy4wripv0z4nx7lxajl88i";
};

propagatedBuildInputs = with python3Packages; [
requiredPythonModules = with python3Packages; [
requests
lxml
pyxdg
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/dr14_tmeter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "1nfsasi7kx0myxkahbd7rz8796mcf5nsadrsjjpx2kgaaw5nkv1m";
};

propagatedBuildInputs = with pkgs; [
requiredPythonModules = with pkgs; [
python3Packages.numpy flac vorbis-tools ffmpeg_3 faad2 lame
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/friture/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in py.buildPythonApplication rec {
nativeBuildInputs = (with py; [ numpy cython scipy ]) ++
[ wrapQtAppsHook ];

propagatedBuildInputs = with py; [
requiredPythonModules = with py; [
sounddevice
pyopengl
pyopengl-accelerate
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/gpodder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ python3Packages.buildPythonApplication rec {

doCheck = true;

propagatedBuildInputs = with python3Packages; [
requiredPythonModules = with python3Packages; [
feedparser
dbus-python
mygpoclient
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/greg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ with pythonPackages; buildPythonApplication rec {
};

buildInputs = with pythonPackages; [ feedparser ];
propagatedBuildInputs = buildInputs;
requiredPythonModules = buildInputs;

meta = with stdenv.lib; {
homepage = "https://github.com/manolomartinez/greg";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/gspeech/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ python3.pkgs.buildPythonApplication rec {
python3
];

propagatedBuildInputs = with python3.pkgs; [
requiredPythonModules = with python3.pkgs; [
pygobject3
librsvg
];
Expand Down
6 changes: 4 additions & 2 deletions pkgs/applications/audio/gtklick/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ pythonPackages.buildPythonApplication rec {
sha256 = "7799d884126ccc818678aed79d58057f8cf3528e9f1be771c3fa5b694d9d0137";
};

pythonPath = with pythonPackages; [
requiredPythonModules = with pythonPackages; [
pyliblo
pyGtkGlade
];

nativeBuildInputs = [ gettext ];

propagatedBuildInputs = [ klick ];
makeWrapperArgs = [
"--prefix PATH ${stdenv.lib.makeBinPath [ klick ]}"
];

# wrapPythonPrograms breaks gtklick in the postFixup phase.
# To fix it, apply wrapPythonPrograms and then clean up the wrapped file.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/lollypop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python3.pkgs.buildPythonApplication rec {
totem-pl-parser
] ++ lib.optional lastFMSupport libsecret;

propagatedBuildInputs = with python3.pkgs; [
requiredPythonModules = with python3.pkgs; [
beautifulsoup4
pillow
pycairo
Expand All @@ -78,7 +78,7 @@ python3.pkgs.buildPythonApplication rec {
'';

postFixup = ''
wrapPythonProgramsIn $out/libexec "$out $propagatedBuildInputs"
wrapPythonProgramsIn $out/libexec "$out $requiredPythonModules"
'';

strictDeps = false;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/lyrebird/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "0wmnww2wi8bb9m8jgc18n04gjia8pf9klmvij0w98xz11l6kxb13";
};

propagatedBuildInputs = with python3Packages; [ toml pygobject3 ];
requiredPythonModules = with python3Packages; [ toml pygobject3 ];

nativeBuildInputs = [ wrapGAppsHook ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/gmusic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "14yswmlfs659rs3k595606m77lw9c6pjykb5pikqw21sb97haxl3";
};

propagatedBuildInputs = [
requiredPythonModules = [
mopidy
python3Packages.requests
python3Packages.gmusicapi
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/iris.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "04miwf0dqb8jir9g7xkfnn3l62bdn74ap03kqzz2v3byg64f1p0g";
};

propagatedBuildInputs = [
requiredPythonModules = [
mopidy
] ++ (with python3Packages; [
configobj
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/local.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "13m0iz14lyplnpm96gfpisqvv4n89ls30kmkg21z7v238lm0h19j";
};

propagatedBuildInputs = [
requiredPythonModules = [
mopidy
python3Packages.uritools
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/moped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pythonPackages.buildPythonApplication rec {

LC_ALL = "en_US.UTF-8";
buildInputs = [ glibcLocales ];
propagatedBuildInputs = [ mopidy ];
requiredPythonModules = [ mopidy ];

# no tests implemented
doCheck = false;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/mopidy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pythonPackages.buildPythonApplication rec {
gst-plugins-ugly
];

propagatedBuildInputs = [
requiredPythonModules = [
gobject-introspection
] ++ (with pythonPackages; [
gst-python
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/mopify.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pythonPackages.buildPythonApplication rec {
sha256 = "93ad2b3d38b1450c8f2698bb908b0b077a96b3f64cdd6486519e518132e23a5c";
};

propagatedBuildInputs = with pythonPackages; [ mopidy configobj ];
requiredPythonModules = with pythonPackages; [ mopidy configobj ];

# no tests implemented
doCheck = false;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/mpd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "0prjli4352521igcsfcgmk97jmzgbfy4ik8hnli37wgvv252wiac";
};

propagatedBuildInputs = [mopidy];
requiredPythonModules = [mopidy];

# no tests implemented
doCheck = false;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/mpris.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "0mmdaikw00f43gzjdbvlcvzff6yppm7v8mv012r79adzd992q9y0";
};

propagatedBuildInputs = [
requiredPythonModules = [
mopidy
python3Packages.pydbus
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/musicbox-webclient.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pythonPackages.buildPythonApplication rec {
sha256 = "0784s32pap9rbki3f0f7swaf6946sdv4xzidns13jmw9ilifk5z4";
};

propagatedBuildInputs = [ mopidy ];
requiredPythonModules = [ mopidy ];

doCheck = false;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/somafm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "1j88rrliys8hqvnb35k1xqw88bvrllcb4rb53lgh82byhscsxlf3";
};

propagatedBuildInputs = [
requiredPythonModules = [
mopidy
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/soundcloud.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pythonPackages.buildPythonApplication rec {
sha256 = "131qdm9i0j3ayff0js11qcmbjv50ws5s6iiqr6x5b66ymjl4scfv";
};

propagatedBuildInputs = [ mopidy ];
requiredPythonModules = [ mopidy ];

doCheck = false;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/spotify-tunigo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pythonPackages.buildPythonApplication rec {
sha256 = "1jwk0b2iz4z09qynnhcr07w15lx6i1ra09s9lp48vslqcf2fp36x";
};

propagatedBuildInputs = [ mopidy mopidy-spotify pythonPackages.tunigo ];
requiredPythonModules = [ mopidy mopidy-spotify pythonPackages.tunigo ];

doCheck = false;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/spotify.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pythonPackages.buildPythonApplication rec {
sha256 = "1ac8r8050i5r3ag1hlblbcyskqjqz7wgamndbzsmw52qi6hxk44f";
};

propagatedBuildInputs = [ mopidy pythonPackages.pyspotify ];
requiredPythonModules = [ mopidy pythonPackages.pyspotify ];

doCheck = false;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/tunein.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "0insasf4w8ajsqjh5zmax7pkzmrk1p245vh4y8ddicldj45p6qfj";
};

propagatedBuildInputs = [
requiredPythonModules = [
mopidy
];

Expand Down
Loading