git.iko.soy/typeable/nixpkgs
on master help sign in
turses: override tweepy
commit5470dfc4ae86e01a33522c0a590114ddaaf399cb authorFabian Affolter <mail@fabian-affolter.ch> dateSat 13 Nov 2021, 00:50 (5 years ago) parentc0cdc7d
1 file changed+51−15
pkgs/applications/networking/instant-messengers/turses/default.nix+51−15
pkgs/applications/networking/instant-messengers/turses/default.nix+51−15
@@ -1,7 +1,30 @@
1−{ lib, fetchpatch, python3Packages }:
1+{ lib
2+, fetchpatch
3+, fetchFromGitHub
4+, python3
5+}:
26
3−with lib;
4−with python3Packages;
7+let
8+ py = python3.override {
9+ packageOverrides = self: super: {
10+
11+ # Support for later tweepy releases is missing
12+ # https://github.com/louipc/turses/issues/12
13+ tweepy = super.tweepy.overridePythonAttrs (oldAttrs: rec {
14+ version = "3.10.0";
15+
16+ src = fetchFromGitHub {
17+ owner = "tweepy";
18+ repo = "tweepy";
19+ rev = "v${version}";
20+ sha256 = "0k4bdlwjna6f1k19jki4xqgckrinkkw8b9wihzymr1l04rwd05nw";
21+ };
22+ doCheck = false;
23+ });
24+ };
25+ };
26+in
27+with py.pkgs;
528
629buildPythonPackage rec {
730 pname = "turses";
@@ -12,8 +35,18 @@ buildPythonPackage rec {
1235 sha256 = "15mkhm3b5ka42h8qph0mhh8izfc1200v7651c62k7ldcs50ib9j6";
1336 };
1437
15− checkInputs = [ mock pytest coverage tox ];
16− propagatedBuildInputs = [ urwid tweepy future ];
38+ propagatedBuildInputs = with py.pkgs; [
39+ urwid
40+ tweepy
41+ future
42+ ];
43+
44+ checkInputs = with py.pkgs; [
45+ mock
46+ pytest
47+ coverage
48+ tox
49+ ];
1750
1851 LC_ALL = "en_US.UTF-8";
1952
@@ -29,6 +62,17 @@ buildPythonPackage rec {
2962 })
3063 ];
3164
65+ postPatch = ''
66+ substituteInPlace setup.py \
67+ --replace "urwid==1.3.0" "urwid" \
68+ --replace "future==0.14.3" "future" \
69+ --replace "tweepy==3.3.0" "tweepy"
70+ substituteInPlace tests/test_config.py \
71+ --replace "config.generate_config_file.assert_called_once()" "assert config.generate_config_file.call_count == 1"
72+ substituteInPlace tests/test_meta.py \
73+ --replace "self.observer.update.assert_called_once()" "assert self.observer.update.call_count == 1"
74+ '';
75+
3276 checkPhase = ''
3377 TMP_TURSES=`echo turses-$RANDOM`
3478 mkdir $TMP_TURSES
@@ -36,18 +80,10 @@ buildPythonPackage rec {
3680 rm -rf $TMP_TURSES
3781 '';
3882
39− postPatch = ''
40− sed -i -e 's|urwid==1.3.0|urwid==${getVersion urwid}|' setup.py
41− sed -i -e "s|future==0.14.3|future==${getVersion future}|" setup.py
42− sed -i -e "s|tweepy==3.3.0|tweepy==${getVersion tweepy}|" setup.py
43− sed -i -e "s|config.generate_config_file.assert_called_once()|assert config.generate_config_file.call_count == 1|" tests/test_config.py
44− sed -i -e "s|self.observer.update.assert_called_once()|assert self.observer.update.call_count == 1|" tests/test_meta.py
45− '';
46−
4783 meta = with lib; {
48− homepage = "https://github.com/louipc/turses";
4984 description = "A Twitter client for the console";
50− license = licenses.gpl3;
85+ homepage = "https://github.com/louipc/turses";
86+ license = licenses.gpl3Only;
5187 maintainers = with maintainers; [ ];
5288 platforms = platforms.unix;
5389 };