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 Python 3.11 #7

Merged
merged 23 commits into from
May 11, 2023
Merged

Support Python 3.11 #7

merged 23 commits into from
May 11, 2023

Conversation

gordonhart
Copy link
Member

@gordonhart gordonhart commented May 9, 2023

Of note:

  1. Narrower version constraints on numpy and pandas for ≥3.11

  2. Skipping pre-commit on 3.11 for the same reason it was already skipped on 3.10

  3. Python 3.11 changed stringification for class MyEnum(str, Enum) and the int equivalent. Before, if MyEnum.MY_VALUE was declared with my_value, str(MyEnum.MY_VALUE) yielded my_value. We relied on this behavior in a number of places as a means of defining namespaced consts. In Python 3.11, str(MyEnum.MY_VALUE) yields MyEnum.MY_VALUE. To unbreak this in a backwards-compatible way, all usages have been updated to explicitly reference the associated value, e.g. MyEnum.MY_VALUE.value.

    See Enum with str or int Mixin Breaking Change in Python 3.11 python/cpython#100458 for more discussion on this breakage.

@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

❗ No coverage uploaded for pull request base (trunk@295f79f). Click here to learn what that means.
The diff coverage is 79.24%.

❗ Current head 3e9baba differs from pull request most recent head c04c4ed. Consider uploading reports for the commit c04c4ed to get more accurate results

@@           Coverage Diff            @@
##             trunk       #7   +/-   ##
========================================
  Coverage         ?   85.58%           
========================================
  Files            ?       92           
  Lines            ?     5860           
  Branches         ?      640           
========================================
  Hits             ?     5015           
  Misses           ?      763           
  Partials         ?       82           
Impacted Files Coverage Δ
kolena/_utils/_consts.py 100.00% <ø> (ø)
kolena/_utils/repository.py 75.00% <ø> (ø)
kolena/detection/test_image.py 89.36% <0.00%> (ø)
kolena/workflow/evaluator_function.py 98.85% <ø> (ø)
kolena/workflow/workflow.py 76.00% <0.00%> (ø)
kolena/detection/_internal/test_run.py 38.46% <33.33%> (ø)
kolena/_utils/instrumentation.py 68.75% <50.00%> (ø)
kolena/detection/_internal/test_case.py 62.56% <50.00%> (ø)
kolena/detection/_internal/test_suite.py 61.90% <66.66%> (ø)
kolena/workflow/test_run.py 93.75% <87.50%> (ø)
... and 11 more

@gordonhart gordonhart marked this pull request as ready for review May 10, 2023 01:26
@gordonhart
Copy link
Member Author

Will follow up with an update to the Supported Python Versions table on docs.kolena.io.

kolena/_utils/_consts.py Show resolved Hide resolved
Comment on lines -17 to -19
class SampleType(str, Enum):
LOCATOR = "LOCATOR"
LOCATOR_TEXT = "LOCATOR_TEXT"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this no longer being used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Wasn't being used. Was from when we intended to have different sample types within the kolena.detection system, which has been superseded by kolena.workflow.

kolena/_utils/batched_load.py Outdated Show resolved Hide resolved
kolena/_api/v1/samples.py Show resolved Hide resolved
…a.fr._consts; rename some already-hidden classes to remove leading underscore (already in underscored files)
from kolena.fr.datatypes import _ImageChipsDataFrame


def upload_image_chips(df: _ImageChipsDataFrame, batch_size: int = BatchSize.UPLOAD_CHIPS.value) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to kolena.fr._utils because this is an FR-specific implementation.

@gordonhart gordonhart mentioned this pull request May 11, 2023
3 tasks
@gordonhart gordonhart merged commit a3ce16a into trunk May 11, 2023
@gordonhart gordonhart deleted the gh/3.11 branch May 11, 2023 20:45
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