Skip to content

Commit

Permalink
Enable flake8-pyi plugin for ruff (#2340)
Browse files Browse the repository at this point in the history
  • Loading branch information
cutwater authored Oct 25, 2024
1 parent a2d559a commit 8451a92
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 7 additions & 2 deletions galaxy_ng/app/api/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import re
import socket
from typing import NamedTuple

from django.utils.translation import gettext_lazy as _
from django.http import Http404
Expand All @@ -9,15 +10,19 @@
from rest_framework import serializers
from pulpcore.plugin import models as pulp_models

from collections import namedtuple
from requests.adapters import HTTPAdapter
from urllib3.connection import HTTPConnection
from urllib3.connectionpool import HTTPConnectionPool

from galaxy_importer.schema import MAX_LENGTH_NAME, MAX_LENGTH_VERSION
from galaxy_ng.app.constants import AAP_VERSION_FILE_PATH

CollectionFilename = namedtuple("CollectionFilename", ["namespace", "name", "version"])

class CollectionFilename(NamedTuple):
namespace: str
name: str
version: str


LOCALHOST = "localhost"
FILENAME_REGEXP = re.compile(
Expand Down
12 changes: 8 additions & 4 deletions galaxy_ng/tests/integration/dab/test_dab_rbac.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import contextlib
import json
import os
from collections import namedtuple
from typing import NamedTuple

import pytest

Expand All @@ -16,6 +16,13 @@
pytestmark = pytest.mark.qa # noqa: F821


class Artifact(NamedTuple):
name: str
namespace: str
published: bool
version: str


@pytest.mark.skip(reason="we are not aiming for 1:1 anymore")
@pytest.mark.deployment_standalone
def test_dab_roledefs_match_pulp_roles(galaxy_client):
Expand Down Expand Up @@ -248,9 +255,6 @@ def test_dab_rbac_namespace_owner_by_user_or_team(
})
)

# we need an artifact-like object for the set_certification function ..
Artifact = namedtuple('Artifact', ['name', 'namespace', 'published', 'version'])

# try to upload a collection as the user...
import_result = upload_test_collection(
ugc,
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ select = [
"PIE",
# flake8-pytest-style
"PT",
# flake8-pyi
"PYI",
# ruff specific rules
"RUF",
# flake8-simplify
Expand Down

0 comments on commit 8451a92

Please sign in to comment.