git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #145698 from fabaff/bump-tweepy

python3Packages.tweepy: 4.0.1 -> 4.3.0

commite0cd6b7ff51b54a6d44e9c897abb684f2bced40e authorFabian Affolter <fabian@affolter-engineering.ch> dateSat 13 Nov 2021, 10:30 (5 years ago) parent7e0d1355470dfc
3 files changed+113−27
pkgs/applications/networking/instant-messengers/turses/default.nix+51−15 pkgs/development/python-modules/tweepy/default.nix+36−8 pkgs/tools/security/ioccheck/default.nix+26−4
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 };
pkgs/development/python-modules/tweepy/default.nix+36−8
@@ -1,20 +1,48 @@
1−{ lib, buildPythonPackage, fetchPypi, requests, six, requests_oauthlib }:
1+{ lib
2+, aiohttp
3+, buildPythonPackage
4+, fetchFromGitHub
5+, oauthlib
6+, requests
7+, pythonOlder
8+, vcrpy
9+, pytestCheckHook
10+, requests_oauthlib
11+}:
212
313buildPythonPackage rec {
414 pname = "tweepy";
5− version = "4.0.1";
15+ version = "4.3.0";
16+ format = "setuptools";
617
7− src = fetchPypi {
8− inherit pname version;
9− sha256 = "3bbb14a0ddef1ca8c9e8686ab2f647163afa02a6bab83507335ce647e9653a90";
18+ disabled = pythonOlder "3.6";
19+
20+ src = fetchFromGitHub {
21+ owner = pname;
22+ repo = pname;
23+ rev = "v${version}";
24+ sha256 = "sha256-lS/98DRpJH1UGGNzwqVVUJOeul+BX+I3e+ysmC0oL3I=";
1025 };
1126
12− doCheck = false;
13− propagatedBuildInputs = [ requests six requests_oauthlib ];
27+ propagatedBuildInputs = [
28+ aiohttp
29+ oauthlib
30+ requests
31+ requests_oauthlib
32+ ];
33+
34+ checkInputs = [
35+ pytestCheckHook
36+ vcrpy
37+ ];
38+
39+ pythonImportsCheck = [
40+ "tweepy"
41+ ];
1442
1543 meta = with lib; {
1644 homepage = "https://github.com/tweepy/tweepy";
17− description = "Twitter library for python";
45+ description = "Twitter library for Python";
1846 license = licenses.mit;
1947 maintainers = with maintainers; [ ];
2048 };
pkgs/tools/security/ioccheck/default.nix+26−4
@@ -3,7 +3,29 @@
33, python3
44}:
55
6−python3.pkgs.buildPythonApplication rec {
6+let
7+ py = python3.override {
8+ packageOverrides = self: super: {
9+
10+ # Support for later tweepy releases is missing
11+ # https://github.com/ranguli/ioccheck/issues/70
12+ tweepy = super.tweepy.overridePythonAttrs (oldAttrs: rec {
13+ version = "3.10.0";
14+
15+ src = fetchFromGitHub {
16+ owner = "tweepy";
17+ repo = "tweepy";
18+ rev = "v${version}";
19+ sha256 = "0k4bdlwjna6f1k19jki4xqgckrinkkw8b9wihzymr1l04rwd05nw";
20+ };
21+ doCheck = false;
22+ });
23+ };
24+ };
25+in
26+with py.pkgs;
27+
28+buildPythonApplication rec {
729 pname = "ioccheck";
830 version = "unstable-2021-09-29";
931 format = "pyproject";
@@ -15,11 +37,11 @@ python3.pkgs.buildPythonApplication rec {
1537 sha256 = "0lgqypcd5lzb2yqd5lr02pba24m26ghly4immxgz13svi8f6vzm9";
1638 };
1739
18− nativeBuildInputs = with python3.pkgs; [
40+ nativeBuildInputs = with py.pkgs; [
1941 poetry-core
2042 ];
2143
22− propagatedBuildInputs = with python3.pkgs; [
44+ propagatedBuildInputs = with py.pkgs; [
2345 backoff
2446 click
2547 emoji
@@ -34,7 +56,7 @@ python3.pkgs.buildPythonApplication rec {
3456 vt-py
3557 ];
3658
37− checkInputs = with python3.pkgs; [
59+ checkInputs = with py.pkgs; [
3860 pytestCheckHook
3961 ];
4062