stravalib
stravalib copied to clipboard
Deprecate of Activity.TYPES attr in model.py (when we fully deprecate types in favor of sport_types)
In the model.py module there is a attr that was added for backward compatibility
# Added for backward compatibility
# TODO maybe deprecate?
TYPES: ClassVar[Tuple[Any, ...]] = get_args(
ActivityType.__fields__["__root__"].type_
)
It might be best to deprecate this as discussed here in the review of #387
this seems like a small issue that one of us would be able to knock out easily! @enadeau you and i had discussed this back in august. Should we remove the types attr in model.py? Strava now favors sport_type over type. But i'm not sure if this will break things or not for some users?
@jsamoocha there is a note in this section of the code to deprecate this element. It returns the (deprecated?) type list of accepted values. should i submit a quick PR to remove it in our 2.0 work and add this to our 2.0 milestone?
i'm just trying to see where we can knock out issues that have been opened for a while as we go.
I actually looked into this more. I think we should KEEP the TYPES attr until we fully remove the deprecated types (in favor of sport_types) attribute. we use .TYPES throughout to check if someone using the deprecated types list of valid types is in deed referencing a valid TYPE. When we remove it altogether in favor or sport_type let's remove. i'm doing to pull this off of the stravalib 2.0 milestone list UNLESS we decide to fully deprecate types.
Yes, we can always deprecate this later. The TYPES
attribute is unrelated to the pydantic v2 migration.
ok - i think i will close this issue given there is no timeline on when we wish to deprecate but we might want to do so when strava fully removes it. We can always reopen. i'm trying to clean up issues!