2021-03-09 03:18:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2022-01-19 23:45:15 +00:00
|
|
|
, callPackage
|
2021-03-09 03:18:52 +00:00
|
|
|
, fetchFromGitHub
|
2023-03-04 12:14:45 +00:00
|
|
|
, fetchPypi
|
2024-04-21 15:54:59 +00:00
|
|
|
, python312
|
2021-12-19 01:06:50 +00:00
|
|
|
, substituteAll
|
2022-12-02 08:20:57 +00:00
|
|
|
, ffmpeg-headless
|
2021-05-20 23:08:51 +00:00
|
|
|
, inetutils
|
2021-03-09 03:18:52 +00:00
|
|
|
, nixosTests
|
2022-12-28 21:21:41 +00:00
|
|
|
, home-assistant
|
|
|
|
, testers
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Look up dependencies of specified components in component-packages.nix
|
|
|
|
, extraComponents ? [ ]
|
|
|
|
|
|
|
|
# Additional packages to add to propagatedBuildInputs
|
|
|
|
, extraPackages ? ps: []
|
|
|
|
|
|
|
|
# Override Python packages using
|
|
|
|
# self: super: { pkg = super.pkg.overridePythonAttrs (oldAttrs: { ... }); }
|
|
|
|
# Applied after defaultOverrides
|
2021-02-19 19:06:45 +00:00
|
|
|
, packageOverrides ? self: super: {}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Skip pip install of required packages on startup
|
|
|
|
, skipPip ? true }:
|
|
|
|
|
|
|
|
let
|
|
|
|
defaultOverrides = [
|
2021-09-18 10:52:07 +00:00
|
|
|
# Override the version of some packages pinned in Home Assistant's setup.py and requirements_all.txt
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
(self: super: {
|
2024-04-21 15:54:59 +00:00
|
|
|
aioelectricitymaps = super.aioelectricitymaps.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.4.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jpbede";
|
|
|
|
repo = "aioelectricitymaps";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-q06B40c0uvSuzH/3YCoxg4p9aNIOPrphsoESktF+B14=";
|
|
|
|
};
|
|
|
|
nativeCheckInputs = with self; [
|
|
|
|
aresponses
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
aiopurpleair = super.aiopurpleair.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2022.12.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bachya";
|
|
|
|
repo = "aiopurpleair";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-YmJH4brWkTpgzyHwu9UnIWrY5qlDCmMtvF+KxQFXwfk=";
|
|
|
|
};
|
|
|
|
postPatch = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
substituteInPlace pyproject.toml --replace-fail \
|
2024-01-25 14:12:00 +00:00
|
|
|
'"setuptools >= 35.0.2", "wheel >= 0.29.0", "poetry>=0.12"' \
|
|
|
|
'"poetry-core"'
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
aioskybell = super.aioskybell.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "22.7.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
2024-01-13 08:15:51 +00:00
|
|
|
owner = "tkdrob";
|
|
|
|
repo = "aioskybell";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-aBT1fDFtq1vasTvCnAXKV2vmZ6LBLZqRCiepv1HDJ+Q=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
aiowatttime = super.aiowatttime.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.1.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bachya";
|
|
|
|
repo = "aiowatttime";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-tWnxGLJT+CRFvkhxFamHxnLXBvoR8tfOvzH1o1i5JJg=";
|
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
postPatch = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
substituteInPlace pyproject.toml --replace-fail \
|
2024-01-13 08:15:51 +00:00
|
|
|
'"setuptools >= 35.0.2", "wheel >= 0.29.0", "poetry>=0.12"' \
|
|
|
|
'"poetry-core"'
|
|
|
|
'';
|
2023-01-20 10:41:00 +00:00
|
|
|
});
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
astral = super.astral.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
pname = "astral";
|
|
|
|
version = "2.2";
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2023-01-11 07:51:40 +00:00
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-5B2ZZ9XEi+QhNGVS8PTe2tQ/85qDV09f8q0ytmJ7b74=";
|
|
|
|
};
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-fail "poetry>=1.0.0b1" "poetry-core" \
|
|
|
|
--replace-fail "poetry.masonry" "poetry.core.masonry"
|
2023-01-11 07:51:40 +00:00
|
|
|
'';
|
|
|
|
propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [
|
|
|
|
self.pytz
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
geojson = super.geojson.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.5.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit (oldAttrs.src) owner repo;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-AcImffYki1gnIaZp/1eacNjdDgjn6qinPJXq9jYtoRg=";
|
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
gspread = super.gspread.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "5.12.4";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "burnash";
|
|
|
|
repo = "gspread";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-i+QbnF0Y/kUMvt91Wzb8wseO/1rZn9xzeA5BWg1haks=";
|
|
|
|
};
|
|
|
|
dependencies = with self; [
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
openhomedevice = super.openhomedevice.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.2";
|
2023-03-24 00:07:29 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit (oldAttrs.src) owner repo;
|
2024-07-27 06:49:29 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-GGp7nKFH01m1KW6yMkKlAdd26bDi8JDWva6OQ0CWMIw=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pymelcloud = super.pymelcloud.overridePythonAttrs (oldAttrs: {
|
|
|
|
version = "2.5.9";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vilppuvuorinen";
|
|
|
|
repo = "pymelcloud";
|
|
|
|
rev = "33a827b6cd0b34f276790faa49bfd0994bb7c2e4"; # 2.5.x branch
|
|
|
|
sha256 = "sha256-Q3FIo9YJwtWPHfukEBjBANUQ1N1vr/DMnl1dgiN7vYg=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
notifications-android-tv = super.notifications-android-tv.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.1.5";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "engrbm87";
|
|
|
|
repo = "notifications_android_tv";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-adkcUuPl0jdJjkBINCTW4Kmc16C/HzL+jaRZB/Qr09A=";
|
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = with self; [
|
2023-04-12 12:48:02 +00:00
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
propagatedBuildInputs = with self; [
|
2023-04-12 12:48:02 +00:00
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false; # no tests
|
|
|
|
});
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# Pinned due to API changes in 0.1.0
|
2022-09-09 14:08:57 +00:00
|
|
|
poolsense = super.poolsense.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.0.8";
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2022-09-09 14:08:57 +00:00
|
|
|
pname = "poolsense";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-17MHrYRmqkH+1QLtgq2d6zaRtqvb9ju9dvPt9gB2xCc=";
|
|
|
|
};
|
|
|
|
});
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
pyasn1 = super.pyasn1.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.4.8";
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit (oldAttrs) pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-rvd8n7lKOsWI6HhBIIvexGRHHZhxvVBQoofMmkdc0Lo=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# Pinned due to API changes >0.3.5.3
|
2022-02-20 05:27:41 +00:00
|
|
|
pyatag = super.pyatag.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.3.5.3";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MatsNl";
|
|
|
|
repo = "pyatag";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "00ly4injmgrj34p0lyx7cz2crgnfcijmzc0540gf7hpwha0marf6";
|
|
|
|
};
|
|
|
|
});
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
pyaussiebb = super.pyaussiebb.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.0.18";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yaleman";
|
|
|
|
repo = "aussiebb";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-tEdddVsLFCHRvyLCctDakioiop2xWaJlfGE16P1ukHc=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
pydantic = super.pydantic_1;
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
pydexcom = super.pydexcom.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.2.3";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gagebenne";
|
|
|
|
repo = "pydexcom";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-ItDGnUUUTwCz4ZJtFVlMYjjoBPn2h8QZgLzgnV2T/Qk=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
pyflume = super.pyflume.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.6.5";
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchFromGitHub {
|
2024-09-19 14:19:46 +00:00
|
|
|
owner = "ChrisMandich";
|
|
|
|
repo = "PyFlume";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-kIE3y/qlsO9Y1MjEQcX0pfaBeIzCCHk4f1Xa215BBHo=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = oldAttrs.propagatedBuildInputs or [] ++ [
|
|
|
|
self.pytz
|
2024-05-15 15:35:15 +00:00
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
});
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
pykaleidescape = super.pykaleidescape.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.0.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit (oldAttrs.src) owner repo;
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-KM/gtpsQ27QZz2uI1t/yVN5no0zp9LZag1duAJzK55g=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pyoctoprintapi = super.pyoctoprintapi.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.1.12";
|
2023-11-16 04:20:00 +00:00
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "rfleming71";
|
|
|
|
repo = "pyoctoprintapi";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Jf/zYnBHVl3TYxFy9Chy6qNH/eCroZkmUOEWfd62RIo=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pysnooz = super.pysnooz.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.8.6";
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "AustinBrunkhorst";
|
|
|
|
repo = "pysnooz";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-hJwIObiuFEAVhgZXYB9VCeAlewBBnk0oMkP83MUCpyU=";
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
pytradfri = super.pytradfri.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "9.0.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "home-assistant-libs";
|
|
|
|
repo = "pytradfri";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-xOdTzG0bF5p1QpkXv2btwrVugQRjSwdAj8bXcC0IoQg=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# newer sigstore version transitivevly require pydantic>=2
|
|
|
|
sigstore = super.sigstore.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.1.2";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigstore";
|
|
|
|
repo = "sigstore-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-QqY5GOBS75OkbSaF5Ua5jnJAhsYfVRuWLUoWDxX8Ino=";
|
|
|
|
};
|
|
|
|
dependencies = with self; [
|
|
|
|
appdirs
|
|
|
|
cryptography
|
|
|
|
id
|
|
|
|
pydantic
|
|
|
|
pyjwt
|
|
|
|
pyopenssl
|
|
|
|
requests
|
|
|
|
securesystemslib
|
|
|
|
sigstore-protobuf-specs
|
|
|
|
tuf
|
|
|
|
];
|
|
|
|
doCheck = false; # pytest too new
|
|
|
|
});
|
|
|
|
|
|
|
|
sigstore-protobuf-specs = super.sigstore-protobuf-specs.overridePythonAttrs {
|
|
|
|
version = "0.1.0";
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "sigstore-protobuf-specs";
|
|
|
|
version = "0.1.0";
|
|
|
|
hash = "sha256-YistIxYToo7T5mYKzYeBhnW06DSG9JoPDBmKxUdfy4E=";
|
|
|
|
};
|
|
|
|
nativeBuildInputs = with self; [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"betterproto"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
slack-sdk = super.slack-sdk.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.5.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "slackapi";
|
|
|
|
repo = "python-slackclient";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-U//HUe6e41wOOzoaDl4yXPnEASCzpGBIScHStWMN8tk=";
|
|
|
|
};
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace-fail "pytest-runner" ""
|
|
|
|
'';
|
|
|
|
pythonImportsCheck = [ "slack" ];
|
|
|
|
doCheck = false; # Tests changed a lot for > 3
|
|
|
|
});
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
tuf = super.tuf.overridePythonAttrs rec {
|
|
|
|
version = "2.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "theupdateframework";
|
|
|
|
repo = "python-tuf";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-MdPctAZuKn/YAwpMJ5gWU7PXJD3iK7bYprLXV52wNQQ=";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_sign_failures"
|
2024-04-21 15:54:59 +00:00
|
|
|
];
|
2024-05-15 15:35:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
versioningit = super.versioningit.overridePythonAttrs {
|
|
|
|
doCheck = false;
|
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# Pinned due to API changes ~1.0
|
2021-12-19 01:06:50 +00:00
|
|
|
vultr = super.vultr.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.1.2";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spry-group";
|
|
|
|
repo = "python-vultr";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = version;
|
|
|
|
hash = "sha256-sHCZ8Csxs5rwg1ZG++hP3MfK7ldeAdqm5ta9tEXeW+I=";
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
xbox-webapi = super.xbox-webapi.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.0.11";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenXbox";
|
|
|
|
repo = "xbox-webapi-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-fzMB+I8+ZTJUiZovcuj+d5GdHY9BJyJd6j92EhJeIFI=";
|
|
|
|
};
|
|
|
|
postPatch = ''
|
|
|
|
sed -i '/pytest-runner/d' setup.py
|
|
|
|
'';
|
|
|
|
propagatedBuildInputs = with self; [
|
|
|
|
aiohttp
|
|
|
|
appdirs
|
|
|
|
ms-cv
|
|
|
|
pydantic
|
|
|
|
ecdsa
|
|
|
|
];
|
|
|
|
nativeCheckInputs = with self; [
|
|
|
|
aresponses
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
youtubeaio = super.youtubeaio.overridePythonAttrs (old: {
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# fails with pydantic v1
|
|
|
|
"--deselect=tests/test_video.py::test_fetch_video"
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
# internal python packages only consumed by home-assistant itself
|
2021-06-28 23:13:55 +00:00
|
|
|
home-assistant-frontend = self.callPackage ./frontend.nix { };
|
2023-02-02 18:25:31 +00:00
|
|
|
home-assistant-intents = self.callPackage ./intents.nix { };
|
2024-07-27 06:49:29 +00:00
|
|
|
homeassistant = self.toPythonModule home-assistant;
|
|
|
|
pytest-homeassistant-custom-component = self.callPackage ./pytest-homeassistant-custom-component.nix { };
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
python = python312.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = python;
|
2023-02-16 17:41:37 +00:00
|
|
|
packageOverrides = lib.composeManyExtensions (defaultOverrides ++ [ packageOverrides ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
componentPackages = import ./component-packages.nix;
|
|
|
|
|
|
|
|
availableComponents = builtins.attrNames componentPackages.components;
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
inherit (componentPackages) supportedComponentsWithTests;
|
|
|
|
|
|
|
|
getPackages = component: componentPackages.components.${component};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
componentBuildInputs = lib.concatMap (component: getPackages component python.pkgs) extraComponents;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Ensure that we are using a consistent package set
|
2022-01-19 23:45:15 +00:00
|
|
|
extraBuildInputs = extraPackages python.pkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Don't forget to run update-component-packages.py after updating
|
2024-10-04 16:56:33 +00:00
|
|
|
hassVersion = "2024.10.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "homeassistant";
|
|
|
|
version = assert (componentPackages.version == hassVersion); hassVersion;
|
2024-06-20 14:57:18 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
# check REQUIRED_PYTHON_VER in homeassistant/const.py
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = python.pythonOlder "3.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
# don't try and fail to strip 6600+ python files, it takes minutes!
|
|
|
|
dontStrip = true;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# Primary source is the git, which has the tests and allows bisecting the core
|
|
|
|
src = fetchFromGitHub {
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "home-assistant";
|
2020-05-29 06:06:01 +00:00
|
|
|
repo = "core";
|
2022-12-28 21:21:41 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-X7atEjhw6QcS5xNiW+17/vrwqjCL4N3VocxUTELLXgo=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Secondary source is pypi sdist for translations
|
|
|
|
sdist = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-SHNs/zLyNVi0uGguRTWMnt9UpPYEFJbrfwBYFz+q5Nk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = with python.pkgs; [
|
2023-02-09 11:40:11 +00:00
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
pythonRelaxDeps = [
|
2024-04-21 15:54:59 +00:00
|
|
|
"aiohttp"
|
2024-02-29 20:09:43 +00:00
|
|
|
"attrs"
|
2024-04-21 15:54:59 +00:00
|
|
|
"bcrypt"
|
2024-01-02 11:29:13 +00:00
|
|
|
"ciso8601"
|
2024-04-21 15:54:59 +00:00
|
|
|
"cryptography"
|
2024-05-15 15:35:15 +00:00
|
|
|
"jinja2"
|
2024-04-21 15:54:59 +00:00
|
|
|
"hass-nabucasa"
|
|
|
|
"httpx"
|
2024-01-02 11:29:13 +00:00
|
|
|
"orjson"
|
2024-04-21 15:54:59 +00:00
|
|
|
"pillow"
|
2024-09-19 14:19:46 +00:00
|
|
|
"pyjwt"
|
2024-01-13 08:15:51 +00:00
|
|
|
"pyopenssl"
|
2024-09-19 14:19:46 +00:00
|
|
|
"pyyaml"
|
2024-06-20 14:57:18 +00:00
|
|
|
"requests"
|
2024-05-15 15:35:15 +00:00
|
|
|
"sqlalchemy"
|
2024-01-02 11:29:13 +00:00
|
|
|
"typing-extensions"
|
2024-01-13 08:15:51 +00:00
|
|
|
"urllib3"
|
2024-10-04 16:56:33 +00:00
|
|
|
"uv"
|
2024-09-19 14:19:46 +00:00
|
|
|
"yarl"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# extract translations from pypi sdist
|
2023-03-04 12:14:45 +00:00
|
|
|
prePatch = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
tar --extract --gzip --file $sdist --strip-components 1 --wildcards "**/translations"
|
2023-03-04 12:14:45 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
# leave this in, so users don't have to constantly update their downstream patch handling
|
2021-03-09 03:18:52 +00:00
|
|
|
patches = [
|
2023-11-16 04:20:00 +00:00
|
|
|
# Follow symlinks in /var/lib/hass/www
|
2024-02-29 20:09:43 +00:00
|
|
|
./patches/static-follow-symlinks.patch
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# Patch path to ffmpeg binary
|
2021-12-19 01:06:50 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./patches/ffmpeg-path.patch;
|
2024-09-19 14:19:46 +00:00
|
|
|
ffmpeg = "${lib.getExe ffmpeg-headless}";
|
2021-12-19 01:06:50 +00:00
|
|
|
})
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2020-11-06 00:33:48 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postPatch = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
substituteInPlace tests/test_config.py --replace-fail '"/usr"' "\"$NIX_BUILD_TOP/media\""
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
substituteInPlace pyproject.toml --replace-fail "wheel~=0.43.0" wheel
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
sed -i 's/setuptools[~=]/setuptools>/' pyproject.toml
|
|
|
|
sed -i 's/wheel[~=]/wheel>/' pyproject.toml
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = with python.pkgs; [
|
2023-02-09 11:40:11 +00:00
|
|
|
# Only packages required in pyproject.toml
|
2024-05-15 15:35:15 +00:00
|
|
|
aiodns
|
2024-10-04 16:56:33 +00:00
|
|
|
aiohasupervisor
|
2021-02-05 17:12:51 +00:00
|
|
|
aiohttp
|
2024-01-13 08:15:51 +00:00
|
|
|
aiohttp-cors
|
2024-06-20 14:57:18 +00:00
|
|
|
aiohttp-fast-zlib
|
|
|
|
aiozoneinfo
|
2021-02-05 17:12:51 +00:00
|
|
|
astral
|
2024-04-21 15:54:59 +00:00
|
|
|
async-interrupt
|
2022-07-14 12:49:19 +00:00
|
|
|
atomicwrites-homeassistant
|
2021-02-05 17:12:51 +00:00
|
|
|
attrs
|
2021-02-13 14:23:35 +00:00
|
|
|
awesomeversion
|
2021-02-05 17:12:51 +00:00
|
|
|
bcrypt
|
|
|
|
certifi
|
|
|
|
ciso8601
|
|
|
|
cryptography
|
2024-04-21 15:54:59 +00:00
|
|
|
fnv-hash-fast
|
|
|
|
hass-nabucasa
|
2022-08-12 12:06:08 +00:00
|
|
|
home-assistant-bluetooth
|
2024-05-15 15:35:15 +00:00
|
|
|
httpx
|
2021-12-30 13:39:12 +00:00
|
|
|
ifaddr
|
2021-02-05 17:12:51 +00:00
|
|
|
jinja2
|
2022-07-14 12:49:19 +00:00
|
|
|
lru-dict
|
|
|
|
orjson
|
2023-10-09 19:29:22 +00:00
|
|
|
packaging
|
2024-04-21 15:54:59 +00:00
|
|
|
pillow
|
|
|
|
psutil-home-assistant
|
2021-02-05 17:12:51 +00:00
|
|
|
pyjwt
|
2024-05-15 15:35:15 +00:00
|
|
|
pyopenssl
|
2021-02-05 17:12:51 +00:00
|
|
|
python-slugify
|
|
|
|
pyyaml
|
|
|
|
requests
|
2024-04-21 15:54:59 +00:00
|
|
|
sqlalchemy
|
|
|
|
typing-extensions
|
2023-04-12 12:48:02 +00:00
|
|
|
ulid-transform
|
2024-04-21 15:54:59 +00:00
|
|
|
urllib3
|
2024-10-04 16:56:33 +00:00
|
|
|
uv
|
2021-02-05 17:12:51 +00:00
|
|
|
voluptuous
|
2024-07-27 06:49:29 +00:00
|
|
|
voluptuous-openapi
|
2021-02-05 17:12:51 +00:00
|
|
|
voluptuous-serialize
|
|
|
|
yarl
|
2024-01-02 11:29:13 +00:00
|
|
|
# REQUIREMENTS in homeassistant/auth/mfa_modules/totp.py and homeassistant/auth/mfa_modules/notify.py
|
|
|
|
pyotp
|
|
|
|
pyqrcode
|
2023-02-22 10:55:15 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip";
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
# upstream only tests on Linux, so do we.
|
2024-09-26 11:04:55 +00:00
|
|
|
doCheck = stdenv.hostPlatform.isLinux;
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python.pkgs; [
|
2021-05-20 23:08:51 +00:00
|
|
|
# test infrastructure (selectively from requirement_test.txt)
|
2021-12-06 16:07:01 +00:00
|
|
|
freezegun
|
2023-01-11 07:51:40 +00:00
|
|
|
pytest-asyncio
|
2021-02-05 17:12:51 +00:00
|
|
|
pytest-aiohttp
|
2023-02-09 11:40:11 +00:00
|
|
|
pytest-freezer
|
2021-05-20 23:08:51 +00:00
|
|
|
pytest-mock
|
2021-03-09 03:18:52 +00:00
|
|
|
pytest-rerunfailures
|
2021-12-06 16:07:01 +00:00
|
|
|
pytest-socket
|
2023-02-09 11:40:11 +00:00
|
|
|
pytest-timeout
|
2023-01-11 07:51:40 +00:00
|
|
|
pytest-unordered
|
2021-02-05 17:12:51 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
2021-03-09 03:18:52 +00:00
|
|
|
respx
|
2023-03-04 12:14:45 +00:00
|
|
|
syrupy
|
2023-02-09 11:40:11 +00:00
|
|
|
tomli
|
|
|
|
# Sneakily imported in tests/conftest.py
|
|
|
|
paho-mqtt
|
2024-05-15 15:35:15 +00:00
|
|
|
# Used in tests/non_packaged_scripts/test_alexa_locales.py
|
|
|
|
beautifulsoup4
|
2022-01-19 23:45:15 +00:00
|
|
|
] ++ lib.concatMap (component: getPackages component python.pkgs) [
|
|
|
|
# some components are needed even if tests in tests/components are disabled
|
2020-10-11 12:50:04 +00:00
|
|
|
"default_config"
|
2021-02-05 17:12:51 +00:00
|
|
|
"hue"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
pytestFlagsArray = [
|
2021-05-20 23:08:51 +00:00
|
|
|
# assign tests grouped by file to workers
|
|
|
|
"--dist loadfile"
|
2021-03-09 03:18:52 +00:00
|
|
|
# retry racy tests that end in "RuntimeError: Event loop is closed"
|
|
|
|
"--reruns 3"
|
|
|
|
"--only-rerun RuntimeError"
|
2021-05-20 23:08:51 +00:00
|
|
|
# enable full variable printing on error
|
|
|
|
"--showlocals"
|
2023-02-09 11:40:11 +00:00
|
|
|
# AssertionError: assert 1 == 0
|
|
|
|
"--deselect tests/test_config.py::test_merge"
|
2024-05-15 15:35:15 +00:00
|
|
|
# AssertionError: assert 6 == 5
|
|
|
|
"--deselect=tests/helpers/test_translation.py::test_caching"
|
|
|
|
# assert "Detected that integration 'hue' attempted to create an asyncio task from a thread at homeassistant/components/hue/light.py, line 23
|
|
|
|
"--deselect=tests/util/test_async.py::test_create_eager_task_from_thread_in_integration"
|
2024-07-27 06:49:29 +00:00
|
|
|
# Services were renamed to Actions in language strings, but the tests are lagging behind
|
|
|
|
"--deselect=tests/test_core.py::test_serviceregistry_service_that_not_exists"
|
|
|
|
"--deselect=tests/test_core.py::test_services_call_return_response_requires_blocking"
|
|
|
|
"--deselect=tests/test_core.py::test_serviceregistry_return_response_arguments"
|
|
|
|
"--deselect=tests/helpers/test_script.py::test_parallel_error"
|
|
|
|
"--deselect=tests/helpers/test_script.py::test_propagate_error_service_not_found"
|
|
|
|
"--deselect=tests/helpers/test_script.py::test_continue_on_error_automation_issue"
|
2024-10-04 16:56:33 +00:00
|
|
|
# checks whether pip is installed
|
|
|
|
"--deselect=tests/util/test_package.py::test_check_package_fragment"
|
2021-05-20 23:08:51 +00:00
|
|
|
# tests are located in tests/
|
|
|
|
"tests"
|
2022-01-19 23:45:15 +00:00
|
|
|
];
|
2020-10-11 12:50:04 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
disabledTestPaths = [
|
2022-06-16 17:23:12 +00:00
|
|
|
# we neither run nor distribute hassfest
|
|
|
|
"tests/hassfest"
|
|
|
|
# we don't care about code quality
|
|
|
|
"tests/pylint"
|
2024-09-19 14:19:46 +00:00
|
|
|
# redundant component import test, which would make debugpy & sentry expensive to review
|
|
|
|
"tests/test_circular_imports.py"
|
2021-03-09 03:18:52 +00:00
|
|
|
# don't bulk test all components
|
|
|
|
"tests/components"
|
2020-10-11 12:50:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
2021-04-08 16:26:57 +00:00
|
|
|
export HOME="$TEMPDIR"
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
# the tests require the existance of a media dir
|
2024-09-19 14:19:46 +00:00
|
|
|
mkdir "$NIX_BUILD_TOP"/media
|
2021-04-08 16:26:57 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# put ping binary into PATH, e.g. for wake_on_lan tests
|
|
|
|
export PATH=${inetutils}/bin:$PATH
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
passthru = {
|
2022-01-19 23:45:15 +00:00
|
|
|
inherit
|
|
|
|
availableComponents
|
|
|
|
extraComponents
|
|
|
|
getPackages
|
|
|
|
python
|
|
|
|
supportedComponentsWithTests;
|
2023-07-15 17:15:38 +00:00
|
|
|
pythonPath = python.pkgs.makePythonPath (componentBuildInputs ++ extraBuildInputs);
|
2023-03-15 16:39:30 +00:00
|
|
|
frontend = python.pkgs.home-assistant-frontend;
|
2023-02-02 18:25:31 +00:00
|
|
|
intents = python.pkgs.home-assistant-intents;
|
2020-06-15 15:56:04 +00:00
|
|
|
tests = {
|
2022-01-19 23:45:15 +00:00
|
|
|
nixos = nixosTests.home-assistant;
|
|
|
|
components = callPackage ./tests.nix { };
|
2022-12-28 21:21:41 +00:00
|
|
|
version = testers.testVersion {
|
|
|
|
package = home-assistant;
|
|
|
|
command = "hass --version";
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
withoutCheckDeps = home-assistant.overridePythonAttrs {
|
|
|
|
pname = "home-assistant-without-check-deps";
|
|
|
|
doCheck = false;
|
|
|
|
};
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://home-assistant.io/";
|
2020-10-16 20:44:37 +00:00
|
|
|
description = "Open source home automation that puts local control and privacy first";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2021-04-08 16:26:57 +00:00
|
|
|
maintainers = teams.home-assistant.members;
|
2021-04-05 15:23:46 +00:00
|
|
|
platforms = platforms.linux;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "hass";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|