stravalib
stravalib copied to clipboard
Add support for sport_type activity attribute and deprecate type activity attribute
From the Strava API changelog:
June 15, 2022
Introduction of activity sport_type. This is the preferred field to use moving forward, as opposed to type, which is now considered deprecated. Please note: this change is backward compatible and type will still be supported. The SportType enumeration is distinct from ActivityType in that it includes new types (e.g. MountainBikeRide). In requests where both type and sport_type are present, type will be ignored.
There are several client methods that use type or activity_type arguments. These should be deprecated and replaced by the preferred sport_type.
#362 Adds support for sport_type in the update_activity() method. Remaining TODO:
- [ ] Support
sport_type(and deprecateactivity_type) increate_activity() - [ ] Add deprecation warnings when using the
activity_typeattribute inmodelmodule (seeBackwardCompatibilityMixin.__getattribute__())
i'm attempting the first part of this. it seems to be generally working in think but i don't fully understand how to adjust the tests to ensure things work with sport_type and variations of sport type vs "type" or activity_type in our code. .