python3Packages.plyer: Maintain abit

- format = "setuptools" -> pyproject = true, add setuptools to build-system
- --replace -> --replace-fail
- Stop deleting examples dir, has seemingly no effect on the resulting output
- Drop meta-wide "with lib"
- Use writableTmpDirAsHomeHook
- Formatting

OPNA2608 0d76146b 50d67d02

+14 -8
+14 -8
pkgs/development/python-modules/plyer/default.nix
··· 6 6 fetchpatch, 7 7 keyring, 8 8 pytestCheckHook, 9 + setuptools, 10 + writableTmpDirAsHomeHook, 9 11 }: 10 12 11 13 buildPythonPackage rec { 12 14 pname = "plyer"; 13 15 version = "2.1.0"; 14 - format = "setuptools"; 16 + pyproject = true; 15 17 16 18 src = fetchFromGitHub { 17 19 owner = "kivy"; ··· 45 47 ]; 46 48 47 49 postPatch = '' 48 - rm -r examples 49 50 # remove all the wifi stuff. Depends on a python wifi module that has not been updated since 2016 50 51 find -iname "wifi*" -exec rm {} \; 51 52 substituteInPlace plyer/__init__.py \ 52 - --replace "wifi = Proxy('wifi', facades.Wifi)" "" \ 53 - --replace "'wifi', " "" 53 + --replace-fail "wifi = Proxy('wifi', facades.Wifi)" "" \ 54 + --replace-fail "'wifi', " "" 54 55 substituteInPlace plyer/facades/__init__.py \ 55 - --replace "from plyer.facades.wifi import Wifi" "" 56 + --replace-fail "from plyer.facades.wifi import Wifi" "" 56 57 ''; 57 58 59 + build-system = [ 60 + setuptools 61 + ]; 62 + 58 63 propagatedBuildInputs = [ keyring ]; 59 64 60 65 nativeCheckInputs = [ 61 66 pytestCheckHook 67 + writableTmpDirAsHomeHook 62 68 ]; 63 69 64 70 enabledTestPaths = [ "plyer/tests" ]; ··· 69 75 # The test and the API under test do work outside the nix build. 70 76 "test_uniqueid" 71 77 ]; 78 + 72 79 preCheck = '' 73 - HOME=$(mktemp -d) 74 80 mkdir -p $HOME/.config/ $HOME/Pictures 75 81 ''; 76 82 77 83 pythonImportsCheck = [ "plyer" ]; 78 84 79 - meta = with lib; { 85 + meta = { 80 86 broken = stdenv.hostPlatform.isDarwin; 81 87 description = "Plyer is a platform-independent api to use features commonly found on various platforms"; 82 88 homepage = "https://github.com/kivy/plyer"; 83 - license = licenses.mit; 89 + license = lib.licenses.mit; 84 90 teams = [ 85 91 lib.teams.ngi 86 92 ];