-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
…m.KEY, which works on Python<3.11 but broke in 3.11 (see: python/cpython#100458)
Codecov Report
@@ Coverage Diff @@
## trunk #7 +/- ##
========================================
Coverage ? 85.58%
========================================
Files ? 92
Lines ? 5860
Branches ? 640
========================================
Hits ? 5015
Misses ? 763
Partials ? 82
|
Will follow up with an update to the Supported Python Versions table on docs.kolena.io. |
class SampleType(str, Enum): | ||
LOCATOR = "LOCATOR" | ||
LOCATOR_TEXT = "LOCATOR_TEXT" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
…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: |
There was a problem hiding this comment.
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.
Of note:
Narrower version constraints on
numpy
andpandas
for ≥3.11Skipping
pre-commit
on 3.11 for the same reason it was already skipped on 3.10Python 3.11 changed stringification for
class MyEnum(str, Enum)
and theint
equivalent. Before, ifMyEnum.MY_VALUE
was declared withmy_value
,str(MyEnum.MY_VALUE)
yieldedmy_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)
yieldsMyEnum.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
orint
Mixin Breaking Change in Python 3.11 python/cpython#100458 for more discussion on this breakage.