Skip to content

Commit

Permalink
chore: modernize pybind11
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Oct 6, 2024
1 parent 75eaeee commit f2e88bf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions {{cookiecutter.project_name}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ repos:
args: ["--fix", "--show-fixes"]
- id: ruff-format

{%- if cookiecutter.backend == "setuptools" or cookiecutter.backend == "pybind11" %}
{%- if cookiecutter.backend == "setuptools" %}

- repo: https://github.com/asottile/setup-cfg-fmt
rev: "v2.5.0"
Expand Down Expand Up @@ -95,7 +95,7 @@ repos:
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml

{%- if cookiecutter.backend in ["setuptools", "pybind11"] %}
{%- if cookiecutter.backend == "setuptools" %}

- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
Expand Down
12 changes: 6 additions & 6 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"
{%- elif cookiecutter.backend == "pybind11" %}
{%- if cookiecutter.vcs %}
requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4", "pybind11"]
requires = ["setuptools>=61", "setuptools_scm[toml]>=3.4", "pybind11"]
{%- else %}
requires = ["setuptools>=42", "pybind11"]
requires = ["setuptools>=61", "pybind11"]
{%- endif %}
build-backend = "setuptools.build_meta"
{%- elif cookiecutter.backend == "skbuild" %}
Expand All @@ -57,7 +57,7 @@ build-backend = "poetry.core.masonry.api"
{%- endif %}
{%- endif %}

{%- if cookiecutter.backend in ["setuptools", "pybind11"] %}
{%- if cookiecutter.backend in ["setuptools"] %}


[tool.check-manifest]
Expand Down Expand Up @@ -148,7 +148,7 @@ substitution.files = ["src/{{ cookiecutter.__project_slug }}/__init__.py"]

[project]
name = "{{ cookiecutter.project_name }}"
{%- if cookiecutter.backend in ['maturin', 'mesonpy'] or not cookiecutter.vcs and cookiecutter.backend in ['setuptools621', 'skbuild'] %}
{%- if cookiecutter.backend in ['maturin', 'mesonpy'] or not cookiecutter.vcs and cookiecutter.backend in ['setuptools621', 'pybind11', 'skbuild'] %}
version = "0.1.0"
{%- endif %}
authors = [
Expand Down Expand Up @@ -285,7 +285,7 @@ write_to = "src/{{ cookiecutter.__project_slug }}/_version.py"
{%- endif %}


{%- if cookiecutter.backend not in ["setuptools", "pybind11", "poetry"] %}
{%- if cookiecutter.backend not in ["setuptools", "poetry"] %}


[tool.uv]
Expand Down Expand Up @@ -343,7 +343,7 @@ disallow_incomplete_defs = true


[tool.ruff]
{%- if cookiecutter.backend in ["setuptools", "pybind11", "poetry"] %}
{%- if cookiecutter.backend in ["setuptools", "poetry"] %}
target-version = "py38"
{%- endif %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
graft src
graft tests

include LICENSE README.md pyproject.toml setup.py setup.cfg .git_archival.txt
include LICENSE README.md pyproject.toml setup.py .git_archival.txt
exclude .readthedocs.yaml
global-exclude __pycache__ *.py[cod] .venv

0 comments on commit f2e88bf

Please sign in to comment.