From a9cb36199f72d00197b574738d8e5c4a3d1fa214 Mon Sep 17 00:00:00 2001 From: pulpbot Date: Mon, 31 Mar 2025 12:56:53 +0000 Subject: [PATCH 1/2] Update CI files --- .ci/scripts/calc_constraints.py | 4 +++- .flake8 | 3 ++- .github/template_gitref | 1 - .github/workflows/scripts/before_script.sh | 4 ++++ .github/workflows/scripts/script.sh | 2 ++ pyproject.toml | 2 +- requirements.txt | 2 +- 7 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 .github/template_gitref diff --git a/.ci/scripts/calc_constraints.py b/.ci/scripts/calc_constraints.py index 35315153..93ee2cc7 100755 --- a/.ci/scripts/calc_constraints.py +++ b/.ci/scripts/calc_constraints.py @@ -83,13 +83,15 @@ def to_lower_bound(req): else: for spec in requirement.specifier: if spec.operator == ">=": + min_version = spec.version if requirement.name == "pulpcore": # Currently an exception to allow for pulpcore bugfix releases. # TODO Semver libraries should be allowed too. operator = "~=" + if len(Version(min_version).release) != 3: + raise RuntimeError("Pulpcore lower bound must be in the form '>=x.y.z'.") else: operator = "==" - min_version = spec.version return f"{requirement.name}{operator}{min_version}" return f"# NO LOWER BOUND: {req}" diff --git a/.flake8 b/.flake8 index 64403dce..9e00b3fa 100644 --- a/.flake8 +++ b/.flake8 @@ -8,13 +8,14 @@ exclude = ./docs/*,*/migrations/* per-file-ignores = */__init__.py: F401 -ignore = E203,W503,Q000,Q003,D100,D104,D106,D200,D205,D400,D401,D402 +ignore = E203,W503,Q000,Q003,D100,D104,D106,D200,D205,D400,D401,D402,F824 max-line-length = 100 # Flake8 builtin codes # -------------------- # E203: no whitespace around ':'. disabled until https://github.com/PyCQA/pycodestyle/issues/373 is fixed # W503: This enforces operators before line breaks which is not pep8 or black compatible. +# F824: 'nonlocal' is unused: name is never assigned in scope # Flake8-quotes extension codes # ----------------------------- diff --git a/.github/template_gitref b/.github/template_gitref deleted file mode 100644 index 201b085a..00000000 --- a/.github/template_gitref +++ /dev/null @@ -1 +0,0 @@ -2021.08.26-426-g3a3f8a1 diff --git a/.github/workflows/scripts/before_script.sh b/.github/workflows/scripts/before_script.sh index 5c0072c4..11404f45 100755 --- a/.github/workflows/scripts/before_script.sh +++ b/.github/workflows/scripts/before_script.sh @@ -32,6 +32,10 @@ tail -v -n +1 .ci/ansible/settings/settings.* ~/.config/pulp_smash/settings.json echo "Containerfile:" tail -v -n +1 .ci/ansible/Containerfile +echo "Constraints Files:" +# The need not even exist. +tail -v -n +1 ../*/*constraints.txt || true + # Needed for some functional tests cmd_prefix bash -c "echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/nopasswd" cmd_prefix bash -c "usermod -a -G wheel pulp" diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 8e60f87d..414d98f9 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -28,6 +28,8 @@ export PULP_URL="https://pulp" REPORTED_STATUS="$(pulp status)" +echo "${REPORTED_STATUS}" + echo "machine pulp login admin password password diff --git a/pyproject.toml b/pyproject.toml index e2bd4283..299e1fff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,4 +71,4 @@ search = "version = \"{current_version}\"" replace = "version = \"{new_version}\"" [[tool.bumpversion.files]] -filename = "./setup.py" \ No newline at end of file +filename = "./setup.py" diff --git a/requirements.txt b/requirements.txt index 072eff12..6de2c914 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pulpcore>=3.28,<3.55 +pulpcore>=3.28.0,<3.55 pkginfo>=1.12.0,<1.13.0 bandersnatch>=6.1,<6.2 pypi-simple>=0.9.0,<1.0.0 From f92788c9f252a5c2c26ffc1ef808415203c80e6a Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Mon, 31 Mar 2025 17:47:50 +0200 Subject: [PATCH 2/2] Fix twine test on lower bound pulpcore version --- pulp_python/tests/functional/api/test_pypi_apis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulp_python/tests/functional/api/test_pypi_apis.py b/pulp_python/tests/functional/api/test_pypi_apis.py index f35bb7c5..0bff661c 100644 --- a/pulp_python/tests/functional/api/test_pypi_apis.py +++ b/pulp_python/tests/functional/api/test_pypi_apis.py @@ -192,7 +192,7 @@ def test_package_upload_simple(self): @pytest.mark.parallel def test_twine_upload( - pulpcore_bindings, + tasks_api_client, python_content_summary, python_empty_repo_distro, python_package_dist_directory, @@ -218,7 +218,7 @@ def test_twine_upload( capture_output=True, check=True, ) - tasks = pulpcore_bindings.TasksApi.list(reserved_resources=repo.pulp_href).results + tasks = tasks_api_client.list(reserved_resources=repo.pulp_href).results for task in reversed(tasks): t = monitor_task(task.pulp_href) repo_ver_href = t.created_resources[-1]