Skip to content

Commit d24f29b

Browse files
Bordacodexpre-commit-ci[bot]
committed
fix(pkg,ci): building package (#492)
- Fixed package builds for the `src` layout using setuptools discovery with typed package support. - Improved release CI artifact handling and publish trigger conditions. - Updated release packaging metadata, changelog, and lockfile for version 2.6.0. - Improved packaging validation by adding package config changes to build checks. --------- Co-authored-by: Codex <codex@openai.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1bf611d commit d24f29b

8 files changed

Lines changed: 71 additions & 8 deletions

File tree

.github/workflows/build-package.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ permissions:
44
contents: read
55

66
on:
7+
push:
8+
branches: ['release/*', 'develop']
9+
pull_request:
10+
branches: ['release/*', 'develop']
11+
paths:
12+
- 'src/**'
13+
- 'tests/**'
14+
- 'pyproject.toml'
15+
- '.github/workflows/build-package.yml'
716
workflow_call:
817
inputs:
918
python-version:
@@ -29,6 +38,7 @@ jobs:
2938
uv sync --frozen --group build
3039
uv build
3140
uv run twine check --strict dist/*
41+
ls -l dist/
3242
3343
- name: 📤 Upload distribution artifacts
3444
uses: actions/upload-artifact@v7

.github/workflows/ci-build-docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Docs Test WorkFlow 📚
22

33
on:
4+
push:
5+
branches: ['release/*', 'develop']
46
pull_request:
57
branches: ['release/*', 'develop']
68

.github/workflows/ci-integrations.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Integration Tests
22

33
on:
4+
push:
5+
branches: ['release/*', 'develop']
46
pull_request:
57
paths:
68
- 'src/trackers/core/**'

.github/workflows/ci-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Pytest/Test Workflow
22

33
on:
4+
push:
5+
branches: ['release/*', 'develop']
46
pull_request:
57
branches: ['release/*', 'develop']
68

.github/workflows/publish-release.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
push:
55
tags:
66
- "[0-9]+.[0-9]+.[0-9]+"
7-
workflow_dispatch:
7+
release:
8+
types: [created]
89
pull_request:
910
branches: ['release/*', 'develop']
1011
paths:
@@ -22,6 +23,7 @@ jobs:
2223
publish-release:
2324
name: Publish Release Package
2425
needs: build
26+
if: github.event_name == 'push'
2527
runs-on: ubuntu-latest
2628
environment:
2729
name: release
@@ -32,7 +34,7 @@ jobs:
3234
contents: read # Required for checkout
3335
steps:
3436
- name: 📥 Download distribution artifacts
35-
uses: actions/download-artifact@v8
37+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.1.8
3638
with:
3739
name: dist
3840
path: dist/
@@ -44,3 +46,27 @@ jobs:
4446
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
4547
with:
4648
attestations: true
49+
50+
publish-github-release:
51+
name: Upload GitHub Release Artifacts
52+
needs: build
53+
if: github.event_name == 'release' && github.event.action == 'created'
54+
runs-on: ubuntu-latest
55+
permissions:
56+
contents: write # Required to create and update GitHub Releases
57+
steps:
58+
- name: 📥 Download distribution artifacts
59+
uses: actions/download-artifact@v8
60+
with:
61+
name: dist
62+
path: dist/
63+
- name: List distribution artifacts
64+
run: ls -lh dist/
65+
66+
- name: 📦 Upload release assets
67+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.2.1
68+
with:
69+
tag_name: ${{ github.ref_name }}
70+
files: dist/*
71+
fail_on_unmatched_files: true
72+
generate_release_notes: true

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ wandb/
178178

179179
# AI tools
180180
*.local.*
181+
.claude/
182+
.plans/
183+
.experiments/
181184
.developments/
182185
.reports/
183186
.temp/
187+
.python-version
188+
releases/
189+
outputs/
190+
191+
autotune/mot17/
192+
autotune/pretrained/
193+
autotune/*.zip

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ repos:
6666
rev: 'v2.1.0'
6767
hooks:
6868
- id: mypy
69+
pass_filenames: false
6970
additional_dependencies: [numpy,types-aiofiles]

pyproject.toml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,18 @@ mypy-types = [
8181
]
8282

8383
[build-system]
84-
requires = ["hatchling"]
85-
build-backend = "hatchling.build"
84+
requires = ["setuptools>=61", "wheel"]
85+
build-backend = "setuptools.build_meta"
8686

87-
[tool.hatch.build]
88-
sources = ["src"]
87+
[tool.setuptools]
88+
include-package-data = false
8989

90-
[tool.hatch.build.targets.wheel]
91-
packages = ["src/trackers"]
90+
[tool.setuptools.packages.find]
91+
where = ["src"]
92+
include = ["trackers*"]
93+
94+
[tool.setuptools.package-data]
95+
trackers = ["py.typed"]
9296

9397
[tool.ruff]
9498
target-version = "py310"
@@ -198,6 +202,7 @@ ignore-words-list = "mot"
198202
python_version = "3.10"
199203
mypy_path = "src"
200204
plugins = ["numpy.typing.mypy_plugin"]
205+
files = ["src", "tests", "demo"]
201206

202207
[[tool.mypy.overrides]]
203208
module = [
@@ -209,5 +214,10 @@ module = [
209214
"firerequests",
210215
"scipy",
211216
"scipy.*",
217+
"cv2",
218+
"rfdetr",
219+
"rfdetr.*",
220+
"supervision",
221+
"supervision.*",
212222
]
213223
ignore_missing_imports = true

0 commit comments

Comments
 (0)