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" pulp_ostree | 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
5 changes: 2 additions & 3 deletions pulp_ostree/app/models.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from logging import getLogger

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

from pulpcore.plugin.models import (
AutoAddObjPermsMixin,
Content,
Distribution,
Remote,
Repository,
Distribution,
)
from pulpcore.plugin.repo_version_utils import remove_duplicates, validate_duplicate_content

from pulpcore.plugin.util import get_domain_pk

logger = getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion pulp_ostree/app/serializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import tarfile

from gettext import gettext as _

from rest_framework import serializers
Expand Down
14 changes: 6 additions & 8 deletions pulp_ostree/app/tasks/importing.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import tarfile

from gettext import gettext

import gi
from asgiref.sync import sync_to_async

from pulpcore.plugin.models import Artifact, Repository, ProgressReport
from pulpcore.plugin.models import Artifact, ProgressReport, Repository
from pulpcore.plugin.serializers import RepositoryVersionSerializer
from pulpcore.plugin.stages import (
ArtifactSaver,
ContentSaver,
Expand All @@ -15,23 +16,20 @@
Stage,
)
from pulpcore.plugin.sync import sync_to_async_iterable
from pulpcore.plugin.serializers import RepositoryVersionSerializer

from pulp_ostree.app.models import (
OstreeCommit,
OstreeRef,
OstreeConfig,
OstreeObject,
OstreeObjectType,
OstreeRef,
OstreeSummary,
)
from pulp_ostree.app.tasks.stages import DeclarativeContentCreatorMixin, OstreeAssociateContent
from pulp_ostree.app.tasks.utils import copy_to_local_storage, get_checksum_filepath
from pulp_ostree.app.tasks.stages import OstreeAssociateContent, DeclarativeContentCreatorMixin

import gi

gi.require_version("OSTree", "1.0")
from gi.repository import Gio, GLib, OSTree # noqa: E402: module level not at top of file
from gi.repository import Gio, GLib, OSTree # noqa: E402


def import_all_refs_and_commits(artifact_pk, repository_pk, repository_name):
Expand Down
2 changes: 1 addition & 1 deletion pulp_ostree/app/tasks/modifying.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.db.models import Q

from pulpcore.plugin.models import Repository, RepositoryVersion, Content
from pulpcore.plugin.models import Content, Repository, RepositoryVersion
from pulpcore.plugin.util import get_domain

from pulp_ostree.app.models import (
Expand Down
7 changes: 3 additions & 4 deletions pulp_ostree/app/tasks/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import shutil
import tempfile

import gi
from asgiref.sync import sync_to_async

from pulpcore.plugin.models import Artifact
Expand All @@ -13,17 +14,15 @@

from pulp_ostree.app.models import (
OstreeCommit,
OstreeCommitObject,
OstreeContent,
OstreeObject,
OstreeRef,
OstreeCommitObject,
)
from pulp_ostree.app.tasks.utils import compute_hash, get_checksum_filepath

import gi

gi.require_version("OSTree", "1.0")
from gi.repository import GLib, OSTree # noqa: E402: module level not at top of file
from gi.repository import GLib, OSTree # noqa: E402


class DeclarativeContentCreatorMixin:
Expand Down
Loading
Loading