Skip to content

Commit b498ebd

Browse files
authored
Merge pull request #1429 from JohnVillalovos/jlvillal/flake8
chore: have flake8 check the entire project
2 parents 98891eb + ab343ef commit b498ebd

File tree

12 files changed

+22
-27
lines changed

12 files changed

+22
-27
lines changed

docs/conf.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
import os
1919
import sys
2020

21-
import sphinx
21+
import gitlab
2222

2323
sys.path.append("../")
2424
sys.path.append(os.path.dirname(__file__))
25-
import gitlab
2625

2726
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
2827

@@ -207,11 +206,11 @@
207206

208207
latex_elements = {
209208
# The paper size ('letterpaper' or 'a4paper').
210-
#'papersize': 'letterpaper',
211-
# The font size ('10pt', '11pt' or '12pt').
212-
#'pointsize': '10pt',
213-
# Additional stuff for the LaTeX preamble.
214-
#'preamble': '',
209+
# 'papersize': 'letterpaper',
210+
# The font size ('10pt', '11pt' or '12pt').
211+
# 'pointsize': '10pt',
212+
# Additional stuff for the LaTeX preamble.
213+
# 'preamble': '',
215214
}
216215

217216
# Grouping the document tree into LaTeX files. List of tuples

docs/ext/docstrings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import inspect
2-
import itertools
32
import os
43

54
import jinja2
@@ -14,7 +13,6 @@ def classref(value, short=True):
1413
if not inspect.isclass(value):
1514
return ":class:%s" % value
1615
tilde = "~" if short else ""
17-
string = "%s.%s" % (value.__module__, value.__name__)
1816
return ":class:`%sgitlab.objects.%s`" % (tilde, value.__name__)
1917

2018

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def get_version():
2727
url="https://github.com/python-gitlab/python-gitlab",
2828
packages=find_packages(),
2929
install_requires=["requests>=2.22.0", "requests-toolbelt>=0.9.1"],
30-
package_data = {'gitlab': ['py.typed'], },
30+
package_data={
31+
"gitlab": ["py.typed"],
32+
},
3133
python_requires=">=3.6.0",
3234
entry_points={"console_scripts": ["gitlab = gitlab.cli:main"]},
3335
classifiers=[

tools/functional/api/test_issues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_issue_notes(issue):
3939

4040

4141
def test_issue_labels(project, issue):
42-
label = project.labels.create({"name": "label2", "color": "#aabbcc"})
42+
project.labels.create({"name": "label2", "color": "#aabbcc"})
4343
issue.labels = ["label2"]
4444
issue.save()
4545

tools/functional/api/test_merge_requests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_merge_requests(project):
1414
)
1515

1616
source_branch = "branch1"
17-
branch = project.branches.create({"branch": source_branch, "ref": "master"})
17+
project.branches.create({"branch": source_branch, "ref": "master"})
1818

1919
project.files.create(
2020
{
@@ -24,7 +24,7 @@ def test_merge_requests(project):
2424
"commit_message": "New commit in new branch",
2525
}
2626
)
27-
mr = project.mergerequests.create(
27+
project.mergerequests.create(
2828
{"source_branch": "branch1", "target_branch": "master", "title": "MR readme2"}
2929
)
3030

tools/functional/api/test_projects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ def test_project_labels(project):
150150
assert label.name == "labelupdated"
151151

152152
label.subscribe()
153-
assert label.subscribed == True
153+
assert label.subscribed is True
154154

155155
label.unsubscribe()
156-
assert label.subscribed == False
156+
assert label.subscribed is False
157157

158158
label.delete()
159159
assert len(project.labels.list()) == 0

tools/functional/api/test_releases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_delete_project_release(project, release):
2929

3030

3131
def test_create_project_release_links(project, release):
32-
link = release.links.create(link_data)
32+
release.links.create(link_data)
3333

3434
release = project.releases.get(release.tag_name)
3535
assert release.assets["links"][0]["url"] == link_data["url"]

tools/functional/api/test_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ def test_create_commit(project):
7474
def test_create_commit_status(project):
7575
commit = project.commits.list()[0]
7676
size = len(commit.statuses.list())
77-
status = commit.statuses.create({"state": "success", "sha": commit.id})
77+
commit.statuses.create({"state": "success", "sha": commit.id})
7878
assert len(commit.statuses.list()) == size + 1
7979

8080

8181
def test_commit_signature(project):
8282
commit = project.commits.list()[0]
8383

8484
with pytest.raises(gitlab.GitlabGetError) as e:
85-
signature = commit.signature()
85+
commit.signature()
8686

8787
assert "404 Signature Not Found" in str(e.value)
8888

tools/functional/api/test_users.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
https://docs.gitlab.com/ee/api/users.html
44
https://docs.gitlab.com/ee/api/users.html#delete-authentication-identity-from-user
55
"""
6-
import time
7-
from pathlib import Path
8-
96
import pytest
107
import requests
118

@@ -57,7 +54,7 @@ def test_delete_user(gl, wait_for_sidekiq):
5754

5855
new_user.delete()
5956
result = wait_for_sidekiq(timeout=60)
60-
assert result == True, "sidekiq process should have terminated but did not"
57+
assert result is True, "sidekiq process should have terminated but did not"
6158

6259
assert new_user.id not in [user.id for user in gl.users.list()]
6360

tools/functional/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import time
33
import uuid
44
from pathlib import Path
5-
from random import randint
65
from subprocess import check_output
76

87
import pytest

tools/functional/ee-test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ def end_log():
125125
pr.save()
126126
pr = project1.pushrules.get()
127127
assert pr is not None
128-
assert pr.deny_delete_tag == False
128+
assert pr.deny_delete_tag is False
129129
pr.delete()
130130
end_log()
131131

132132
start_log("license")
133-
l = gl.get_license()
134-
assert "user_limit" in l
133+
license = gl.get_license()
134+
assert "user_limit" in license
135135
try:
136136
gl.set_license("dummykey")
137137
except Exception as e:

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ deps = -r{toxinidir}/requirements.txt
2121
-r{toxinidir}/test-requirements.txt
2222
flake8
2323
commands =
24-
flake8 {posargs} gitlab/
24+
flake8 {posargs} .
2525

2626
[testenv:black]
2727
basepython = python3

0 commit comments

Comments
 (0)