Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update build dependencies, fix minor lint and test issues, update qpc version to 1.8.2 #347

Merged
merged 6 commits into from
Jul 15, 2024
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ install:
lint: lint-ruff lint-docs

lint-ruff:
poetry run ruff .
poetry run ruff check .
poetry run ruff format --check .

lint-docs:
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/qpc.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "qpc" "1" "May 06, 2024" "" "qpc"
.TH "qpc" "1" "July 15, 2024" "" "qpc"
.SH NAME
.sp
qpc \- Inspect and report on product entitlement metadata from various sources, including networks and systems management solutions.
Expand Down
500 changes: 255 additions & 245 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "qpc"
version = "1.8.1"
version = "1.8.2"
license = {file = "LICENSE"}
requires-python = ">=3.11,<3.13"
dynamic = ["scripts"]

[tool.poetry]
name = "qpc"
version = "1.8.1"
version = "1.8.2"
description = ""
classifiers=[
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
Expand Down
6 changes: 5 additions & 1 deletion qpc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Name: qpc
Summary: command-line client interface for quipucords

Version: 1.8.1
Version: 1.8.2
Release: 1%{?dist}
Epoch: 0

Expand Down Expand Up @@ -49,6 +49,10 @@ sed \
%{python3_sitelib}/qpc-*.egg-info/

%changelog
* Mon Jul 15 2024 Brad Smith <[email protected]> - 0:1.8.2-1
- Better output and exit code from incomplete commands.
- Minor performance updates and cleanup.

* Tue Jun 11 2024 Bruno Ciconelle <[email protected]> - 0:1.8.1-1
- Add support for aggregate report (Brad Smith)
- Upgrade python version to 3.12
Expand Down
2 changes: 1 addition & 1 deletion qpc/insights/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def _do_command(self):
write_insights_auth_token(auth_token)
except InsightsAuthError as err:
logger.error(_(err.message))
SystemExit(1)
raise SystemExit(1)
2 changes: 1 addition & 1 deletion qpc/insights/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ def _do_command(self):
self._publish_to_ingress()
except QPCError as err:
logger.error(_(err.message))
SystemExit(1)
raise SystemExit(1)
12 changes: 6 additions & 6 deletions qpc/scan/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ def _build_data(self):
False,
)
if disabled_optional_products is not None:
self.req_payload["options"][
"disabled_optional_products"
] = disabled_optional_products
self.req_payload["options"]["disabled_optional_products"] = (
disabled_optional_products
)
if enabled_ext_product_search is not None:
self.req_payload["options"][
"enabled_extended_product_search"
] = enabled_ext_product_search
self.req_payload["options"]["enabled_extended_product_search"] = (
enabled_ext_product_search
)

def _handle_response_success(self):
json_data = self.response.json()
Expand Down
3 changes: 1 addition & 2 deletions qpc/tests/cred/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@


@pytest.fixture(autouse=True)
def _setup_server_config_file(server_config):
...
def _setup_server_config_file(server_config): ...


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions qpc/tests/insights/test_insights_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ def test_insights_login_normal_behavior(self, faker, mocker, capsys):
assert "Waiting for login authorization ..." in stdout_lines[3]
assert "Login authorization successful." in stdout_lines[4]

def test_insights_login_auth_error(self, faker, mocker, capsys):
def test_insights_login_auth_error(self, mocker, capsys):
"""Testing that insights login catches auth errors."""
err_message = messages.INSIGHTS_LOGIN_REQUEST_FAILED % "Network Error"
mocker.patch.object(
InsightsAuth, "request_auth", side_effect=InsightsAuthError(err_message)
)
test_argv = ["/bin/qpc", "insights", "login"]
with mock.patch.object(sys, "argv", test_argv):
with mock.patch.object(sys, "argv", test_argv), pytest.raises(SystemExit):
CLI().main()
out, err = capsys.readouterr()
assert err_message in err
5 changes: 3 additions & 2 deletions qpc/tests/insights/test_insights_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ def test_insights_publish_args_are_mutually_exclusive(self, mocker):
"--report",
"1",
]
with pytest.raises(SystemExit) as exc_info, mock.patch.object(
sys, "argv", test_argv
with (
pytest.raises(SystemExit) as exc_info,
mock.patch.object(sys, "argv", test_argv),
):
CLI().main()
# argparse will always exit with value 2
Expand Down
Loading
Loading