Skip to content

Commit

Permalink
treewide: remove use of python3(Packages) in python package set (NixO…
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksanaa authored Sep 5, 2024
2 parents 6d1448b + 730527c commit 24f2c3e
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 43 deletions.
13 changes: 9 additions & 4 deletions pkgs/development/python-modules/ansible-builder/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
lib,
python3Packages,
setuptools,
setuptools-scm,
jsonschema,
requirements-parser,
pyyaml,
podman,
fetchPypi,
bindep,
buildPythonPackage,
}:
python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "ansible-builder";
version = "3.0.1";
format = "pyproject";
Expand All @@ -15,14 +20,14 @@ python3Packages.buildPythonPackage rec {
hash = "sha256-rxyhgj9Cad751tPAptCTLCtXQLUXaRYv39bkoFzzjOk=";
};

nativeBuildInputs = with python3Packages; [
nativeBuildInputs = [
setuptools
setuptools-scm
];

buildInputs = [ bindep ];

propagatedBuildInputs = with python3Packages; [
propagatedBuildInputs = [
podman
jsonschema
requirements-parser
Expand Down
13 changes: 9 additions & 4 deletions pkgs/development/python-modules/bindep/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
lib,
python3Packages,
fetchPypi,
buildPythonPackage,
distro,
pbr,
setuptools,
packaging,
parsley,
}:
python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "bindep";
version = "2.11.0";
format = "pyproject";
Expand All @@ -13,13 +18,13 @@ python3Packages.buildPythonPackage rec {
hash = "sha256-rLLyWbzh/RUIhzR5YJu95bmq5Qg3hHamjWtqGQAufi8=";
};

buildInputs = with python3Packages; [
buildInputs = [
distro
pbr
setuptools
];

propagatedBuildInputs = with python3Packages; [
propagatedBuildInputs = [
parsley
pbr
packaging
Expand Down
7 changes: 4 additions & 3 deletions pkgs/development/python-modules/chainstream/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
lib,
fetchPypi,
python3Packages,
buildPythonPackage,
setuptools,
}:

python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "chainstream";
version = "1.0.1";

pyproject = true;

nativeBuildInputs = [ python3Packages.setuptools ];
nativeBuildInputs = [ setuptools ];

src = fetchPypi {
inherit pname version;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/cli-ui/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
lib,
python3Packages,
fetchPypi,
pytestCheckHook,
pythonOlder,
poetry-core,
colorama,
tabulate,
unidecode,
buildPythonPackage,
}:
python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "cli-ui";
version = "0.17.2";
pyproject = true;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/controku/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
python3Packages,
fetchFromGitHub,
setuptools,
requests,
Expand All @@ -10,10 +9,11 @@
gobject-introspection,
gtk3,
wrapGAppsHook3,
buildPythonPackage,
buildApplication ? false,
}:

python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "controku";
version = "1.1.0";
format = "pyproject";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/dbt-core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
packaging,
pathspec,
protobuf,
python,
callPackage,
pythonOlder,
pytz,
pyyaml,
Expand Down Expand Up @@ -85,7 +85,7 @@ buildPythonPackage rec {
doCheck = false;

passthru = {
withAdapters = python.pkgs.callPackage ./with-adapters.nix { };
withAdapters = callPackage ./with-adapters.nix { };
};

meta = with lib; {
Expand Down
7 changes: 4 additions & 3 deletions pkgs/development/python-modules/dnf4/wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
lib,
wrapPython,
python3,
python,
stdenv,
dnf4,
dnf-plugins-core,
plugins ? [ dnf-plugins-core ],
}:
let
pluginPaths = map (p: "${p}/${python3.sitePackages}/dnf-plugins") plugins;
pluginPaths = map (p: "${p}/${python.sitePackages}/dnf-plugins") plugins;

dnf4-unwrapped = python3.pkgs.dnf4;
dnf4-unwrapped = dnf4;
in

stdenv.mkDerivation {
Expand Down
11 changes: 7 additions & 4 deletions pkgs/development/python-modules/exiv2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
pkg-config,
exiv2,
gettext,
python3Packages,
fetchFromGitHub,
gitUpdater,
buildPythonPackage,
setuptools,
toml,
unittestCheckHook,
}:
python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "exiv2";
version = "0.17.0";
pyproject = true;
Expand All @@ -30,7 +33,7 @@ python3Packages.buildPythonPackage rec {
def test_localisation(self):"
'';

build-system = with python3Packages; [
build-system = [
setuptools
toml
];
Expand All @@ -42,7 +45,7 @@ python3Packages.buildPythonPackage rec {
];

pythonImportsCheck = [ "exiv2" ];
nativeCheckInputs = with python3Packages; [ unittestCheckHook ];
nativeCheckInputs = [ unittestCheckHook ];
unittestFlagsArray = [
"-s"
"tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
image,
method,
python3Packages,
invisible-watermark,
runCommand,
testName,
withOnnx,
Expand All @@ -25,7 +25,7 @@ let
else
"fnörd1";
length = (builtins.stringLength message) * 8;
invisible-watermark' = python3Packages.invisible-watermark.override { inherit withOnnx; };
invisible-watermark' = invisible-watermark.override { inherit withOnnx; };
expected-exit-code = if method == "rivaGan" && !withOnnx then "1" else "0";
in
runCommand "invisible-watermark-test-${testName}" { nativeBuildInputs = [ invisible-watermark' ]; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
image,
invisible-watermark,
opencv4,
python3,
python,
runCommand,
stdenvNoCC,
}:
Expand All @@ -13,12 +13,10 @@ let
message = "fnörd1";
method = "dwtDct";

pythonWithPackages = python3.withPackages (
pp: with pp; [
invisible-watermark
opencv4
]
);
pythonWithPackages = python.withPackages (_: [
invisible-watermark
opencv4
]);
pythonInterpreter = pythonWithPackages.interpreter;

encode = stdenvNoCC.mkDerivation {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/manuf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
buildPythonPackage,
fetchFromGitHub,
runCommand,
python3,
wireshark-cli,
pytestCheckHook,
manuf, # remove when buildPythonPackage supports finalAttrs
}:

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

passthru.tests = {
testMacAddress = runCommand "${pname}-test" { } ''
${python3.pkgs.manuf}/bin/manuf BC:EE:7B:00:00:00 > $out
${lib.getExe manuf} BC:EE:7B:00:00:00 > $out
[ "$(cat $out | tr -d '\n')" = "Vendor(manuf='ASUSTekC', manuf_long='ASUSTek COMPUTER INC.', comment=None)" ]
'';
};
Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/python-modules/mlx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
lib,
fetchFromGitHub,
buildPythonPackage,
python3Packages,
pybind11,
cmake,
xcbuild,
zsh,
blas,
lapack,
setuptools,
}:

let
Expand Down Expand Up @@ -69,7 +69,8 @@ buildPythonPackage rec {
zsh
gguf-tools
nlohmann_json
] ++ (with python3Packages; [ setuptools ]);
setuptools
];

buildInputs = [
blas
Expand Down
8 changes: 5 additions & 3 deletions pkgs/development/python-modules/onigurumacffi/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
lib,
python3Packages,
buildPythonPackage,
fetchPypi,
oniguruma,
setuptools,
cffi,
}:
python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "onigurumacffi";
version = "1.3.0";
format = "pyproject";
Expand All @@ -14,7 +16,7 @@ python3Packages.buildPythonPackage rec {
hash = "sha256-d0XNxWCWrOyIofOwhmCiKwnGWe040/WdtsHK12qXa+8=";
};

buildInputs = with python3Packages; [
buildInputs = [
oniguruma
setuptools
cffi
Expand Down
7 changes: 4 additions & 3 deletions pkgs/development/python-modules/orgparse/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
lib,
python3Packages,
setuptools-scm,
fetchPypi,
buildPythonPackage,
}:

python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "orgparse";
version = "0.4.20231004";

Expand All @@ -13,7 +14,7 @@ python3Packages.buildPythonPackage rec {
hash = "sha256-pOOK6tq/mYiw9npmrNCCedGCILy8QioSkGDCiQu6kaA=";
};

nativeBuildInputs = [ python3Packages.setuptools-scm ];
nativeBuildInputs = [ setuptools-scm ];

pyproject = true;

Expand Down

0 comments on commit 24f2c3e

Please sign in to comment.