diff --git a/.github/workflows/test.yml b/.github/workflows/test.yaml similarity index 92% rename from .github/workflows/test.yml rename to .github/workflows/test.yaml index 6510e7a..7b077c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yaml @@ -1,6 +1,6 @@ name: Test -on: [push] +on: [push, pull_request, workflow_dispatch] jobs: test: diff --git a/.gitignore b/.gitignore index fbef448..7d11b61 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.map *.idea media +.ruff_cache/ # Created by https://www.gitignore.io/api/python diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b265fa..79b0fae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 886f2ad..da0a3dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "furkanonder@protonmail.com" }, ] +requires-python = ">=3.12" classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Console", @@ -24,12 +29,10 @@ 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" @@ -37,18 +40,6 @@ akarsu = "akarsu.__main__:main" 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 @@ -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 diff --git a/tests/test_akarsu.py b/tests/test_akarsu.py index e7d6957..9c40239 100644 --- a/tests/test_akarsu.py +++ b/tests/test_akarsu.py @@ -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):