pre-commit: clean up Python flake8 excludes with black
https://github.com/psf/black
https://black.readthedocs.io/en/stable/
Description
This PR now allows us to check all our Python files with flake8.
The excluded files have been cleaned up and formatted with black.
"By using Black, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters.
Black makes code review faster by producing the smallest diffs possible. Blackened code looks the same regardless of the project you’re reading. Formatting becomes transparent after a while and you can focus on the content instead."
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [X] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
First ran black on the excluded files.
Then ran: pre-commit run --all-files and the flake8 test passed.
How did you try to break this feature and the system with this change?
@blueorangutan package
@jbampton a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 17.39%. Comparing base (96ccd7e) to head (82574eb).
:warning: Report is 13 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9793 +/- ##
=========================================
Coverage 17.39% 17.39%
- Complexity 15283 15285 +2
=========================================
Files 5889 5889
Lines 526141 526141
Branches 64234 64234
=========================================
Hits 91542 91542
Misses 424265 424265
Partials 10334 10334
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 3.62% <ø> (ø) |
|
| unittests | 18.44% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11339
@blueorangutan test
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
[SF] Trillian test result (tid-11672) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 72113 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9793-t11672-kvm-ol8.zip Smoke tests completed. 138 look OK, 3 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_04_nonsecured_to_secured_vm_migration | Error |
351.08 | test_vm_life_cycle.py |
| test_01_cancel_host_maintenace_with_no_migration_jobs | Error |
2487.06 | test_host_maintenance.py |
| test_hostha_enable_ha_when_host_in_maintenance | Error |
432.35 | test_hostha_kvm.py |
@blueorangutan package
@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
@DaanHoogland @jbampton should we add black as a pre-commit hook? I have been thinking of fixing formatting for our tests and marvin lib as well. Not in this PR, but a separate PR for that.
Hey @vishesh92 I added black pre-commit on Apache Sedona here:
https://github.com/apache/sedona/pull/1593
There are a lot more pre-commit hooks we can add to CloudStack including black.
I was waiting for some of my PRs to be merged before adding more pre-commit hooks
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11435
@blueorangutan package
@jbampton a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11869
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
@blueorangutan package
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11955
@blueorangutan test
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
[SF] Trillian test result (tid-12015) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 108188 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9793-t12015-kvm-ol8.zip Smoke tests completed. 140 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_01_invalid_upgrade_kubernetes_cluster | Failure |
3639.18 | test_kubernetes_clusters.py |
| test_02_upgrade_kubernetes_cluster | Failure |
3639.09 | test_kubernetes_clusters.py |
| test_03_deploy_and_scale_kubernetes_cluster | Failure |
3638.78 | test_kubernetes_clusters.py |
| test_04_autoscale_kubernetes_cluster | Failure |
3636.99 | test_kubernetes_clusters.py |
| test_05_basic_lifecycle_kubernetes_cluster | Failure |
3640.37 | test_kubernetes_clusters.py |
| test_06_delete_kubernetes_cluster | Failure |
3636.07 | test_kubernetes_clusters.py |
| test_08_upgrade_kubernetes_ha_cluster | Failure |
3665.32 | test_kubernetes_clusters.py |
| test_10_vpc_tier_kubernetes_cluster | Failure |
3697.74 | test_kubernetes_clusters.py |
@blueorangutan package
@jbampton a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15043