Skip to content

Commit

Permalink
Merge pull request #5 from egeakman/update
Browse files Browse the repository at this point in the history
Add new pre-commit checks, fix mypy and pre-commit complaints
  • Loading branch information
furkanonder authored Nov 11, 2023
2 parents 363b826 + 1a0087f commit 891658c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test

on: [push]
on: [push, pull_request, workflow_dispatch]

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.map
*.idea
media
.ruff_cache/

# Created by https://www.gitignore.io/api/python

Expand Down
34 changes: 24 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
rev: 23.10.1
hooks:
- id: black

- repo: https://github.com/hakancelikdev/unimport
rev: 1.0.0
hooks:
- id: unimport
args: [--remove, --include-star-import]
# unimport does not work with python 3.12 due to the removal of distutils
# Uncomment when unimport is updated to support python 3.12
# - repo: https://github.com/hakancelikdev/unimport
# rev: 1.0.0
# hooks:
# - id: unimport
# args: [--remove, --include-star-import]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.0
rev: v1.6.1
hooks:
- id: mypy
exclude: docs
Expand All @@ -22,7 +24,7 @@ repos:
--disallow-incomplete-defs,
--explicit-package-bases,
]
additional_dependencies: [types-toml==0.1.3]
additional_dependencies: [types-toml]

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
Expand All @@ -40,13 +42,25 @@ repos:
rev: v4.5.0
hooks:
- id: end-of-file-fixer
files: "\\.(py|.txt|.yaml|.json|.in|.md|.toml|.cfg|.html|.yml)$"
files: "\\.(py|.txt|.yaml|.json|.in|.md|.toml|.cfg|.html)$"
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
rev: v0.1.4
hooks:
- id: ruff

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.4.1
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
hooks:
- id: validate-pyproject
39 changes: 21 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
]

[project]
name = "akarsu"
version = "0.2.0"
description = "New Generation Profiler based on PEP 669"
readme = "README.md"
requires-python = ">=3.12"
keywords = [
"PEP669",
"profiler",
]
license = {file = "LICENSE.txt"}
keywords = ["profiler", "PEP669"]
authors = [
{ name = "Furkan Onder", email = "[email protected]" },
]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
Expand All @@ -24,31 +29,17 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]

[project.urls]
"Homepage" = "https://github.com/furkanonder/akarsu"
"Bug Reports" = "https://github.com/furkanonder/akarsu/issues"
"Homepage" = "https://github.com/furkanonder/akarsu"
"Source" = "https://github.com/furkanonder/akarsu"

[project.scripts]
akarsu = "akarsu.__main__:main"

[tool.black]
target-version = ["py312"]
preview = true

[tool.docformatter]
recursive = true
wrap-summaries = 79
wrap-descriptions = 79
blank = true

[tool.mypy]
warn_unused_configs = true
no_strict_optional = true
ignore_missing_imports = true
show_error_codes = true

[tool.ruff]
select = [
"E", # pycodestyle
Expand All @@ -61,3 +52,15 @@ target-version = "py312"

[tool.ruff.per-file-ignores]
'src/akarsu/akarsu.py' = ["E722"]

[tool.docformatter]
recursive = true
wrap-summaries = 79
wrap-descriptions = 79
blank = true

[tool.mypy]
warn_unused_configs = true
no_strict_optional = true
ignore_missing_imports = true
show_error_codes = true
4 changes: 2 additions & 2 deletions tests/test_akarsu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

# Set encoding to UTF-8 when testing on windows-latest
if sys.platform == "win32":
sys.stdin.reconfigure(encoding="utf-8")
sys.stdout.reconfigure(encoding="utf-8")
sys.stdin.reconfigure(encoding="utf-8") # type: ignore
sys.stdout.reconfigure(encoding="utf-8") # type: ignore


class TestNine(unittest.TestCase):
Expand Down

0 comments on commit 891658c

Please sign in to comment.