Skip to content

Commit ec8ffa1

Browse files
authored
chore: Release 0.9.15 (#20)
* chore: Release 0.9.15 Signed-off-by: friendsa <github@duanfei.org> * update Signed-off-by: friendsa <github@duanfei.org> * add dependabot Signed-off-by: friendsa <github@duanfei.org> * update workflows Signed-off-by: friendsa <github@duanfei.org> --------- Signed-off-by: friendsa <github@duanfei.org>
1 parent aefb0ae commit ec8ffa1

8 files changed

Lines changed: 519 additions & 35 deletions

File tree

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
labels:
9+
- "dependencies"
10+
- "github-actions"
11+
groups:
12+
actions:
13+
patterns:
14+
- "*"
15+
16+
# Maintain dependencies for Python (pip/uv)
17+
- package-ecosystem: "pip"
18+
directory: "/"
19+
schedule:
20+
interval: "monthly"
21+
labels:
22+
- "dependencies"
23+
- "python"
24+
groups:
25+
python-deps:
26+
patterns:
27+
- "*"

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6.0.1
1818

1919
- name: Install uv
20-
uses: astral-sh/setup-uv@v5
20+
uses: astral-sh/setup-uv@v7
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
enable-cache: true
@@ -28,6 +28,9 @@ jobs:
2828
- name: Build package
2929
run: uv build
3030

31+
- name: Test with python ${{ matrix.python-version }}
32+
run: uv run --frozen pytest
33+
3134
- name: Run tests with coverage
3235
run: uv run pytest --cov=fit_tool --cov-report=xml --cov-report=term --junitxml=junit.xml
3336

.github/workflows/publish.yml

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,60 @@
1-
name: Publish to PyPI
1+
name: Release
22

33
on:
4-
release:
5-
types: [published]
64
push:
75
tags:
8-
- "v*"
6+
- "*"
97
workflow_dispatch:
108

119
jobs:
12-
build:
10+
release-pypi:
11+
name: Release to PyPI
1312
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
contents: write
16+
1417
steps:
15-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v6.0.1
1619

1720
- name: Install uv
18-
uses: astral-sh/setup-uv@v5
21+
uses: astral-sh/setup-uv@v7
22+
with:
23+
enable-cache: "auto"
24+
25+
- name: Check prerelease
26+
id: check_version
27+
run: |
28+
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9.]+$ ]]; then
29+
echo "PRERELEASE=false" >> $GITHUB_OUTPUT
30+
else
31+
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
32+
fi
1933
2034
- name: Build package
2135
run: uv build
2236

23-
- name: Upload build artifacts
24-
uses: actions/upload-artifact@v4
37+
- name: Upload artifacts
38+
uses: actions/upload-artifact@v6.0.0
2539
with:
26-
name: dist
27-
path: dist/
40+
name: fit-tool-wheel
41+
path: dist/*.whl
42+
if-no-files-found: error
43+
retention-days: 15
2844

29-
publish:
30-
needs: build
31-
runs-on: ubuntu-latest
32-
environment: pypi
33-
permissions:
34-
id-token: write
35-
steps:
36-
- uses: actions/checkout@v4
45+
- name: Publish to PyPI
46+
run: uv publish --no-build
3747

38-
- name: Install uv
39-
uses: astral-sh/setup-uv@v5
48+
- name: Get Changelog
49+
id: get-changelog
50+
run: |
51+
awk '/## Release/{if (flag==1)exit;else;flag=1;next} flag' CHANGELOG.md > .changelog.md
4052
41-
- name: Download build artifacts
42-
uses: actions/download-artifact@v4
53+
- name: Create Release
54+
uses: softprops/action-gh-release@v2
4355
with:
44-
name: dist
45-
path: dist/
46-
47-
- name: Publish to PyPI
48-
run: uv publish
56+
body_path: .changelog.md
57+
draft: false
58+
prerelease: ${{ steps.check_version.outputs.PRERELEASE }}
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Release v0.9.15 (2026-02-02)
2+
3+
### Features & Improvements
4+
5+
- Optimize `Field.to_bytes` with `b''.join` for better performance. ([#4](https://github.com/shaonianche/python_fit_tool/issues/4))
6+
- Remove redundant record re-encoding verification from `FitFile.from_bytes` for improved performance. ([#10](https://github.com/shaonianche/python_fit_tool/issues/10))
7+
- Add proper logging for unknown base types in profile generation. ([#17](https://github.com/shaonianche/python_fit_tool/issues/17))
8+
- Add uv support and modernize CLI. ([#18](https://github.com/shaonianche/python_fit_tool/issues/18))
9+
10+
### Bug Fixes
11+
12+
- Fix test errors. ([#2](https://github.com/shaonianche/python_fit_tool/issues/2))
13+
- Optimize `get_developer_field` lookup and fix `StopIteration` bug. ([#7](https://github.com/shaonianche/python_fit_tool/issues/7))
14+
15+
### Dependencies
16+
17+
- Switch the build toolchain to UV ([#19](https://github.com/shaonianche/python_fit_tool/issues/19))
18+
19+
### Miscellany
20+
21+
- Add Codecov integration for code coverage reporting. ([#11](https://github.com/shaonianche/python_fit_tool/issues/11))
22+
- Improve test coverage. ([#13](https://github.com/shaonianche/python_fit_tool/issues/13))

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
> **Note**: This is a community-maintained fork. The original package was removed from PyPI by its author and cannot be restored. This repository continues development and publishing under the same package name.
2+
13
A library for reading and writing Garmin FIT files.
24

35
## Background
@@ -26,7 +28,7 @@ Command line interface
2628
=======================
2729

2830
```console
29-
usage: fit-tool [-h] [-v] [-o OUTPUT] [-l LOG] [-t TYPE] FILE
31+
usage: uvx fit-tool [-h] [-v] [-o OUTPUT] [-l LOG] [-t TYPE] FILE
3032

3133
Tool for managing FIT files.
3234

@@ -45,8 +47,8 @@ optional arguments:
4547
### Convert file to CSV
4648

4749
```bash
48-
# Using uv
49-
uv run fit-tool oldstage.fit
50+
# Using uvx
51+
uvx fit-tool oldstage.fit
5052

5153
# Or after installation
5254
fit-tool oldstage.fit

news/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

pyproject.toml

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "fit-tool"
7-
version = "0.9.14"
7+
version = "0.9.15"
88
description = "A library for reading and writing Garmin FIT files."
99
readme = "README.md"
1010
license = "BSD-3-Clause"
1111
authors = [
12+
{name = "Fei Duan", email = "github@duanfei.org"},
1213
{name = "Matt Tucker", email = "mtucker@stagescycling.com"}
1314
]
15+
keywords = ["fit", "garmin", "fitness", "cycling", "gps", "workout", "activity"]
1416
classifiers = [
1517
"Development Status :: 4 - Beta",
1618
"Intended Audience :: Developers",
@@ -38,6 +40,8 @@ test = [
3840
[project.urls]
3941
Homepage = "https://github.com/shaonianche/python_fit_tool"
4042
Repository = "https://github.com/shaonianche/python_fit_tool.git"
43+
Documentation = "https://github.com/shaonianche/python_fit_tool#readme"
44+
Changelog = "https://github.com/shaonianche/python_fit_tool/blob/main/CHANGELOG.md"
4145

4246
[project.scripts]
4347
fit-tool = "fit_tool.cli:main"
@@ -51,14 +55,20 @@ zip-safe = false
5155
[tool.pytest.ini_options]
5256
testpaths = ["fit_tool/tests"]
5357
python_files = ["test_*.py"]
58+
filterwarnings = [
59+
"ignore::DeprecationWarning",
60+
]
61+
addopts = "-r aR"
5462

5563
[dependency-groups]
5664
dev = [
5765
"pytest>=7.0",
5866
"pytest-cov>=4.0",
67+
"towncrier>=24.8.0",
5968
]
6069

6170
[tool.coverage.run]
71+
branch = true
6272
source = ["fit_tool"]
6373
omit = [
6474
"fit_tool/tests/**/*",
@@ -71,5 +81,80 @@ omit = [
7181
[tool.coverage.report]
7282
exclude_lines = [
7383
"pragma: no cover",
84+
"def __repr__",
85+
"raise AssertionError",
86+
"raise NotImplementedError",
7487
"if __name__ == .__main__.:",
88+
"if TYPE_CHECKING:",
89+
]
90+
ignore_errors = true
91+
92+
[tool.ruff]
93+
line-length = 120
94+
target-version = "py38"
95+
96+
[tool.ruff.lint]
97+
extend-select = [
98+
"I", # isort
99+
"B", # flake8-bugbear
100+
"C4", # flake8-comprehensions
101+
"FA", # flake8-future-annotations
102+
"UP", # pyupgrade
103+
"W", # pycodestyle
75104
]
105+
106+
[tool.ruff.lint.isort]
107+
known-first-party = ["fit_tool"]
108+
109+
[tool.mypy]
110+
follow_imports = "silent"
111+
ignore_missing_imports = true
112+
disallow_incomplete_defs = true
113+
disallow_untyped_defs = true
114+
exclude = "fit_tool/(tests|examples|gen|profile/messages)"
115+
116+
[tool.codespell]
117+
ignore-words-list = "ba,te"
118+
119+
[tool.towncrier]
120+
package = "fit_tool"
121+
filename = "CHANGELOG.md"
122+
issue_format = "[#{issue}](https://github.com/shaonianche/python_fit_tool/issues/{issue})"
123+
directory = "news/"
124+
title_format = "## Release v{version} ({project_date})"
125+
underlines = ["", "", ""]
126+
127+
[[tool.towncrier.type]]
128+
directory = "break"
129+
name = "Breaking Changes"
130+
showcontent = true
131+
132+
[[tool.towncrier.type]]
133+
directory = "feature"
134+
name = "Features & Improvements"
135+
showcontent = true
136+
137+
[[tool.towncrier.type]]
138+
directory = "bugfix"
139+
name = "Bug Fixes"
140+
showcontent = true
141+
142+
[[tool.towncrier.type]]
143+
directory = "doc"
144+
name = "Documentation"
145+
showcontent = true
146+
147+
[[tool.towncrier.type]]
148+
directory = "dep"
149+
name = "Dependencies"
150+
showcontent = true
151+
152+
[[tool.towncrier.type]]
153+
directory = "removal"
154+
name = "Removals and Deprecations"
155+
showcontent = true
156+
157+
[[tool.towncrier.type]]
158+
directory = "misc"
159+
name = "Miscellany"
160+
showcontent = true

0 commit comments

Comments
 (0)