Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Mar 12, 2024
1 parent 612490b commit b019656
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 103 deletions.
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ values =

[bumpversion:file:./pulpcore/cli/ostree/__init__.py]

[bumpversion:file:./pulp-glue-ostree/setup.py]
[bumpversion:file:./pulp-glue-ostree/pyproject.toml]

[bumpversion:file:./setup.py]
[bumpversion:file:./pyproject.toml]
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
fail-fast: false
matrix:
python:
- "3.8"
- "3.11"
- "3.12"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/cache@v4"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- python: "3.11"
image_tag: "nightly"
pulp_api_root: "/relocated/djnd/"
- python: "3.6"
- python: "3.8"
image_tag: "3.28"
lower_bounds: true
- python: "3.7"
- python: "3.12"
image_tag: "3.26"
- python: "3.8"
image_tag: "3.25"
Expand Down
40 changes: 40 additions & 0 deletions pulp-glue-ostree/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "pulp-glue-ostree"
version = "0.3.0.dev"
description = "Version agnostic glue library to talk to pulpcore's REST API. (OSTree plugin)"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "GPLv2+"}
authors = [
{name = "Pulp Team", email = "[email protected]"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: System :: Software Distribution",
"Typing :: Typed",
]
dependencies = [
"pulp-glue>=0.20.0,<0.25",
]

[project.urls]
repository = "https://github.com/pulp/pulp-cli-ostree"
changelog = "https://github.com/pulp/pulp-cli-ostree/blob/main/CHANGES.md"

[tool.setuptools.packages.find]
where = ["."]
include = ["pulp_glue.*"]
namespaces = true

[tool.setuptools.package-data]
"*" = ["py.typed", "locale/*/LC_MESSAGES/*.mo"]

[tool.black]
line-length = 100

Expand Down
44 changes: 0 additions & 44 deletions pulp-glue-ostree/setup.py

This file was deleted.

48 changes: 46 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "pulp-cli-ostree"
version = "0.3.0.dev"
description = "Command line interface to talk to pulpcore's REST API. (OSTree plugin commands)"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "GPLv2+"}
authors = [
{name = "Pulp Team", email = "[email protected]"},
]
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: System :: Software Distribution",
"Typing :: Typed",
]
dependencies = [
"pulp-cli>=0.20.0,<0.25",
"pulp-glue-ostree==0.3.0.dev",
]

[project.urls]
repository = "https://github.com/pulp/pulp-cli-ostree"
changelog = "https://github.com/pulp/pulp-cli-ostree/blob/main/CHANGES.md"

[project.entry-points."pulp_cli.plugins"]
ostree = "pulpcore.cli.ostree"

[tool.setuptools.packages.find]
where = ["."]
include = ["pulpcore.cli.*"]
namespaces = true

[tool.setuptools.package-data]
"*" = ["py.typed", "locale/*/LC_MESSAGES/*.mo"]

[tool.pulp_cli_template]
app_label = "ostree"
glue = true
Expand All @@ -7,10 +51,10 @@ test_matrix = """
- python: "3.11"
image_tag: "nightly"
pulp_api_root: "/relocated/djnd/"
- python: "3.6"
- python: "3.8"
image_tag: "3.28"
lower_bounds: true
- python: "3.7"
- python: "3.12"
image_tag: "3.26"
- python: "3.8"
image_tag: "3.25"
Expand Down
43 changes: 0 additions & 43 deletions setup.py

This file was deleted.

25 changes: 16 additions & 9 deletions tests/test_help_pages.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# type: ignore
import typing as t

import click
import pytest
from click.testing import CliRunner
from pulp_cli import load_plugins
from packaging.version import parse as parse_version
from pulp_cli import __version__ as PULP_CLI_VERSION
from pulp_cli import load_plugins, main
from pytest_subtests.plugin import SubTests

main = load_plugins()
load_plugins()


def traverse_commands(command, args):
def traverse_commands(command: click.Command, args: t.List[str]) -> t.Iterator[t.List[str]]:
yield args

if isinstance(command, click.Group):
Expand All @@ -19,6 +22,7 @@ def traverse_commands(command, args):
if params:
if "--type" in params[0].opts:
# iterate over commands with specific context types
assert isinstance(params[0].type, click.Choice)
for context_type in params[0].type.choices:
yield args + ["--type", context_type]

Expand All @@ -27,19 +31,22 @@ def traverse_commands(command, args):


@pytest.fixture
def no_api(monkeypatch):
@property
def getter(self):
def no_api(monkeypatch: pytest.MonkeyPatch) -> None:
@property # type: ignore
def getter(self: t.Any) -> None:
pytest.fail("Invalid access to 'PulpContext.api'.", pytrace=False)

monkeypatch.setattr("pulp_glue.common.context.PulpContext.api", getter)


@pytest.mark.help_page
def test_access_help(no_api, subtests):
def test_access_help(no_api: None, subtests: SubTests) -> None:
"""Test, that all help screens are accessible without touching the api property."""
if parse_version(PULP_CLI_VERSION) < parse_version("0.24"):
pytest.skip("This test is incompatible with older cli versions.")

runner = CliRunner()
for args in traverse_commands(main, []):
for args in traverse_commands(main.commands["ostree"], ["ostree"]):
with subtests.test(msg=" ".join(args)):
result = runner.invoke(main, args + ["--help"], catch_exceptions=False)

Expand Down

0 comments on commit b019656

Please sign in to comment.