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

set -uv
set -u

MATCHES=$(grep -n -r --include \*.py "_(f")
MATCHES="$(grep -n -r --include \*.py "_(f" pulp_gem )"

if [ $? -ne 1 ]; then
printf "\nERROR: Detected mix of f-strings and gettext:\n"
Expand Down
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_gem | grep -v "tests\|plugin")"

if [ $? -ne 1 ]; then
printf "\nERROR: Detected bad imports from pulpcore:\n"
Expand Down
6 changes: 3 additions & 3 deletions .ci/scripts/check_release.py
Original file line number Diff line number Diff line change
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 @@ -9,10 +9,10 @@
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/collect_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from git import GitCommandError, Repo
from packaging.version import parse as parse_version


PYPI_PROJECT = "pulp_gem"

# Read Towncrier settings
Expand Down
34 changes: 0 additions & 34 deletions .flake8

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +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
ruff check --diff

- name: "Check for common gettext problems"
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
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
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ include test_requirements.txt
include unittest_requirements.txt
include pyproject.toml
exclude releasing.md
exclude Makefile

exclude .gitleaks.toml
exclude .gitleaks.toml
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

.PHONY: lint
lint:
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows
bump-my-version bump --dry-run release
ruff format --check --diff
ruff check --diff
check-manifest
python .ci/scripts/check_requirements.py
sh .ci/scripts/check_pulpcore_imports.sh
sh .ci/scripts/check_gettext.sh
10 changes: 0 additions & 10 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
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ replace = "version = \"{new_version}\""
filename = "./pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""


[tool.towncrier]
package = "pulp_gem"
filename = "CHANGES.md"
Expand Down Expand Up @@ -119,7 +121,13 @@ exclude = '''
)/
'''


[tool.ruff]
# This section is managed by the plugin template. Do not edit manually.
line-length = 100
extend-exclude = [
"docs/**",
"**/migrations/*.py",
]
[tool.check-manifest]
ignore = [
"CHANGES/**",
Expand Down
5 changes: 1 addition & 4 deletions template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# After editing this file please always reapply the plugin template before committing any changes.

---
black: true
check_commit_message: true
check_gettext: true
check_manifest: true
Expand All @@ -23,10 +22,9 @@ deploy_to_pypi: true
disabled_redis_runners: []
docker_fixtures: false
extra_files: []
flake8: true
flake8_ignore: []
github_org: "pulp"
latest_release_branch: "0.7"
lint_ignore: []
lint_requirements: true
os_required_packages: []
parallel_test_workers: 8
Expand Down Expand Up @@ -93,7 +91,6 @@ pulp_settings_s3:
- "sha512"
api_root: "/rerouted/djnd/"
domain_enabled: true
pydocstyle: true
release_email: "pulp-infra@redhat.com"
release_user: "pulpbot"
stalebot: true
Expand Down
Loading