Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/ansible/filter/repr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import absolute_import, division, print_function

from packaging.version import parse as parse_version

__metaclass__ = type
Expand Down
5 changes: 3 additions & 2 deletions .ci/scripts/calc_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

import argparse
import fileinput
import urllib.request
import sys
import urllib.request

import yaml
from packaging.requirements import Requirement
from packaging.version import Version
import yaml

try:
import tomllib
Expand Down
21 changes: 0 additions & 21 deletions .ci/scripts/check_gettext.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .ci/scripts/check_pulpcore_imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../..

set -uv
set -u

# check for imports not from pulpcore.plugin. exclude tests
MATCHES=$(grep -n -r --include \*.py "from pulpcore.*import" . | grep -v "tests\|plugin")
MATCHES="$(grep -n -r --include \*.py "from pulpcore.*import" pulpcore pulp_file pulp_certguard | grep -v "tests\|plugin")"

if [ $? -ne 1 ]; then
printf "\nERROR: Detected bad imports from pulpcore:\n"
Expand Down
10 changes: 5 additions & 5 deletions .ci/scripts/check_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
# ///

import argparse
import re
import os
import re
import sys
import tomllib
import typing as t
from pathlib import Path

import yaml
from packaging.version import Version
from git import Repo
from packaging.version import Version

RELEASE_BRANCH_REGEX = r"^([0-9]+)\.([0-9]+)$"
Y_CHANGELOG_EXTS = [".feature"]
Expand Down Expand Up @@ -157,9 +157,9 @@ def main(options: argparse.Namespace, template_config: dict[str, t.Any]) -> int:

if reasons:
curr_version = Version(last_tag)
assert curr_version.base_version.startswith(
branch
), "Current-version has to belong to the current branch!"
assert curr_version.base_version.startswith(branch), (
"Current-version has to belong to the current branch!"
)
next_version = Version(f"{branch}.{curr_version.micro + 1}")
print(
f"A Z-release is needed for {branch}, "
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/check_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import tomllib
import warnings

from packaging.requirements import Requirement

CHECK_MATRIX = [
("pyproject.toml", True, True, True),
("requirements.txt", True, True, True),
("dev_requirements.txt", False, True, False),
("ci_requirements.txt", False, True, True),
("doc_requirements.txt", False, True, False),
("lint_requirements.txt", False, True, True),
Expand Down
1 change: 1 addition & 0 deletions .ci/scripts/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"""

import json

from drf_spectacular.validation import JSON_SCHEMA_SPEC_PATH

with open(JSON_SCHEMA_SPEC_PATH) as fh:
Expand Down
7 changes: 4 additions & 3 deletions .ci/scripts/skip_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
*: Error
"""

import sys
import argparse
import os
import re
import git
import sys
import textwrap
import argparse

import git

DOC_PATTERNS = [
r"^docs/",
Expand Down
1 change: 1 addition & 0 deletions .ci/scripts/update_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# For more info visit https://github.com/pulp/plugin_template

import os

from github import Github

g = Github(os.environ.get("GITHUB_TOKEN"))
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/validate_commit_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import subprocess
import sys
import tomllib
import yaml
from pathlib import Path

import yaml
from github import Github


Expand Down
34 changes: 0 additions & 34 deletions .flake8

This file was deleted.

15 changes: 4 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,13 @@ jobs:
run: |
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows

# run black separately from flake8 to get a diff
- name: "Run black"
- name: "Check formating"
run: |
black --version
black --check --diff .
ruff format --check --diff

# Lint code.
- name: "Run flake8"
- name: "Lint code"
run: |
flake8

- name: "Check for common gettext problems"
run: |
sh .ci/scripts/check_gettext.sh
ruff check

- name: "Run extra lint checks"
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
from git import Repo
from git.exc import GitCommandError

helper = textwrap.dedent("""\
helper = textwrap.dedent(
"""\
Stage the changelog for a release on main branch.

Example:
$ python .github/workflows/scripts/stage-changelog-for-default-branch.py 3.4.0

""")
"""
)

parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=helper)

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/scripts/update_backport_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
#
# For more info visit https://github.com/pulp/plugin_template

import os
import random

import requests
import yaml
import random
import os


def random_color():
Expand Down
11 changes: 0 additions & 11 deletions dev_requirements.txt

This file was deleted.

4 changes: 1 addition & 3 deletions lint_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
#
# For more info visit https://github.com/pulp/plugin_template

black~=26.3 # Pin style to the year. https://black.readthedocs.io/en/stable/faq.html#how-stable-is-black-s-style
bump-my-version
check-manifest
flake8
flake8-black
packaging
ruff
yamllint
7 changes: 3 additions & 4 deletions pulp_certguard/app/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from logging import getLogger
from gettext import gettext as _
import re
from gettext import gettext as _
from logging import getLogger
from urllib.parse import unquote

from cryptography import x509
from django.conf import settings
from django.db import models

from cryptography import x509
from OpenSSL import crypto as openssl

from pulpcore.plugin.models import ContentGuard
Expand Down
3 changes: 1 addition & 2 deletions pulp_certguard/app/serializers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from gettext import gettext as _

from OpenSSL import crypto as openssl
from rest_framework import serializers

from pulpcore.plugin.serializers import ContentGuardSerializer

from rest_framework import serializers

from .models import RHSMCertGuard, X509CertGuard


Expand Down
7 changes: 4 additions & 3 deletions pulp_certguard/rhsm/rhsm_check_path.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import typing as t
from cryptography import x509
from heapq import heappush, heappop
import itertools
import re
import typing as t
import zlib
from heapq import heappop, heappush

from cryptography import x509

RH_OID = "1.3.6.1.4.1.2312.9"
RH_ORDER_NAME_OID = RH_OID + ".4.1"
Expand Down
10 changes: 5 additions & 5 deletions pulp_certguard/tests/functional/api/test_rhsm_certguard.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import pytest
import uuid
from urllib.parse import quote, urljoin

import pytest
import requests
from urllib.parse import urljoin, quote
from django.conf import settings

from pulp_certguard.tests.functional.constants import (
RHSM_CA_CERT_FILE_PATH,
RHSM_CLIENT_CERT_FROM_UNTRUSTED_CA,
RHSM_CLIENT_CERT_TRUSTED_BUT_EXPIRED,
THIRDPARTY_CA_CERT_FILE_PATH,
RHSM_UBER_CERT_BASE_PATH_ONE,
RHSM_UBER_CERT_BASE_PATH_TWO,
RHSM_UBER_CLIENT_CERT,
RHSM_V1_ONE_AND_TWO_VAR_CLIENT_CERT,
RHSM_V1_ONE_VAR_BASE_PATH,
RHSM_V1_TWO_VAR_BASE_PATH,
RHSM_V1_ZERO_VAR_CLIENT_CERT,
RHSM_V1_ZERO_VAR_BASE_PATH,
RHSM_V1_ZERO_VAR_CLIENT_CERT,
RHSM_V3_INVALID_BASE_PATH,
RHSM_V3_ONE_AND_TWO_VAR_CLIENT_CERT,
RHSM_V3_ONE_VAR_BASE_PATH,
RHSM_V3_TWO_VAR_BASE_PATH,
RHSM_V3_ZERO_VAR_CLIENT_CERT,
RHSM_V3_ZERO_VAR_BASE_PATH,
RHSM_V3_ZERO_VAR_CLIENT_CERT,
THIRDPARTY_CA_CERT_FILE_PATH,
)

if settings.DOMAIN_ENABLED:
Expand Down
6 changes: 3 additions & 3 deletions pulp_certguard/tests/functional/api/test_x509_certguard.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import pytest
import uuid
from urllib.parse import quote, urljoin

import pytest
import requests
from urllib.parse import urljoin, quote

from pulp_certguard.tests.functional.constants import (
X509_BASE_PATH,
X509_CA_CERT_FILE_PATH,
X509_CLIENT_CERT_FILE_PATH,
X509_UNTRUSTED_CLIENT_CERT_FILE_PATH,
X509_UN_URLENCODED_CLIENT_CERT_FILE_PATH,
X509_UNTRUSTED_CLIENT_CERT_FILE_PATH,
)


Expand Down
10 changes: 5 additions & 5 deletions pulp_certguard/tests/unit/test_rhsm_check_path.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from cryptography import x509
import pytest

from . import certdata
from cryptography import x509

from pulp_certguard.rhsm import check_path
from pulp_certguard.rhsm.rhsm_check_path import (
bitstream,
V1_PATH_OID_REGEX,
Entitlement,
HuffmannNode,
bitstream,
cert_version,
split_count,
V1_PATH_OID_REGEX,
)

from . import certdata


@pytest.fixture(scope="session")
def ent_v1() -> x509.Certificate:
Expand Down
1 change: 1 addition & 0 deletions pulp_file/app/modelresource.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pulpcore.plugin.importexport import BaseContentResource
from pulpcore.plugin.modelresources import RepositoryResource

from pulp_file.app.models import FileContent, FileRepository


Expand Down
Loading
Loading