Skip to content

Commit 9de3ec2

Browse files
authored
refactor: use filename instead of post-process hook (#172)
1 parent d4e63b2 commit 9de3ec2

14 files changed

Lines changed: 2 additions & 42 deletions

cookiecutter.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
"year": "{% now 'utc', '%Y' %}",
2323
"license": ["BSD", "Apache", "MIT"],
2424
"_extensions": ["jinja2_time.TimeExtension"],
25-
"__project_slug": "{{ cookiecutter.project_name | lower | replace('-', '_') | replace('.', '_') }}"
25+
"__project_slug": "{{ cookiecutter.project_name | lower | replace('-', '_') | replace('.', '_') }}",
26+
"__type": "{{ 'compiled' if cookiecutter.backend in ['pybind11', 'skbuild', 'mesonpy', 'maturin'] else 'pure' }}"
2627
}

hooks/post_gen_project.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

{{cookiecutter.project_name}}/src/main-pybind11,skbuild,mesonpy.cpp renamed to {{cookiecutter.project_name}}/src/{% if cookiecutter.backend in ['pybind11','skbuild','mesonpy'] %}main.cpp{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/src/lib-maturin.rs renamed to {{cookiecutter.project_name}}/src/{% if cookiecutter.backend=='maturin' %}lib.rs{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/_core-pybind11,skbuild,mesonpy,maturin.pyi renamed to {{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/{% if cookiecutter.__type=='compiled' %}_core.pyi{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/_version-setuptools,pybind11.pyi renamed to {{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/{% if cookiecutter.backend in ['setuptools', 'pybind11'] %}_version.pyi{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/tests/test_compiled-pybind11,skbuild,mesonpy,maturin.py renamed to {{cookiecutter.project_name}}/tests/{% if cookiecutter.__type=='compiled' %}test_compiled.py{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/MANIFEST-setuptools,pybind11.in renamed to {{cookiecutter.project_name}}/{% if cookiecutter.backend in ['setuptools','pybind11'] %}MANIFEST.in{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/setup-setuptools,pybind11.cfg renamed to {{cookiecutter.project_name}}/{% if cookiecutter.backend in ['setuptools','pybind11'] %}setup.cfg{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/Cargo-maturin.toml renamed to {{cookiecutter.project_name}}/{% if cookiecutter.backend=='maturin' %}Cargo.toml{% endif %}

File renamed without changes.

0 commit comments

Comments
 (0)