uwsgi: remove python2 (#389865)

This commit is contained in:
Gaétan Lepage
2025-03-15 10:22:15 +01:00
committed by GitHub
3 changed files with 15 additions and 30 deletions

View File

@@ -268,6 +268,8 @@
- `isd` was updated from 0.2.0 to 0.5.1, the new version may crash with a previously generated config, try moving or deleting `~/.config/isd/schema.json`.
- `uwsgi` no longer supports Python 2 plugins.
- `asusd` has been upgraded to version 6 which supports multiple aura devices. To account for this, the single `auraConfig` configuration option has been replaced with `auraConfigs` which is an attribute set of config options per each device. The config files may also be now specified as either source files or text strings; to account for this you will need to specify that `text` is used for your existing configs, e.g.:
```diff
-services.asusd.asusdConfig = '''file contents'''

View File

@@ -33,19 +33,8 @@ let
c.plugins or cfg.plugins;
plugins = unique plugins';
hasPython = v: filter (n: n == "python${v}") plugins != [ ];
hasPython2 = hasPython "2";
hasPython3 = hasPython "3";
python =
if hasPython2 && hasPython3 then
throw "`plugins` attribute in uWSGI configuration shouldn't contain both python2 and python3"
else if hasPython2 then
cfg.package.python2
else if hasPython3 then
cfg.package.python3
else
null;
hasPython3 = filter (n: n == "python3") plugins != [ ];
python = if hasPython3 then cfg.package.python3 else null;
pythonEnv = python.withPackages (c.pythonPackages or (self: [ ]));

View File

@@ -8,7 +8,7 @@
libxcrypt,
expat,
zlib,
# plugins: list of strings, eg. [ "python2" "python3" ]
# plugins: list of strings, eg. [ "python3" ]
plugins ? [ ],
pam,
withPAM ? stdenv.hostPlatform.isLinux,
@@ -16,7 +16,6 @@
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
libcap,
withCap ? stdenv.hostPlatform.isLinux,
python2,
python3,
ncurses,
ruby,
@@ -31,25 +30,20 @@ let
apxs2Support = false;
};
pythonPlugin =
pkg:
lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" {
interpreter = pkg.pythonOnBuildForHost.interpreter;
available = lib.listToAttrs [
(lib.nameValuePair "python3" {
interpreter = python3.pythonOnBuildForHost.interpreter;
path = "plugins/python";
inputs = [
pkg
python3
ncurses
];
install = ''
install -Dm644 uwsgidecorators.py $out/${pkg.sitePackages}/uwsgidecorators.py
${pkg.pythonOnBuildForHost.executable} -m compileall $out/${pkg.sitePackages}/
${pkg.pythonOnBuildForHost.executable} -O -m compileall $out/${pkg.sitePackages}/
install -Dm644 uwsgidecorators.py $out/${python3.sitePackages}/uwsgidecorators.py
${python3.pythonOnBuildForHost.executable} -m compileall $out/${python3.sitePackages}/
${python3.pythonOnBuildForHost.executable} -O -m compileall $out/${python3.sitePackages}/
'';
};
available = lib.listToAttrs [
(pythonPlugin python2)
(pythonPlugin python3)
})
(lib.nameValuePair "rack" {
path = "plugins/rack";
inputs = [ ruby ];
@@ -91,7 +85,7 @@ stdenv.mkDerivation (finalAttrs: {
src = fetchFromGitHub {
owner = "unbit";
repo = "uwsgi";
rev = finalAttrs.version;
tag = finalAttrs.version;
hash = "sha256-/7Z9lq7JiGBrTpmtbIEqpMg7nw9SVm8ypmzd1/p6xgU=";
};
@@ -128,7 +122,7 @@ stdenv.mkDerivation (finalAttrs: {
UWSGI_INCLUDES = lib.optionalString withCap "${libcap.dev}/include";
passthru = {
inherit python2 python3;
inherit python3;
tests.uwsgi = nixosTests.uwsgi;
};