diff options
| author | John L. Villalovos <john@sodarock.com> | 2021-04-29 08:21:50 -0700 |
|---|---|---|
| committer | John L. Villalovos <john@sodarock.com> | 2021-04-30 07:07:17 -0700 |
| commit | ab343ef6da708746aa08a972b461a5e51d898f8b (patch) | |
| tree | 98eabab08089a21386e4e56a1fe8fd6ff90af52d | |
| parent | 98891eb2c52051134fd3046a4ef5d7b0a6af8fec (diff) | |
| download | gitlab-ab343ef6da708746aa08a972b461a5e51d898f8b.tar.gz | |
chore: have flake8 check the entire project
Have flake8 run at the top-level of the projects instead of just the
gitlab directory.
| -rw-r--r-- | docs/conf.py | 13 | ||||
| -rw-r--r-- | docs/ext/docstrings.py | 2 | ||||
| -rw-r--r-- | setup.py | 4 | ||||
| -rw-r--r-- | tools/functional/api/test_issues.py | 2 | ||||
| -rw-r--r-- | tools/functional/api/test_merge_requests.py | 4 | ||||
| -rw-r--r-- | tools/functional/api/test_projects.py | 4 | ||||
| -rw-r--r-- | tools/functional/api/test_releases.py | 2 | ||||
| -rw-r--r-- | tools/functional/api/test_repository.py | 4 | ||||
| -rw-r--r-- | tools/functional/api/test_users.py | 5 | ||||
| -rw-r--r-- | tools/functional/conftest.py | 1 | ||||
| -rwxr-xr-x | tools/functional/ee-test.py | 6 | ||||
| -rw-r--r-- | tox.ini | 2 |
12 files changed, 22 insertions, 27 deletions
diff --git a/docs/conf.py b/docs/conf.py index 681af22..fa14e6f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,11 +18,10 @@ from __future__ import unicode_literals import os import sys -import sphinx +import gitlab sys.path.append("../") sys.path.append(os.path.dirname(__file__)) -import gitlab on_rtd = os.environ.get("READTHEDOCS", None) == "True" @@ -207,11 +206,11 @@ htmlhelp_basename = "python-gitlabdoc" latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples diff --git a/docs/ext/docstrings.py b/docs/ext/docstrings.py index 754da27..fc1c10b 100644 --- a/docs/ext/docstrings.py +++ b/docs/ext/docstrings.py @@ -1,5 +1,4 @@ import inspect -import itertools import os import jinja2 @@ -14,7 +13,6 @@ def classref(value, short=True): if not inspect.isclass(value): return ":class:%s" % value tilde = "~" if short else "" - string = "%s.%s" % (value.__module__, value.__name__) return ":class:`%sgitlab.objects.%s`" % (tilde, value.__name__) @@ -27,7 +27,9 @@ setup( url="https://github.com/python-gitlab/python-gitlab", packages=find_packages(), install_requires=["requests>=2.22.0", "requests-toolbelt>=0.9.1"], - package_data = {'gitlab': ['py.typed'], }, + package_data={ + "gitlab": ["py.typed"], + }, python_requires=">=3.6.0", entry_points={"console_scripts": ["gitlab = gitlab.cli:main"]}, classifiers=[ diff --git a/tools/functional/api/test_issues.py b/tools/functional/api/test_issues.py index 6ab4b33..f3a606b 100644 --- a/tools/functional/api/test_issues.py +++ b/tools/functional/api/test_issues.py @@ -39,7 +39,7 @@ def test_issue_notes(issue): def test_issue_labels(project, issue): - label = project.labels.create({"name": "label2", "color": "#aabbcc"}) + project.labels.create({"name": "label2", "color": "#aabbcc"}) issue.labels = ["label2"] issue.save() diff --git a/tools/functional/api/test_merge_requests.py b/tools/functional/api/test_merge_requests.py index ecbb1d6..c5de5eb 100644 --- a/tools/functional/api/test_merge_requests.py +++ b/tools/functional/api/test_merge_requests.py @@ -14,7 +14,7 @@ def test_merge_requests(project): ) source_branch = "branch1" - branch = project.branches.create({"branch": source_branch, "ref": "master"}) + project.branches.create({"branch": source_branch, "ref": "master"}) project.files.create( { @@ -24,7 +24,7 @@ def test_merge_requests(project): "commit_message": "New commit in new branch", } ) - mr = project.mergerequests.create( + project.mergerequests.create( {"source_branch": "branch1", "target_branch": "master", "title": "MR readme2"} ) diff --git a/tools/functional/api/test_projects.py b/tools/functional/api/test_projects.py index 404f89d..0823c00 100644 --- a/tools/functional/api/test_projects.py +++ b/tools/functional/api/test_projects.py @@ -150,10 +150,10 @@ def test_project_labels(project): assert label.name == "labelupdated" label.subscribe() - assert label.subscribed == True + assert label.subscribed is True label.unsubscribe() - assert label.subscribed == False + assert label.subscribed is False label.delete() assert len(project.labels.list()) == 0 diff --git a/tools/functional/api/test_releases.py b/tools/functional/api/test_releases.py index 55f7920..f49181a 100644 --- a/tools/functional/api/test_releases.py +++ b/tools/functional/api/test_releases.py @@ -29,7 +29,7 @@ def test_delete_project_release(project, release): def test_create_project_release_links(project, release): - link = release.links.create(link_data) + release.links.create(link_data) release = project.releases.get(release.tag_name) assert release.assets["links"][0]["url"] == link_data["url"] diff --git a/tools/functional/api/test_repository.py b/tools/functional/api/test_repository.py index c4a8a4b..7ba84ea 100644 --- a/tools/functional/api/test_repository.py +++ b/tools/functional/api/test_repository.py @@ -74,7 +74,7 @@ def test_create_commit(project): def test_create_commit_status(project): commit = project.commits.list()[0] size = len(commit.statuses.list()) - status = commit.statuses.create({"state": "success", "sha": commit.id}) + commit.statuses.create({"state": "success", "sha": commit.id}) assert len(commit.statuses.list()) == size + 1 @@ -82,7 +82,7 @@ def test_commit_signature(project): commit = project.commits.list()[0] with pytest.raises(gitlab.GitlabGetError) as e: - signature = commit.signature() + commit.signature() assert "404 Signature Not Found" in str(e.value) diff --git a/tools/functional/api/test_users.py b/tools/functional/api/test_users.py index 044831a..1ef237c 100644 --- a/tools/functional/api/test_users.py +++ b/tools/functional/api/test_users.py @@ -3,9 +3,6 @@ GitLab API: https://docs.gitlab.com/ee/api/users.html https://docs.gitlab.com/ee/api/users.html#delete-authentication-identity-from-user """ -import time -from pathlib import Path - import pytest import requests @@ -57,7 +54,7 @@ def test_delete_user(gl, wait_for_sidekiq): new_user.delete() result = wait_for_sidekiq(timeout=60) - assert result == True, "sidekiq process should have terminated but did not" + assert result is True, "sidekiq process should have terminated but did not" assert new_user.id not in [user.id for user in gl.users.list()] diff --git a/tools/functional/conftest.py b/tools/functional/conftest.py index 648fe5e..89b3dda 100644 --- a/tools/functional/conftest.py +++ b/tools/functional/conftest.py @@ -2,7 +2,6 @@ import tempfile import time import uuid from pathlib import Path -from random import randint from subprocess import check_output import pytest diff --git a/tools/functional/ee-test.py b/tools/functional/ee-test.py index 3f75655..4223617 100755 --- a/tools/functional/ee-test.py +++ b/tools/functional/ee-test.py @@ -125,13 +125,13 @@ pr.deny_delete_tag = False pr.save() pr = project1.pushrules.get() assert pr is not None -assert pr.deny_delete_tag == False +assert pr.deny_delete_tag is False pr.delete() end_log() start_log("license") -l = gl.get_license() -assert "user_limit" in l +license = gl.get_license() +assert "user_limit" in license try: gl.set_license("dummykey") except Exception as e: @@ -21,7 +21,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt flake8 commands = - flake8 {posargs} gitlab/ + flake8 {posargs} . [testenv:black] basepython = python3 |
