Skip to content

Commit dd63af3

Browse files
committed
style: fix ruff complaints
Signed-off-by: Matej Focko <[email protected]>
1 parent 25ea161 commit dd63af3

7 files changed

+98
-44
lines changed

examples/list_prs_since_release.ipynb

+8-7
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
},
4646
"outputs": [
4747
{
48-
"output_type": "stream",
4948
"name": "stdout",
49+
"output_type": "stream",
5050
"text": "Bigger release from 2020-05-06 15:53:23.\n"
5151
}
5252
],
@@ -69,6 +69,7 @@
6969
"outputs": [],
7070
"source": [
7171
"from ogr.abstract import PRStatus\n",
72+
"\n",
7273
"prs = project.get_pr_list(status=PRStatus.all)"
7374
]
7475
},
@@ -87,8 +88,8 @@
8788
},
8889
"outputs": [
8990
{
90-
"output_type": "stream",
9191
"name": "stdout",
92+
"output_type": "stream",
9293
"text": "#435: Sourcery refactor\n#433: 0.12.2 release\n#431: Job metadata key 'dist_git_branch' was renamed to 'dist_git_branches'\n#430: Replace Python version glob with macro\n#429: Fix get_file_content() returning bytes\n#428: Copr build for master and releases\n#419: Pull requests on Gitlab\n#427: Zuul & pre-commit related changes\n#425: Implement PagurePullRequest.get_flags() (not merged)\n#426: Improve the message when marking issues as stale\n#411: Creating PRs from `fork` to `other-fork` on Github\n#422: 0.12.1 release\n#418: Fix factory.get_project\n#415: Add PullRequest.patch property\n#410: GitHub: query only one user when telling if a user can merge PRs\n"
9394
}
9495
],
@@ -101,6 +102,10 @@
101102
}
102103
],
103104
"metadata": {
105+
"kernelspec": {
106+
"display_name": "Python 3.8.3 64-bit",
107+
"name": "python38364bit3ec8239d0440456baaf370e87148ec69"
108+
},
104109
"language_info": {
105110
"codemirror_mode": {
106111
"name": "ipython",
@@ -113,11 +118,7 @@
113118
"pygments_lexer": "ipython3",
114119
"version": "3.8.3-final"
115120
},
116-
"orig_nbformat": 2,
117-
"kernelspec": {
118-
"name": "python38364bit3ec8239d0440456baaf370e87148ec69",
119-
"display_name": "Python 3.8.3 64-bit"
120-
}
121+
"orig_nbformat": 2
121122
},
122123
"nbformat": 4,
123124
"nbformat_minor": 2

examples/releases.ipynb

+80-28
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,11 @@
11
{
2-
"metadata": {
3-
"language_info": {
4-
"codemirror_mode": {
5-
"name": "ipython",
6-
"version": 3
7-
},
8-
"file_extension": ".py",
9-
"mimetype": "text/x-python",
10-
"name": "python",
11-
"nbconvert_exporter": "python",
12-
"pygments_lexer": "ipython3",
13-
"version": "3.8.4-final"
14-
},
15-
"orig_nbformat": 2,
16-
"kernelspec": {
17-
"name": "python38364bit3ec8239d0440456baaf370e87148ec69",
18-
"display_name": "Python 3.8.3 64-bit"
19-
}
20-
},
21-
"nbformat": 4,
22-
"nbformat_minor": 2,
232
"cells": [
243
{
4+
"cell_type": "markdown",
5+
"metadata": {},
256
"source": [
267
"# Listing releases"
27-
],
28-
"cell_type": "markdown",
29-
"metadata": {}
8+
]
309
},
3110
{
3211
"cell_type": "code",
@@ -60,7 +39,10 @@
6039
"import datetime\n",
6140
"\n",
6241
"since = datetime.datetime(year=2020, month=1, day=1)\n",
63-
"releases_in_20 = filter(lambda release: datetime.datetime.fromisoformat(release.created_at.split('.')[0]) >= since, all_releases)"
42+
"releases_in_20 = filter(\n",
43+
" lambda release: datetime.datetime.fromisoformat(release.created_at.split('.')[0]) >= since,\n",
44+
" all_releases,\n",
45+
")"
6446
]
6547
},
6648
{
@@ -71,15 +53,85 @@
7153
},
7254
"outputs": [
7355
{
74-
"output_type": "stream",
7556
"name": "stdout",
76-
"text": "v0.7.0: aa672412a1942af47801ded9f466fa1bf6139c04\n(https://gitlab.com/Isleward/isleward/-/archive/v0.7.0/isleward-v0.7.0.tar.gz)\nv0.6.1.2: 17584a7a97d21a5b01ece52139922b2dbea771da\n(https://gitlab.com/Isleward/isleward/-/archive/v0.6.1.2/isleward-v0.6.1.2.tar.gz)\nv0.6.1.1: 4c3229825dd8dc7414a52e6028bb084e47db4022\n(https://gitlab.com/Isleward/isleward/-/archive/v0.6.1.1/isleward-v0.6.1.1.tar.gz)\nv0.6.1: a77c207652946f2282efd73867dd35a595139991\n(https://gitlab.com/Isleward/isleward/-/archive/v0.6.1/isleward-v0.6.1.tar.gz)\nv0.6.0.3: e921bccd0d8efd2dcb69ff1ca5501c8fab9b47bf\n(https://gitlab.com/Isleward/isleward/-/archive/v0.6.0.3/isleward-v0.6.0.3.tar.gz)\nv0.6.0.2: 91d0c51f23dbd7d10ca40cf89220335366462428\n(https://gitlab.com/Isleward/isleward/-/archive/v0.6.0.2/isleward-v0.6.0.2.tar.gz)\nv0.6.0.1: 426081daec84f7c99549f605cec6647c7273d5bd\n(https://gitlab.com/Isleward/isleward/-/archive/v0.6.0.1/isleward-v0.6.0.1.tar.gz)\nv0.6: 2b36286a41dc97a7fd80d0b3e5720c6ffb44ebf7\n(https://gitlab.com/Isleward/isleward/-/archive/v0.6/isleward-v0.6.tar.gz)\nv0.5.1.1: 0fd19a0704bf19addfa53e09ad9c8087d004af0a\n(https://gitlab.com/Isleward/isleward/-/archive/v0.5.1.1/isleward-v0.5.1.1.tar.gz)\nv0.5.1: 5ce3bb47e5945499b5152f9287b0e4934a8d9037\n(https://gitlab.com/Isleward/isleward/-/archive/v0.5.1/isleward-v0.5.1.tar.gz)\nv0.5: 7f1d3fb33a57144ce8427e448a8661ce844098b5\n(https://gitlab.com/Isleward/isleward/-/archive/v0.5/isleward-v0.5.tar.gz)\nv0.4.4.5: fc06a73c18e6c5b5b5796ecc41d85de40b71128c\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.5/isleward-v0.4.4.5.tar.gz)\nv0.4.4.4: 75ba773adb0328c8e3bcd52d55fe9090c84aa0b6\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.4/isleward-v0.4.4.4.tar.gz)\nv0.4.4.3: f5e937eb0828156a170bd0c4e6d2d5786d759abd\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.3/isleward-v0.4.4.3.tar.gz)\nv0.4.4.2: 4f9379a2d831b0d418c1c7843160f7f7e01e59d6\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.2/isleward-v0.4.4.2.tar.gz)\nv0.4.4.1: 2279d5d59e96d9285be90d4050e3e4f385533bfc\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.1/isleward-v0.4.4.1.tar.gz)\nv0.4.4: 99b5629b21df552fd50899eda5d13640a007d8f8\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4/isleward-v0.4.4.tar.gz)\nv0.4.3.1: e971964eefcfd8f1e3d6cea5e8c16babbd016249\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.3.1/isleward-v0.4.3.1.tar.gz)\nv0.4.3: 88f2e24755addeadfa164890623729965b05287b\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.3/isleward-v0.4.3.tar.gz)\nv0.4.2.4: 7cc57bde958824af45d30d5bd6dd51e4de7fc099\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.4/isleward-v0.4.2.4.tar.gz)\nv0.4.2.3: 81b8761bb8f5b3e3179ae1fd529746f18b70577c\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.3/isleward-v0.4.2.3.tar.gz)\nv0.4.2.2: 2980baa1eedb744673ff7c2efea015b81f6c0310\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.2/isleward-v0.4.2.2.tar.gz)\nv0.4.2.1: 66c156e29ac2c10a7c7159e6c537083b21d8a32f\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.1/isleward-v0.4.2.1.tar.gz)\nv0.4.2: 96e988416c76da5b37709ac0ce282c7b0d29c7fc\n(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2/isleward-v0.4.2.tar.gz)\n"
57+
"output_type": "stream",
58+
"text": [
59+
"v0.7.0: aa672412a1942af47801ded9f466fa1bf6139c04\n",
60+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.7.0/isleward-v0.7.0.tar.gz)\n",
61+
"v0.6.1.2: 17584a7a97d21a5b01ece52139922b2dbea771da\n",
62+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.6.1.2/isleward-v0.6.1.2.tar.gz)\n",
63+
"v0.6.1.1: 4c3229825dd8dc7414a52e6028bb084e47db4022\n",
64+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.6.1.1/isleward-v0.6.1.1.tar.gz)\n",
65+
"v0.6.1: a77c207652946f2282efd73867dd35a595139991\n",
66+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.6.1/isleward-v0.6.1.tar.gz)\n",
67+
"v0.6.0.3: e921bccd0d8efd2dcb69ff1ca5501c8fab9b47bf\n",
68+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.6.0.3/isleward-v0.6.0.3.tar.gz)\n",
69+
"v0.6.0.2: 91d0c51f23dbd7d10ca40cf89220335366462428\n",
70+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.6.0.2/isleward-v0.6.0.2.tar.gz)\n",
71+
"v0.6.0.1: 426081daec84f7c99549f605cec6647c7273d5bd\n",
72+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.6.0.1/isleward-v0.6.0.1.tar.gz)\n",
73+
"v0.6: 2b36286a41dc97a7fd80d0b3e5720c6ffb44ebf7\n",
74+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.6/isleward-v0.6.tar.gz)\n",
75+
"v0.5.1.1: 0fd19a0704bf19addfa53e09ad9c8087d004af0a\n",
76+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.5.1.1/isleward-v0.5.1.1.tar.gz)\n",
77+
"v0.5.1: 5ce3bb47e5945499b5152f9287b0e4934a8d9037\n",
78+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.5.1/isleward-v0.5.1.tar.gz)\n",
79+
"v0.5: 7f1d3fb33a57144ce8427e448a8661ce844098b5\n",
80+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.5/isleward-v0.5.tar.gz)\n",
81+
"v0.4.4.5: fc06a73c18e6c5b5b5796ecc41d85de40b71128c\n",
82+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.5/isleward-v0.4.4.5.tar.gz)\n",
83+
"v0.4.4.4: 75ba773adb0328c8e3bcd52d55fe9090c84aa0b6\n",
84+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.4/isleward-v0.4.4.4.tar.gz)\n",
85+
"v0.4.4.3: f5e937eb0828156a170bd0c4e6d2d5786d759abd\n",
86+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.3/isleward-v0.4.4.3.tar.gz)\n",
87+
"v0.4.4.2: 4f9379a2d831b0d418c1c7843160f7f7e01e59d6\n",
88+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.2/isleward-v0.4.4.2.tar.gz)\n",
89+
"v0.4.4.1: 2279d5d59e96d9285be90d4050e3e4f385533bfc\n",
90+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4.1/isleward-v0.4.4.1.tar.gz)\n",
91+
"v0.4.4: 99b5629b21df552fd50899eda5d13640a007d8f8\n",
92+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.4/isleward-v0.4.4.tar.gz)\n",
93+
"v0.4.3.1: e971964eefcfd8f1e3d6cea5e8c16babbd016249\n",
94+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.3.1/isleward-v0.4.3.1.tar.gz)\n",
95+
"v0.4.3: 88f2e24755addeadfa164890623729965b05287b\n",
96+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.3/isleward-v0.4.3.tar.gz)\n",
97+
"v0.4.2.4: 7cc57bde958824af45d30d5bd6dd51e4de7fc099\n",
98+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.4/isleward-v0.4.2.4.tar.gz)\n",
99+
"v0.4.2.3: 81b8761bb8f5b3e3179ae1fd529746f18b70577c\n",
100+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.3/isleward-v0.4.2.3.tar.gz)\n",
101+
"v0.4.2.2: 2980baa1eedb744673ff7c2efea015b81f6c0310\n",
102+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.2/isleward-v0.4.2.2.tar.gz)\n",
103+
"v0.4.2.1: 66c156e29ac2c10a7c7159e6c537083b21d8a32f\n",
104+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2.1/isleward-v0.4.2.1.tar.gz)\n",
105+
"v0.4.2: 96e988416c76da5b37709ac0ce282c7b0d29c7fc\n",
106+
"(https://gitlab.com/Isleward/isleward/-/archive/v0.4.2/isleward-v0.4.2.tar.gz)\n"
107+
]
77108
}
78109
],
79110
"source": [
80111
"for release in releases_in_20:\n",
81112
" print(f\"{release.title}: {release.git_tag.commit_sha}\\n({release.tarball_url})\")"
82113
]
83114
}
84-
]
115+
],
116+
"metadata": {
117+
"kernelspec": {
118+
"display_name": "Python 3.8.3 64-bit",
119+
"name": "python38364bit3ec8239d0440456baaf370e87148ec69"
120+
},
121+
"language_info": {
122+
"codemirror_mode": {
123+
"name": "ipython",
124+
"version": 3
125+
},
126+
"file_extension": ".py",
127+
"mimetype": "text/x-python",
128+
"name": "python",
129+
"nbconvert_exporter": "python",
130+
"pygments_lexer": "ipython3",
131+
"version": "3.8.4-final"
132+
},
133+
"orig_nbformat": 2
134+
},
135+
"nbformat": 4,
136+
"nbformat_minor": 2
85137
}

examples/syncing_labels.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
}
151151
],
152152
"source": [
153-
"wanted_labels = list(filter(lambda l: \"/\" in l.name, labels))\n",
153+
"wanted_labels = list(filter(lambda label: \"/\" in label.name, labels))\n",
154154
"\n",
155155
"wanted_labels"
156156
]

examples/user_owned_repositories.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"outputs": [],
3232
"source": [
3333
"import os\n",
34+
"\n",
3435
"TOKEN = os.environ.get(\"GITHUB_TOKEN\") # if variable is not set, you get `None`"
3536
]
3637
},
@@ -101,8 +102,8 @@
101102
},
102103
"outputs": [
103104
{
104-
"output_type": "stream",
105105
"name": "stdout",
106+
"output_type": "stream",
106107
"text": "mfocko/cascadia-code has 0 pull requests open\nmfocko/doom-emacs has 0 pull requests open\nmfocko/hello-world has 2 pull requests open\n"
107108
}
108109
],

tests/integration/github/test_generic_commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_get_tags(self):
146146

147147
def test_get_owners(self):
148148
owners = self.ogr_project.get_owners()
149-
assert ["packit"] == owners
149+
assert owners == ["packit"]
150150

151151
def test_issue_permissions(self):
152152
users = self.ogr_project.who_can_close_issue()

tests/unit/test_github.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from ogr.services.github.pull_request import GithubPullRequest
2121

2222

23-
@pytest.fixture()
23+
@pytest.fixture
2424
def github_project(mock_github_repo):
2525
github_project = GithubProject(
2626
repo="test_repo",
@@ -42,15 +42,15 @@ def github_project(mock_github_repo):
4242
return github_project
4343

4444

45-
@pytest.fixture()
45+
@pytest.fixture
4646
def mock_pull_request():
4747
def mock_pull_request_factory(id):
4848
return flexmock(id=id)
4949

5050
return mock_pull_request_factory
5151

5252

53-
@pytest.fixture()
53+
@pytest.fixture
5454
def mock_github_repo(mock_pull_request):
5555
def mock_github_repo_factory():
5656
return flexmock(create_pull=mock_pull_request(42))
@@ -154,7 +154,7 @@ def test_create_github_check_run_output(
154154
assert create_github_check_run_output(title, summary, text) == expected
155155

156156

157-
@pytest.fixture()
157+
@pytest.fixture
158158
def github_service_with_multiple_auth_methods():
159159
return GithubService(
160160
token="abcdef",
@@ -182,7 +182,7 @@ def test_set_reset_customized_auth_method(github_service_with_multiple_auth_meth
182182
assert isinstance(service.authentication, Tokman)
183183

184184

185-
@pytest.fixture()
185+
@pytest.fixture
186186
def github_service_with_one_auth_method():
187187
return GithubService(
188188
tokman_instance_url="http://tokman:8080",

tests/unit/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from ogr.utils import filter_comments, search_in_comments
1010

1111

12-
@pytest.fixture()
12+
@pytest.fixture
1313
def comments():
1414
return [
1515
PRComment(

0 commit comments

Comments
 (0)