fix(hass): override urllib for spotifyplus
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-09-30 21:45:18 -04:00
parent f67d3a4788
commit 06669e8679
5 changed files with 85 additions and 7 deletions

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {
pkgs,
self,
...
}: {
imports = [ imports = [
./assist.nix ./assist.nix
./bluetooth.nix ./bluetooth.nix
@ -47,6 +51,12 @@
services.home-assistant = { services.home-assistant = {
enable = true; enable = true;
package = pkgs.home-assistant.override {
packageOverrides = _: super: {
inherit (self.packages.${pkgs.system}) urllib3;
};
};
extraComponents = [ extraComponents = [
"androidtv_remote" "androidtv_remote"
"caldav" "caldav"

View file

@ -1,4 +1,5 @@
{ {
self,
buildHassComponent, buildHassComponent,
smartinspect-src, smartinspect-src,
spotifywebapi-src, spotifywebapi-src,
@ -6,13 +7,16 @@
... ...
}: let }: let
python3Packages = pkgs.python3Packages.override { python3Packages = pkgs.python3Packages.override {
overrides = self: super: rec { overrides = _: super: rec {
smartinspect = pkgs.callPackage ./smartinspect.nix { smartinspect = pkgs.callPackage ./smartinspect.nix {
inherit python3Packages smartinspect-src; inherit python3Packages smartinspect-src;
}; };
spotifywebapi = pkgs.callPackage ./spotifywebapi.nix { spotifywebapi = pkgs.callPackage ./spotifywebapi.nix {
inherit python3Packages smartinspect spotifywebapi-src; inherit python3Packages smartinspect spotifywebapi-src;
}; };
urllib3 = self.packages.${pkgs.system}.urllib3.override {
inherit python3Packages;
};
}; };
}; };
in in

View file

@ -15,11 +15,6 @@ in
src = spotifyplus-src; src = spotifyplus-src;
prePatch = ''
substituteInPlace ./custom_components/spotifyplus/manifest.json \
--replace-warn "urllib3>=1.21.1,<1.27" "urllib3>=1.21.1"
'';
propagatedBuildInputs = with python3Packages; [ propagatedBuildInputs = with python3Packages; [
oauthlib oauthlib
platformdirs platformdirs

View file

@ -41,4 +41,6 @@
trash-d = pkgs.callPackage ./trash-d { trash-d = pkgs.callPackage ./trash-d {
inherit (inputs) trash-d-src; inherit (inputs) trash-d-src;
}; };
urllib3 = pkgs.callPackage ./urllib3 {};
} }

View file

@ -0,0 +1,67 @@
# From nixpkgs 4c0061c983a2bcb888f5c478cfb7631ec1090c22
{
lib,
fetchPypi,
python3Packages,
}:
python3Packages.buildPythonPackage rec {
pname = "urllib3";
version = "1.26.16";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-jxNfZQJ1a95rKpsomJ31++h8mXDOyqaQQe3M5/BYmxQ=";
};
propagatedBuildInputs =
passthru.optional-dependencies.brotli
++ passthru.optional-dependencies.socks;
nativeCheckInputs = with python3Packages; [
python-dateutil
mock
pytest-freezegun
pytest-timeout
pytestCheckHook
tornado
trustme
];
doCheck = false;
preCheck = ''
export CI # Increases LONG_TIMEOUT
'';
pythonImportsCheck = [
"urllib3"
];
passthru.optional-dependencies = with python3Packages; {
brotli =
if isPyPy
then [
brotlicffi
]
else [
brotli
];
secure = [
certifi
cryptography
idna
pyopenssl
];
socks = [
pysocks
];
};
meta = with lib; {
description = "Powerful, sanity-friendly HTTP client for Python";
homepage = "https://github.com/shazow/urllib3";
changelog = "https://github.com/urllib3/urllib3/blob/${version}/CHANGES.rst";
license = licenses.mit;
};
}