upgrade garmin fit sdk profile version 21.188.0#22
upgrade garmin fit sdk profile version 21.188.0#22shaonianche wants to merge 53 commits intomainfrom
Conversation
- Updated import paths in test_profile.py and test_record.py for consistency. - Refactored test methods in test_record.py to use assert methods instead of plain assertions. - Modified test_sdk_files.py to improve readability and structure. - Updated test_workout_files.py to enhance logging and maintain consistency in test methods. - Refactored test_write_activity_file.py to improve clarity and maintainability. - Updated pyproject.toml to specify dependencies and improve project metadata. - Revised setup.py to align with updated dependencies and project structure.
Refactor test files and update dependencies #1
- Updated string formatting to use double quotes consistently across multiple files. - Changed minor formatting issues in `fit_tool/fit_file_header.py`, `fit_tool/gen/gen_profile.py`, and `fit_tool/gen/profile.py`. - Improved type hinting for function parameters and return types in several classes. - Refactored `to_bytes` and `from_bytes` methods for better clarity and consistency. - Adjusted comments and docstrings for improved understanding. - Removed unnecessary imports and organized existing ones. - Updated `pyproject.toml` to exclude specific directories from linting.
Refactor code for consistency and readability #4
Add CI workflow for linting and testing across multiple Python versions #5
Enhance CI workflow to include coverage reporting in pytest tests #2
fix(pyproject.toml): update bitstruct dependency to version 8.21.0 The Python version matrix in the CI configuration was updated to include version 3.14 to ensure compatibility and testing with the latest Python release. Additionally, the bitstruct dependency was updated to version 8.21.0 to address a security vulnerability and improve the overall security of the project.
fix(ci.yml): update Python version matrix to include 3.14
fix(pyproject.toml): update license format and add MIT License classi…
Add release ci #11
…nge version to dynamic
fix(pyproject.toml): add setuptools-scm to build requirements and change version to dynamic
…string interpolation docs(release.yml): update changelog configuration to use double quotes for consistency style(release.yml): fix indentation and formatting issues in release workflow The changes improve the consistency and readability of the release workflow file. Using double quotes for string interpolation and configuration values ensures that the YAML file is properly formatted and easier to maintain. The indentation and formatting fixes make the file more readable and consistent with common YAML style guidelines.
…e prerelease check logic
…he latest version docs(fit_tool/gen/gen_profile.py): add comments to clarify the purpose of the code block The SDK_VERSION in __init__.py was updated to 21.171.00 to ensure compatibility with the latest version of the SDK. Additionally, comments were added to gen_profile.py to improve code readability and maintainability.
chore(pyproject.toml): configure coverage settings for fit_tool package The pytest command in tox.toml now includes coverage reporting to ensure code coverage is checked during testing. The pyproject.toml file has been updated to configure coverage settings, including setting the minimum coverage threshold to 80% and enabling the display of missing coverage.
fix(fit_tool/__init__.py): update SDK_VERSION to 21.171.00 #13
Refactor code structure for improved readability and maintainability
Signed-off-by: shaonianche <github@duanfei.org>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix:examples code
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix:calculation of version numbers with different digits
* fix:default header crc * Update fit_tool/fit_file_builder.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* fix:code type warning Signed-off-by: shaonianche <github@duanfei.org> * fix lint Signed-off-by: shaonianche <github@duanfei.org> * fix Signed-off-by: shaonianche <github@duanfei.org> * fix Signed-off-by: shaonianche <github@duanfei.org> * fix Signed-off-by: shaonianche <github@duanfei.org> * update --------- Signed-off-by: shaonianche <github@duanfei.org>
Signed-off-by: shaonianche <github@duanfei.org>
Summary of ChangesHello @shaonianche, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on updating the project to align with the latest Garmin FIT SDK profile. It involves a comprehensive regeneration of FIT message definitions and associated code, alongside general code modernization efforts such as enhanced type hinting and improved string formatting. The changes ensure compatibility with newer FIT file structures and improve the robustness of the library's internal mechanisms. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request upgrades the Garmin FIT SDK profile version, which involves extensive changes across the codebase. Many files, especially the auto-generated message definitions, have been updated to reflect the new SDK version. The manual changes primarily focus on improving code style, readability, and robustness by adopting modern Python features and safer coding practices. I've found one potential issue in fit_tool/data_message.py where a method could lead to an unhandled exception, and I've provided a suggestion to fix it. Overall, this is a solid upgrade with good improvements.
| ) | ||
|
|
||
| def get_developer_field_by_name(self, name: str) -> DeveloperField | None: | ||
| return next(iter([x for x in self.developer_fields if x.name == name])) |
There was a problem hiding this comment.
The implementation of this method is inconsistent with similar methods in this class and can lead to an unhandled StopIteration exception if the developer field is not found. The type hint suggests that None should be returned in that case.
To fix this and improve efficiency, you can use a generator expression with a default value for next().
| return next(iter([x for x in self.developer_fields if x.name == name])) | |
| return next((x for x in self.developer_fields if x.name == name), None) |
#14