diff --git a/.copier-answers.yaml b/.copier-answers.yaml index 07f549f..c5f7bd1 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: ebb6e1c +_commit: '4372075' _src_path: https://github.com/python-project-templates/base.git add_docs: true add_extension: cpp diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 648483f..d0c6678 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: diff --git a/Makefile b/Makefile index 006a8c2..951bd06 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,8 @@ lint-cpp: ## run cpp linter clang-format --dry-run -Werror -i -style=file `find ./cpp -name "*.*pp"` lint-docs: ## lint docs with mdformat and codespell - python -m mdformat --check README.md docs/wiki/ - python -m codespell_lib README.md docs/wiki/ + python -m mdformat --check README.md $(wildcard docs/src) docs/wiki/ + python -m codespell_lib README.md $(wildcard docs/src) docs/wiki/ lint: lint-cpp lint-py ## run project linters @@ -47,8 +47,8 @@ fix-cpp: ## fix cpp formatting clang-format -i -style=file `find ./cpp -name "*.*pp"` fix-docs: ## autoformat docs with mdformat and codespell - python -m mdformat README.md docs/wiki/ - python -m codespell_lib --write README.md docs/wiki/ + python -m mdformat README.md $(wildcard docs/src) docs/wiki/ + python -m codespell_lib --write README.md $(wildcard docs/src) docs/wiki/ fix: fix-cpp fix-py fix-docs ## run project autoformatters @@ -66,7 +66,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # alias check: checks diff --git a/pyproject.toml b/pyproject.toml index 13225bf..273f923 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ develop = [ "hatch-cpp>=0.5.0", "hatchling", "mdformat", + "mdformat-frontmatter", "mdformat-tables>=1", "pybind11", "pytest", @@ -101,7 +102,7 @@ test-requires = ["pytest"] [tool.coverage.run] branch = true omit = [ - "python_template_cpp/tests/integration/", + "python_template_cpp/tests/integration/*", ] [tool.coverage.report] @@ -113,13 +114,6 @@ exclude_also = [ ignore_errors = true fail_under = 50 -[tool.hatch.build] -artifacts = [ - "python_template_cpp/*.dll", - "python_template_cpp/*.dylib", - "python_template_cpp/*.so", -] - [tool.hatch.build.sources] src = "/" @@ -130,6 +124,7 @@ libraries = [ ] [tool.hatch.build.targets.sdist] +exclude = ["*.dll", "*.dylib", "*.so", "*.pyd"] packages = [ "python_template_cpp", "cpp", @@ -141,6 +136,11 @@ packages = [ [tool.hatch.build.targets.wheel] +artifacts = [ + "python_template_cpp/*.dll", + "python_template_cpp/*.dylib", + "python_template_cpp/*.so", +] packages = [ "python_template_cpp", ] diff --git a/python_template_cpp/extension.pyi b/python_template_cpp/extension.pyi new file mode 100644 index 0000000..bfb558d --- /dev/null +++ b/python_template_cpp/extension.pyi @@ -0,0 +1 @@ +def add(i: int, j: int) -> int: ...