Skip to content
Draft
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_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
2 changes: 1 addition & 1 deletion .ci/scripts/check_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import tomllib
import warnings
from packaging.requirements import Requirement

from packaging.requirements import Requirement

CHECK_MATRIX = [
("pyproject.toml", True, True, True),
Expand Down
1 change: 0 additions & 1 deletion .ci/scripts/collect_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from git import GitCommandError, Repo
from packaging.version import parse as parse_version


PYPI_PROJECT = "pulp_gem"

# Read Towncrier settings
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
6 changes: 1 addition & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ jobs:

- name: "Lint code"
run: |
ruff check --diff

- 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,7 +12,6 @@
from git import Repo
from git.exc import GitCommandError


helper = textwrap.dedent(
"""\
Stage the changelog for a release on main branch.
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
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --ci pulp_gem' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template

.PHONY: format
format:
ruff format
ruff check --select I --fix

.PHONY: lint
lint:
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows
bump-my-version bump --dry-run --allow-dirty release
ruff format --check --diff
ruff check
check-manifest
python .ci/scripts/check_requirements.py
sh .ci/scripts/check_pulpcore_imports.sh
4 changes: 2 additions & 2 deletions pulp_gem/app/models.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from logging import getLogger

from pathlib import PurePath
from tempfile import NamedTemporaryFile

from django.contrib.postgres.fields import HStoreField
from django.db import models

from pulpcore.plugin.models import (
AutoAddObjPermsMixin,
Content,
Publication,
Distribution,
Publication,
Remote,
Repository,
)
Expand Down
4 changes: 2 additions & 2 deletions pulp_gem/app/replica.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from pulpcore.plugin.replica import Replicator

from pulp_glue.gem.context import (
PulpGemDistributionContext,
PulpGemPublicationContext,
PulpGemRepositoryContext,
)

from pulpcore.plugin.replica import Replicator

from pulp_gem.app.models import GemDistribution, GemRemote, GemRepository
from pulp_gem.app.tasks import synchronize as gem_synchronize

Expand Down
8 changes: 3 additions & 5 deletions pulp_gem/app/serializers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from gettext import gettext as _
import tempfile

import hashlib
import os
import tempfile
from gettext import gettext as _

from django.db import DatabaseError
from rest_framework.serializers import (
Expand All @@ -16,9 +15,9 @@
from pulpcore.plugin.serializers import (
ArtifactSerializer,
DetailRelatedField,
DistributionSerializer,
MultipleArtifactContentSerializer,
PublicationSerializer,
DistributionSerializer,
RemoteSerializer,
RepositorySerializer,
SingleContentArtifactField,
Expand All @@ -33,7 +32,6 @@
GemRemote,
GemRepository,
)

from pulp_gem.specs import analyse_gem


Expand Down
7 changes: 3 additions & 4 deletions pulp_gem/app/tasks/publishing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@
import logging
import os
import shutil

from gettext import gettext as _
from pathlib import Path

from django.conf import settings
from django.core.files import File
from django.db import transaction
from jinja2 import Template
from pathlib import Path

from pulpcore.plugin.models import (
ContentArtifact,
RepositoryVersion,
PublishedArtifact,
PublishedMetadata,
RepositoryVersion,
)

from pulp_gem.app.models import GemContent, GemPublication
from pulp_gem.specs import ruby_ver_cmp, write_specs, GemKey
from pulp_gem.specs import GemKey, ruby_ver_cmp, write_specs

log = logging.getLogger(__name__)

Expand Down
5 changes: 2 additions & 3 deletions pulp_gem/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import logging

from aiohttp import ClientConnectionError
from gettext import gettext as _
from urllib.parse import urljoin

from aiohttp import ClientConnectionError
from django.conf import settings

from pulpcore.plugin.models import Artifact, ProgressReport, Remote, Repository
Expand All @@ -18,8 +17,8 @@
from pulp_gem.specs import (
NAME_REGEX,
PRERELEASE_VERSION_REGEX,
read_versions,
read_info,
read_versions,
ruby_ver_includes,
split_ext_version,
)
Expand Down
18 changes: 9 additions & 9 deletions pulp_gem/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
from rest_framework.decorators import action

from pulpcore.plugin.actions import ModifyRepositoryActionMixin
from pulpcore.plugin.serializers import (
AsyncOperationResponseSerializer,
RepositorySyncURLSerializer,
)
from pulpcore.plugin.tasking import dispatch
from pulpcore.plugin.viewsets import (
DistributionViewSet,
ContentFilter,
SingleArtifactContentUploadViewSet,
DistributionViewSet,
OperationPostponedResponse,
PublicationViewSet,
RemoteViewSet,
RepositoryViewSet,
RepositoryVersionViewSet,
RepositoryViewSet,
RolesMixin,
SingleArtifactContentUploadViewSet,
)
from pulpcore.plugin.serializers import (
AsyncOperationResponseSerializer,
RepositorySyncURLSerializer,
)
from pulpcore.plugin.tasking import dispatch

from pulp_gem.app import tasks
from pulp_gem.app.models import (
GemContent,
GemDistribution,
GemRemote,
GemPublication,
GemRemote,
GemRepository,
)
from pulp_gem.app.serializers import (
Expand Down
2 changes: 2 additions & 0 deletions pulp_gem/pytest_plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import uuid

import pytest

from pulpcore.tests.functional.utils import BindingsNamespace

from pulp_gem.tests.functional.constants import GEM_FIXTURE_URL, GEM_URL

# Api Bindings fixtures
Expand Down
13 changes: 6 additions & 7 deletions pulp_gem/specs.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
from collections import namedtuple
from logging import getLogger

import aiofiles
import datetime
import zlib
import gzip
import re
import yaml
import zlib
from collections import namedtuple
from itertools import zip_longest
from logging import getLogger
from tarfile import TarFile

import aiofiles
import rubymarshal.classes
import rubymarshal.writer
import rubymarshal.reader
import rubymarshal.writer
import yaml

log = getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion pulp_gem/tests/functional/api/test_crud_remotes.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Tests that CRUD gem remotes."""

import pytest
import uuid
from random import choice

import pytest

from pulpcore.client.pulp_gem import ApiException

from pulp_gem.tests.functional.constants import DOWNLOAD_POLICIES, GEM_FIXTURE_URL


Expand Down
3 changes: 2 additions & 1 deletion pulp_gem/tests/functional/api/test_download_content.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Tests that verify download of content served by Pulp."""

import pytest
import hashlib
from random import choice
from urllib.parse import urljoin

import pytest

from pulp_gem.tests.functional.constants import DOWNLOAD_POLICIES, GEM_FIXTURE_URL


Expand Down
Loading
Loading