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

Fix ImportError in tests for almalinux package #833

Merged
merged 1 commit into from
May 16, 2024

Conversation

bklvsky
Copy link
Contributor

@bklvsky bklvsky commented May 16, 2024

Fix ImportError in tests for almalinux package

  • Removed offending type annotations
  • Enclosed from almalinux import in try...except block

Fixes: AlmaLinux/build-system#282

@bklvsky bklvsky force-pushed the almalinux_import_fix branch from 016cbd2 to dd94a55 Compare May 16, 2024 11:12
Copy link

github-actions bot commented May 16, 2024

69 passed, 13 skipped

Code Coverage Summary

Package Line Rate
alws 76%
alws.auth 77%
alws.auth.oauth 100%
alws.crud 39%
alws.dramatiq 60%
alws.middlewares 93%
alws.perms 86%
alws.routers 56%
alws.schemas 80%
alws.utils 41%
Summary 56% (5563 / 9917)

Linter reports

Pylint report
************* Module alws.utils.oval_add_al8_gpg_keys
alws/utils/oval_add_al8_gpg_keys.py:2:0: C0301: Line too long (90/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:16:0: C0301: Line too long (97/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:29:0: C0301: Line too long (92/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:69:0: C0301: Line too long (90/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:72:0: C0301: Line too long (90/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:118:0: C0301: Line too long (91/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:122:0: C0301: Line too long (96/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:135:0: C0301: Line too long (89/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:183:0: C0301: Line too long (93/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:187:0: C0301: Line too long (100/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:208:0: C0301: Line too long (91/88) (line-too-long)
alws/utils/oval_add_al8_gpg_keys.py:99:0: R0903: Too few public methods (1/2) (too-few-public-methods)
alws/utils/oval_add_al8_gpg_keys.py:201:0: R0914: Too many local variables (17/15) (too-many-locals)

-----------------------------------
Your code has been rated at 8.63/10


Bandit report
Run started:2024-05-16 11:13:49.115412

Test results:
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html
   Location: ./alws/utils/oval_add_al8_gpg_keys.py:227:4
226	            break
227	    assert original_gpg_state, "Original GPG state not found"
228	    gpg_keys_states = generate_gpg_keys_states(states_counter, original_gpg_state)

--------------------------------------------------

Code scanned:
	Total lines of code: 239
	Total lines skipped (#nosec): 0
	Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 1
		Medium: 0
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 0
		High: 1
Files skipped (0):

View full reports on the Job Summary page.

@Korulag Korulag merged commit 27a84ee into AlmaLinux:master May 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix ImportError in oval_add_al8_gpg_keys.py
3 participants