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

support logging on Python 3.13 fixed #546 #549

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

encbladexp
Copy link

As linked on #546, Python 3.13 finally removed the deprecate .warn(), so we now need to use .warning() instead.

Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/6122c557f3e34020bef8acad84a6c635

✔️ ara-tox-py3 SUCCESS in 4m 12s
ara-tox-linters FAILURE in 3m 34s
ara-basic-ansible-core-devel FAILURE in 5m 51s (non-voting)
✔️ ara-basic-ansible-9 SUCCESS in 6m 47s
✔️ ara-basic-ansible-core-2.16 SUCCESS in 6m 36s
✔️ ara-basic-ansible-core-2.15 SUCCESS in 6m 23s
✔️ ara-container-images SUCCESS in 11m 23s

@encbladexp
Copy link
Author

I assume the test itself is not working, right?

Test results:
	No issues identified.

Code scanned:
	Total lines of code: 7940
	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: 0
		Medium: 0
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 0
		High: 0
Files skipped (0):

real	0m1.454s
user	0m1.398s
sys	0m0.053s

At least one linter detected errors!
linters: 6299 C exit 1 (3.26 seconds) /home/zuul-worker/src/github.com/ansible-community/ara> tests/linters.sh pid=3364 [tox/execute/api.py:280]
.pkg: 6300 D delete package /home/zuul-worker/src/github.com/ansible-community/ara/.tox/.tmp/package/2/ara-1.7.2.dev5-0.editable-py2.py3-none-any.whl [tox/tox_env/python/virtual_env/package/pyproject.py:224]
  linters: FAIL code 1 (6.05=setup[2.78]+cmd[3.26] seconds)
  evaluation failed :( (6.17 seconds)

No idea why tox complains about my change. 🤔

@flowerysong
Copy link
Contributor

You didn't click on "more".

##################################################
# black
##################################################
--- /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/host.py	2024-06-06 16:41:26.260395+00:00
+++ /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/host.py	2024-06-06 16:44:30.711925+00:00
@@ -210,11 +210,13 @@
         return parser
 
     def take_action(self, args):
         # TODO: Render json properly in pretty tables
         if args.with_facts and args.formatter == "table":
-            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
+            self.log.warning(
+                "Rendering using default table formatter, use '-f yaml' or '-f json' for improved display."
+            )
 
         verify = False if args.insecure else True
         if args.ssl_ca:
             verify = args.ssl_ca
         client = get_client(
--- /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/result.py	2024-06-06 16:41:26.260395+00:00
+++ /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/result.py	2024-06-06 16:44:30.712956+00:00
@@ -215,11 +215,13 @@
         return parser
 
     def take_action(self, args):
         # TODO: Render json properly in pretty tables
         if args.with_content and args.formatter == "table":
-            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
+            self.log.warning(
+                "Rendering using default table formatter, use '-f yaml' or '-f json' for improved display."
+            )
 
         verify = False if args.insecure else True
         if args.ssl_ca:
             verify = args.ssl_ca
         client = get_client(
would reformat /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/host.py
would reformat /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/result.py
--- /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/record.py	2024-06-06 16:41:26.260395+00:00
+++ /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/record.py	2024-06-06 16:44:30.716186+00:00
@@ -132,11 +132,13 @@
         return parser
 
     def take_action(self, args):
         # TODO: Render json properly in pretty tables
         if args.formatter == "table":
-            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
+            self.log.warning(
+                "Rendering using default table formatter, use '-f yaml' or '-f json' for improved display."
+            )
 
         verify = False if args.insecure else True
         if args.ssl_ca:
             verify = args.ssl_ca
         client = get_client(
would reformat /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/record.py
--- /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/playbook.py	2024-06-06 16:41:26.260395+00:00
+++ /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/playbook.py	2024-06-06 16:44:30.965675+00:00
@@ -235,11 +235,13 @@
         return parser
 
     def take_action(self, args):
         # TODO: Render json properly in pretty tables
         if args.formatter == "table":
-            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
+            self.log.warning(
+                "Rendering using default table formatter, use '-f yaml' or '-f json' for improved display."
+            )
 
         verify = False if args.insecure else True
         if args.ssl_ca:
             verify = args.ssl_ca
         client = get_client(
would reformat /home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/playbook.py

Oh no! 💥 💔 💥
4 files would be reformatted, 80 files would be left unchanged.
##################################################
# flake8
##################################################
/home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/host.py:215:121: E501 line too long (121 > 120 characters)
            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
                                                                                                                        ^
/home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/playbook.py:240:121: E501 line too long (121 > 120 characters)
            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
                                                                                                                        ^
/home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/record.py:137:121: E501 line too long (121 > 120 characters)
            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
                                                                                                                        ^
/home/zuul-worker/src/github.com/ansible-community/ara/ara/cli/result.py:220:121: E501 line too long (121 > 120 characters)
            self.log.warning("Rendering using default table formatter, use '-f yaml' or '-f json' for improved display.")
                                                                                                                        ^

@encbladexp
Copy link
Author

Thanks, I will fix this m(

As linked on ansible-community#546,
Python 3.13 finally removed the deprecate `.warn()`, so we now need
to use `.warning()` instead.
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/2ceadbbd814e41de817461ddd4061411

✔️ ara-tox-py3 SUCCESS in 3m 30s
✔️ ara-tox-linters SUCCESS in 3m 25s
ara-basic-ansible-core-devel FAILURE in 5m 51s (non-voting)
✔️ ara-basic-ansible-9 SUCCESS in 6m 16s
✔️ ara-basic-ansible-core-2.16 SUCCESS in 6m 09s
✔️ ara-basic-ansible-core-2.15 SUCCESS in 6m 15s
✔️ ara-container-images SUCCESS in 11m 32s

@encbladexp
Copy link
Author

Fixed (/)

@dmsimard
Copy link
Contributor

Hi @encbladexp,

This looks great, thanks for looking at this!

I'll double check that it fixes the issue and we can merge the PR.

@dmsimard
Copy link
Contributor

Tengentially related, we should probably find out about resolving this other deprecation before it bites us: #503

I'll put it on my radar before tagging a new release.

@dmsimard
Copy link
Contributor

Hi @encbladexp,

This looks great, thanks for looking at this!

I'll double check that it fixes the issue and we can merge the PR.

I ran into unrelated issues (including #550) but I got a successful build and confirmed the deprecation notices were gone: https://koji.fedoraproject.org/koji/taskinfo?taskID=118918867

Good to merge 🎉

@dmsimard dmsimard merged commit e2882c8 into ansible-community:master Jun 12, 2024
1 check 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.

3 participants