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

Add Python 3.10 and 3.12 support #142

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

Callum027
Copy link
Contributor

@Callum027 Callum027 commented Jul 31, 2024

Fix python-gnocchiclient on Python 3.12 by replacing usage of distutils.util.strtobool with a new function in gnocchiclient.utils that does the same thing (except returns an actual boolean instead of an integer).

Added Python 3.12 to the package Trove classifiers and tox.ini.

Also added Python 3.10 to the package Trove classifiers and tox.ini, because it is generally an anti-pattern for a package to advertise Python 3.8-3.9 and Python 3.11+ support without also supporting Python 3.10.

Fix pep8 checks by suppressing the new A005 rule.

jd
jd previously approved these changes Jul 31, 2024
@mergify mergify bot dismissed jd’s stale review July 31, 2024 10:30

Pull request has been modified.

@Callum027 Callum027 requested a review from jd August 1, 2024 06:15
jd
jd previously approved these changes Aug 1, 2024
@Callum027
Copy link
Contributor Author

Hi @jd, thanks for reviewing my PR.

I got similar errors with the unit tests when running them locally, I thought they might be environment related so I wanted to run them on GitHub Actions just to be sure. Any potential insight as to what might be causing it?

I'll troubleshoot this tomorrow morning, and see if I can figure out the cause.

@jd
Copy link
Member

jd commented Aug 1, 2024

No clue, but you can probably debug this locally then :)

@jd
Copy link
Member

jd commented Aug 1, 2024

(Note it might not be related to your PR)

@Callum027
Copy link
Contributor Author

Callum027 commented Aug 2, 2024

Running the tests with debug logging locally, I get this error from Gnocchi API.

DEBUG [pifpaf.drivers] gnocchi-api[1027460] output: 2024-08-02 14:05:31,943 [1030335] CRITICAL root: Traceback (most recent call last):
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/dec.py", line 129, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     resp = self.call_func(req, *args, **kw)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/dec.py", line 193, in call_func
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return self.func(req, *args, **kwargs)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/gnocchi/rest/http_proxy_to_wsgi.py", line 60, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return req.get_response(self.application)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/request.py", line 1313, in send
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     status, headers, app_iter = self.call_application(
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                                 ^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/request.py", line 1278, in call_application
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     app_iter = application(self.environ, start_response)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/dec.py", line 129, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     resp = self.call_func(req, *args, **kw)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/dec.py", line 193, in call_func
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return self.func(req, *args, **kwargs)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/oslo_middleware/base.py", line 124, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     response = req.get_response(self.application)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/request.py", line 1313, in send
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     status, headers, app_iter = self.call_application(
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                                 ^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/request.py", line 1278, in call_application
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     app_iter = application(self.environ, start_response)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/paste/urlmap.py", line 211, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return app(environ, start_response)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/webob/exc.py", line 1165, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return self.application(environ, start_response)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/gnocchi/rest/app.py", line 132, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return self.app(environ, start_response)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/middleware/recursive.py", line 56, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return self.application(environ, start_response)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/core.py", line 841, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return super(Pecan, self).__call__(environ, start_response)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/core.py", line 681, in __call__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     controller, args, kwargs = self.find_controller(state)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/core.py", line 859, in find_controller
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     controller, args, kw = super(Pecan, self).find_controller(_state)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/core.py", line 449, in find_controller
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     controller, remainder = self.route(req, self.root, path)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/core.py", line 282, in route
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     node, remainder = lookup_controller(node, path, req)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/routing.py", line 140, in lookup_controller
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     obj, remainder = find_object(obj, remainder, notfound_handlers,
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/routing.py", line 246, in find_object
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     next_obj, next_remainder = route(remainder, request)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                                ^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/rest.py", line 143, in _route
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     _lookup_result = self._handle_lookup(args, request)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/rest.py", line 188, in _handle_lookup
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     result = handle_lookup_traversal(lookup, args)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/pecan/routing.py", line 174, in handle_lookup_traversal
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     result = obj(*args)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:              ^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/gnocchi/rest/api.py", line 568, in _lookup
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     metrics = pecan.request.indexer.list_metrics(
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/oslo_db/api.py", line 144, in wrapper
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     with excutils.save_and_reraise_exception() as ectxt:
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/oslo_utils/excutils.py", line 227, in __exit__
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     self.force_reraise()
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/oslo_utils/excutils.py", line 200, in force_reraise
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     raise self.value
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/oslo_db/api.py", line 142, in wrapper
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     return f(*args, **kwargs)
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:            ^^^^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:   File "/home/callumdickinson/dev/github.com/Callum027/python-gnocchiclient/.tox/py311/lib/python3.11/site-packages/gnocchi/indexer/sqlalchemy.py", line 777, in list_metrics
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:     q = q.options(sqlalchemy.orm.joinedload(Metric.resource))
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output:                                             ^^^^^^^^^^^^^^^
DEBUG [pifpaf.drivers] gnocchi-api[1027460] output: AttributeError: type object 'Metric' has no attribute 'resource'

At this point this error seems to be the likely cause. This line was changed in the following commit:

gnocchixyz/gnocchi@42528c0

Indeed, the resource attribute is not defined on the Metric indexer database model (only resource_id). And this is not the only line where Metric.resource is referenced in this way.

EDIT: While this is indeed an issue, it doesn't appear to be the cause of the test failures. I'm unsure of the cause of the above error, as this shouldn't be caused the deprecated use of backref in the models, it appears to be fixed by switching to back_populates (supported in SQLAlchemy 1.4).

@Callum027
Copy link
Contributor Author

Callum027 commented Aug 2, 2024

Here are the logs for the aggregates query that failed to find the metric.

DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: 2024-08-02 18:22:41,321 [3580634] DEBUG    gnocchi.rest.aggregates.api: Filters to be used in the search query: [{'and': [{'and': [{'or': [{'<': {'started_at': np.datetime64('2015-03-06T14:36:00.000000000')}}, {'<': {'revision_start': np.datetime64('2015-03-06T14:36:00.000000000')}}]}, {'or': [{'>=': {'ended_at': np.datetime64('2015-03-06T14:32:00.000000000')}}, {'=': {'ended_at': None}}]}]}, {'like': {'original_resource_id': 'metric-res%'}}]}].
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: 2024-08-02 18:22:41,358 [3580634] DEBUG    gnocchi.indexer.sqlalchemy: Executing query [SELECT resource.id, resource.creator, resource.started_at, resource.revision_start, resource.ended_at, resource.user_id, resource.project_id, resource.original_resource_id, resource.type, archive_policy_1.name, archive_policy_1.back_window, archive_policy_1.definition, archive_policy_1.aggregation_methods, metric_1.id AS id_1, metric_1.archive_policy_name, metric_1.creator AS creator_1, metric_1.resource_id, metric_1.name AS name_1, metric_1.unit, metric_1.status, metric_1.needs_raw_data_truncation
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: FROM resource LEFT OUTER JOIN metric AS metric_1 ON resource.id = metric_1.resource_id AND metric_1.status = :status_1 LEFT OUTER JOIN archive_policy AS archive_policy_1 ON archive_policy_1.name = metric_1.archive_policy_name
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: WHERE (resource.started_at < :started_at_1 OR resource.revision_start < :revision_start_1) AND (resource.ended_at >= :ended_at_1 OR resource.ended_at IS NULL) AND resource.original_resource_id LIKE :original_resource_id_1 ORDER BY resource.project_id ASC, resource.user_id ASC, resource.id ASC] to search for resources.
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: 2024-08-02 18:22:41,485 [3580634] DEBUG    gnocchi.indexer.sqlalchemy: Resources [quantity=0] [[]] found with query: [SELECT resource.id, resource.creator, resource.started_at, resource.revision_start, resource.ended_at, resource.user_id, resource.project_id, resource.original_resource_id, resource.type, archive_policy_1.name, archive_policy_1.back_window, archive_policy_1.definition, archive_policy_1.aggregation_methods, metric_1.id AS id_1, metric_1.archive_policy_name, metric_1.creator AS creator_1, metric_1.resource_id, metric_1.name AS name_1, metric_1.unit, metric_1.status, metric_1.needs_raw_data_truncation
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: FROM resource LEFT OUTER JOIN metric AS metric_1 ON resource.id = metric_1.resource_id AND metric_1.status = :status_1 LEFT OUTER JOIN archive_policy AS archive_policy_1 ON archive_policy_1.name = metric_1.archive_policy_name
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: WHERE (resource.started_at < :started_at_1 OR resource.revision_start < :revision_start_1) AND (resource.ended_at >= :ended_at_1 OR resource.ended_at IS NULL) AND resource.original_resource_id LIKE :original_resource_id_1 ORDER BY resource.project_id ASC, resource.user_id ASC, resource.id ASC].
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: 2024-08-02 18:22:41,566 [3580634] DEBUG    gnocchi.rest.aggregates.api: Resources found [[]] with query filter [{'and': [{'and': [{'or': [{'<': {'started_at': np.datetime64('2015-03-06T14:36:00.000000000')}}, {'<': {'revision_start': np.datetime64('2015-03-06T14:36:00.000000000')}}]}, {'or': [{'>=': {'ended_at': np.datetime64('2015-03-06T14:32:00.000000000')}}, {'=': {'ended_at': None}}]}]}, {'like': {'original_resource_id': 'metric-res%'}}]}].
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: 2024-08-02 18:22:41,568 [3580634] DEBUG    gnocchi.rest.api: Aborting request. Code [404]. Details [Metric ['metric-name'] does not exist]
DEBUG [pifpaf.drivers] gnocchi-api[3575068] output: [pid: 3580634|app: 0|req: 5/13] 127.0.0.1 () {38 vars in 832 bytes} [Fri Aug  2 18:22:41 2024] POST /v1/aggregates?details=False&granularity=1&groupby=project_id&groupby=user_id&start=2015-03-06T14%3A32%3A00Z&stop=2015-03-06T14%3A36%3A00Z&use_history=False => generated 91 bytes in 540 msecs (HTTP/1.1 404) 3 headers in 102 bytes (1 switches on core 2)

I'm not exactly sure how this works (getting a bit out of my depth here as I'm not that familiar with Gnocchi yet), but it looks like it might be a bug with gnocchixyz/gnocchi#1307 (the last major work with this code).

@Callum027
Copy link
Contributor Author

Had to make a bunch of small modifications to replicate the older toolchain the tests used to run in (using OpenStack 2023.2 upper constraints), but I bisected and confirmed that gnocchixyz/gnocchi#1307 is the cause of the failed test.

gnocchi-bisect.log

@Callum027
Copy link
Contributor Author

Submitted gnocchixyz/gnocchi#1392 to track the bug on the main Gnocchi repository.

@mergify mergify bot dismissed jd’s stale review August 5, 2024 06:10

Pull request has been modified.

@Callum027
Copy link
Contributor Author

I have worked around the behaviour change by adapting the test so that it only uses timestamps generated after the metrics have been added to Gnocchi. Not sure if this is what we want to do (or if we want to fix the underlying bug), but it will get the test to pass.

@Callum027
Copy link
Contributor Author

Callum027 commented Aug 13, 2024

Looking at the failures for the latest test, seems like it's just a transient error and it'll probably pass if run again. (I got a lot of "server closed the connection" errors running locally, not sure what the cause is (might be pifpaf-related?), but running it again fixed it).

Copy link
Contributor

@tobias-urdin tobias-urdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for looking into this, definitely something we want fix support for but i dont think changing the tests is the correct thing here instead resolving gnocchixyz/gnocchi#1392 and getting the ci working again with something like gnocchixyz/gnocchi#1395 is the correct way here

:return: ``True`` if the value is a truthy value, otherwise ``False``.
:rtype: bool
"""
val = val.lower()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we do explicitly val = str(val).lower() to ensure we get a string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, updated with your suggestion.

Fix python-gnocchiclient on Python 3.12 by replacing usage
of distutils.util.strtobool with a new function in
gnocchiclient.utils that does the same thing
(except returning an actual boolean instead of an integer).

Added Python 3.12 to the package Trove classifiers and tox.ini.

Also added Python 3.10 to the package Trove classifiers and tox.ini,
because it is generally an anti-pattern for a package to advertise
Python 3.8-3.9 and Python 3.11+ support without also supporting
Python 3.10.

Fix pep8 checks by suppressing the new A005 rule.
@mergify mergify bot dismissed tobias-urdin’s stale review August 14, 2024 21:02

Pull request has been modified.

@Callum027
Copy link
Contributor Author

thanks for looking into this, definitely something we want fix support for but i dont think changing the tests is the correct thing here instead resolving gnocchixyz/gnocchi#1392 and getting the ci working again with something like gnocchixyz/gnocchi#1395 is the correct way here

Hi Tobias, thank you for looking into the issues I've been having with the Gnocchi test suite. I've reverted the patch I made for the functional test, so that this can be merged once the fixes to Gnocchi have been made.

Regarding the last CI failure for this PR, I forgot that I also needed gnocchixyz/gnocchi#1393 applied to have it pass locally. That's probably why the CI is not passing.

@Callum027
Copy link
Contributor Author

Hi, could I please get the CI pipeline re-run? With the latest fixes to Gnocchi I'm confident it will pass this time.

tox.ini Show resolved Hide resolved
@tobias-urdin tobias-urdin merged commit a7f9e4e into gnocchixyz:master Aug 20, 2024
6 checks passed
@Callum027 Callum027 deleted the python-3.12 branch August 20, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants