Skip to content

Commit

Permalink
moved hooks to tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
santacodes committed Jul 30, 2024
1 parent 52b07ca commit e558209
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 42 deletions.
28 changes: 9 additions & 19 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ project_slug:
type: str
help: Your Python package name (should be in `snake_case`)
default: "{{ project_name|lower|replace('-', '_')|replace(' ', '_') }}"
validator: |
{% if ('-' in project_slug or ' ' in project_slug) %}
Package name should not contain empty spaces or hyphens
{% endif %}
platform:
type: str
Expand Down Expand Up @@ -81,22 +85,8 @@ _jinja_extensions:
- jinja2_time.TimeExtension

_subdirectory: template
#_exclude:
#- .git
#- .github/
#- docs/
#- hooks/
#- src/
#- tests/
#- .gitginore
#- .pre-commit-config.yaml
#- .readthedocs.yml
#- CODE-OF-CONDUCT.md
#- CONTRIBUTING.md
#- cookiecutter.json
#- copier.yml
#- LICENSE
#- LICENSES-bundled.txt
#- noxfile.py
#- pyproject.toml
#- README.md

_tasks:
- git init -b {{branch}}
- git config user.name {{full_name}}
- git config user.email {{email}}
23 changes: 0 additions & 23 deletions hooks/post_gen_project.py

This file was deleted.

3 changes: 3 additions & 0 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ envs.default.dependencies = [
{%- if backend == "hatch" and vcs == false %}
[tool.hatch.version]
path = "src/{{ project_slug }}/__init__.py"

[tool.hatch.build.targets.wheel]
packages = ["src/{{ project_slug }}"]
{%- endif %}
{# keep this line here for newline #}
{%- if mypy %}
Expand Down

0 comments on commit e558209

Please sign in to comment.