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

chore: update py version in lint workflow to 3.13 #4450

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jomcgi
Copy link
Contributor

@jomcgi jomcgi commented Feb 27, 2025

Description

This upgrade was delayed due to an issue where pylint was unable to import collections.abc
pylint-dev/pylint#10112

Update references to 3.13 now that the underlying issue has been resolved.

Fixes #4366

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Pushed change & triggered CI to verify the workflow runs as expected with python 3.13

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@jomcgi jomcgi force-pushed the chore-update-ci-lint-pyversion branch 2 times, most recently from ee82a5c to 8740573 Compare February 27, 2025 12:51
@jomcgi jomcgi closed this Feb 27, 2025
@jomcgi jomcgi force-pushed the chore-update-ci-lint-pyversion branch from 8740573 to ac7329c Compare February 27, 2025 12:55
This upgrade was delayed due to an issue where pylint
was unable to import collections.abc
Update references to 3.13 now that the underlying issue
has been resolved.
Add pylint disable comments for existing violations
@jomcgi jomcgi reopened this Feb 27, 2025
@jomcgi jomcgi changed the title [WIP] chore: update py version in lint workflow to 3.13 chore: update py version in lint workflow to 3.13 Feb 27, 2025
@jomcgi jomcgi marked this pull request as ready for review February 27, 2025 13:12
@jomcgi jomcgi requested a review from a team as a code owner February 27, 2025 13:12
@@ -97,7 +97,7 @@


class ZipkinExporter(SpanExporter):
def __init__(
def __init__( # pylint: disable=too-many-positional-arguments
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should disable this globally instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a useful check - having a lot of positional arguments adds complexity & implicitly couples the order of arguments.
I might be missing something though as I'm less familiar with the spec / codebase.
Would the main benefit of disabling this globally be that we reduce the number of pylint disable comments?

Copy link
Member

@emdneto emdneto Feb 28, 2025

Choose a reason for hiding this comment

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

can we increase the values here? https://github.com/open-telemetry/opentelemetry-python/blob/main/.pylintrc#L455 I'm also concerned about adding pylint disable comments in every place

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's merit to both approaches.

Increasing the max value globally would reduce pylint disable comments, but keeping the check and adding disable comments where necessary flags this for future contributors to consider.

For new implementations, we could also follow the Pylint docs suggestion of using * to enforce keyword-only arguments:

# Instead of:
def method(self, a, b, c, d, e):  # [too-many-positional-arguments]
    pass

# Consider:
def method(self, a, b, c, d, *, e=False):
    pass

As I'm relatively new to this project, those of you with more context may have better insight into which approach aligns best with the project's conventions.

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.

Update lint CI Jobs to python3.13
3 participants