Skip to content

Commit d058993

Browse files
committed
Add CI test workflow for Python 3.9 onwards
1 parent d0d9d3f commit d058993

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- '**.md'
14+
15+
jobs:
16+
test:
17+
runs-on: ${{matrix.os}}
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
os: [ubuntu-latest]
22+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
23+
defaults:
24+
run:
25+
shell: bash
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install requirements
34+
run: |
35+
pip install --upgrade pip
36+
pip install pre-commit
37+
- name: Run tests
38+
run: ./test.sh

hook/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from hook.main import *
1+
from hook.main import *

hook/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def create_parser() -> ArgumentParser:
9191
dest="exclude_branches_regexes",
9292
# 'extend' option cannot be used here because the commit message file comes as the
9393
# final positional argument. A call '-x pattern msg_file' would treat msg_file as
94-
# an exclude pattern, which would result in an error since the mandatory
94+
# an exclude pattern, which would result in an error since the mandatory
9595
# commig_msg_file argument would be deemed to have been omitted.
9696
action="append",
9797
default=[],

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ requires = ["setuptools>=61.0"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.setuptools]
6-
packages = ["hook"] # Source directory
6+
packages = ["hook"] # Source directory
77

88
[tool.isort]
99
profile = "black"
1010

1111
[project]
12-
name = "github-pre-commit" # Name of the project in pip
12+
name = "github-pre-commit" # Name of the package in pip
1313
version = "1.0.0"
1414
authors = [{ name = "Mario Zaja", email = "mzaja0@gmail.com" }]
1515
description = "Pre-commit hook to check that branch names and commit messages satisfy GitHub's conventions."
@@ -24,7 +24,7 @@ classifiers = [
2424
keywords = ["pre-commit", "git hook", "commit message", "branch name", "github"]
2525

2626
[project.scripts]
27-
github-issue-number = "hook.main:main" # Entry point in .pre-commit-hooks.yaml
27+
github-issue-number = "hook.main:main" # Entry point in .pre-commit-hooks.yaml
2828

2929
[project.urls]
3030
"Homepage" = "https://github.com/mzaja/github-pre-commit"

0 commit comments

Comments
 (0)