Skip to content

Commit

Permalink
check code format in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
YadominJinta committed Nov 23, 2024
1 parent 3738294 commit 7c5b4c6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install build flake8 black
- name: Check code format
run: |
black --check --diff --color pdf2zh/*.py
flake8
- name: Build package
run: python -m build
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
files: '^.*\.py$'
repos:
- repo: local
hooks:
- id: black
name: black
entry: black --check --diff --color
language: python
files: ".py"
- id: flake8
name: flake8
entry: flake8
language: python
files: ".py"
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Latex PDF Translator"
authors = [{ name = "Byaidu", email = "[email protected]" }]
license = "AGPL-3.0"
readme = "README.md"
requires-python = ">=3.8,<=3.12"
requires-python = ">=3.8,<3.13"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
Expand All @@ -28,6 +28,13 @@ dependencies = [
"torch",
]

[project.optional-dependencies]
dev = [
"black",
"flake8",
"pre-commit"
]

[project.urls]
Homepage = "https://github.com/Byaidu/PDFMathTranslate"

Expand Down

0 comments on commit 7c5b4c6

Please sign in to comment.