Skip to content

Commit 90c8c02

Browse files
committed
chore: remove legacy shell scripts, add pre-commit hooks, drop Python 3.9
Removes unused and outdated shell scripts and legacy build utilities superseded by the new Python build system. Adds pre-commit hooks with linting applied across the codebase. Drops Python 3.9 support as it is EOL. Includes README and documentation updates for the new build workflow.
1 parent bc80276 commit 90c8c02

17 files changed

+1540
-416
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Something is broken in the build or packaging pipeline
4+
title: "fix: "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Environment
10+
11+
- **OS / Platform**: <!-- e.g. Ubuntu 22.04 x86_64, macOS 14 arm64, Windows Server 2022 -->
12+
- **Python version**: <!-- e.g. 3.11.9 -->
13+
- **ITK version / branch**: <!-- e.g. v5.4.0, or commit hash -->
14+
- **Script / entry point used**: <!-- e.g. scripts/build_wheels.py, dockcross-manylinux-build-wheels.sh -->
15+
16+
## Steps to Reproduce
17+
18+
19+
## Expected Behavior
20+
21+
<!-- What should happen. -->
22+
23+
## Actual Behavior
24+
25+
<!-- What actually happens. Paste relevant log output below. -->
26+
27+
<details>
28+
<summary>Log output</summary>
29+
30+
```
31+
```
32+
33+
</details>
34+
35+
## Additional Context
36+
37+
<!-- build_report.json contents, Docker image tag, CMake args, etc. -->

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: ITK Discourse (questions & support)
4+
url: https://discourse.itk.org
5+
about: For build questions or general ITK support, please use the ITK Discourse forum.
6+
- name: ITK Documentation
7+
url: https://itkpythonpackage.readthedocs.io
8+
about: Check the docs before filing an issue.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new capability or improvement to the build/packaging pipeline
4+
title: "feat: "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem / Motivation
10+
11+
<!-- What limitation or pain point does this address? -->
12+
13+
## Proposed Solution
14+
15+
<!-- Describe what you'd like to see added or changed. -->
16+
17+
## Alternatives Considered
18+
19+
<!-- Any other approaches you've thought about? -->
20+
21+
## Additional Context
22+
23+
<!-- Platform relevance, ITK module context, links, etc. -->

.github/pull_request_template.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Summary
2+
3+
<!-- One or two sentences describing what this PR does and why. -->
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature / enhancement
9+
- [ ] Refactor / cleanup
10+
- [ ] Docs / CI only
11+
12+
## Checklist
13+
14+
- [ ] Pre-commit hooks pass locally (`pre-commit run --all-files`)
15+
- [ ] Tested wheel build on affected platform(s) (Linux / macOS / Windows)
16+
- [ ] Docs updated if behavior changed (`docs/`)
17+
- [ ] Commit messages follow Conventional Commits (`feat:`, `fix:`, `chore:`, etc.)
18+
19+
## Platform(s) Tested
20+
21+
<!-- Check all that apply, or note "untested" where applicable. -->
22+
- [ ] Linux x86_64 (manylinux)
23+
- [ ] Linux aarch64 (manylinux)
24+
- [ ] macOS x86_64
25+
- [ ] macOS arm64
26+
- [ ] Windows x86_64
27+
28+
## Related Issues
29+
30+
<!-- Closes #... -->

.github/workflows/pre-commit.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.11"
16+
- uses: pre-commit/action@v3.0.1

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ lib
4343
lib64
4444
MANIFEST
4545
oneTBB-prefix/
46-
pyproject.toml
4746

4847
# Installer logs
4948
pip-log.txt
@@ -73,3 +72,7 @@ docs/_build
7372
# IDE junk
7473
.idea/*
7574
*.swp
75+
/itkVersion.py
76+
# pixi environments
77+
.pixi/*
78+
!.pixi/config.toml

.pre-commit-config.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Pre-commit configuration for ITKPythonPackage
2+
# Run `pre-commit install` to install git hooks locally
3+
# Run `pre-commit run --all-files` to check all files
4+
# Run `pre-commit autoupdate` to update hook versions
5+
6+
# Exclude generated/vendored directories from all hooks
7+
exclude: ^(\.pixi|build|pixi.lock|docs)/
8+
9+
repos:
10+
# General file hygiene
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v5.0.0
13+
hooks:
14+
- id: trailing-whitespace
15+
stages: [pre-commit]
16+
- id: end-of-file-fixer
17+
stages: [pre-commit]
18+
- id: check-yaml
19+
stages: [pre-commit]
20+
- id: check-toml
21+
stages: [pre-commit]
22+
- id: check-merge-conflict
23+
stages: [pre-commit]
24+
- id: check-added-large-files
25+
args: [--maxkb=500]
26+
stages: [pre-commit]
27+
# Enforce LF line endings everywhere except Windows PowerShell scripts
28+
- id: mixed-line-ending
29+
args: [--fix=lf]
30+
exclude: \.ps1$
31+
stages: [pre-commit]
32+
33+
# Python: formatting
34+
- repo: https://github.com/psf/black
35+
rev: 24.10.0
36+
hooks:
37+
- id: black
38+
stages: [pre-commit]
39+
40+
# Python: linting + import sorting
41+
- repo: https://github.com/astral-sh/ruff-pre-commit
42+
rev: v0.8.6
43+
hooks:
44+
- id: ruff
45+
args: [--fix]
46+
stages: [pre-commit]
47+
48+
# Shell: linting
49+
- repo: https://github.com/shellcheck-py/shellcheck-py
50+
rev: v0.10.0.1
51+
hooks:
52+
- id: shellcheck
53+
stages: [pre-commit]
54+
55+
# Shell: formatting
56+
- repo: https://github.com/scop/pre-commit-shfmt
57+
rev: v3.12.0-2
58+
hooks:
59+
- id: shfmt
60+
args: [-i, "2", -w]
61+
stages: [pre-commit]
62+
63+
- repo: https://github.com/commitizen-tools/commitizen
64+
rev: "v4.13.0"
65+
hooks:
66+
- id: commitizen
67+
stages: [commit-msg]
68+
69+
# TOML: formatting
70+
- repo: https://github.com/ComPWA/taplo-pre-commit
71+
rev: v0.9.3
72+
hooks:
73+
- id: taplo-format
74+
stages: [pre-commit]

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)