Skip to content

Commit

Permalink
updates template copier-poetry-meta
Browse files Browse the repository at this point in the history
  • Loading branch information
worldworm committed Mar 25, 2023
1 parent f3984cb commit 775251e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .project/.copier-answers.poetry-meta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changes here will be overwritten by Copier
_commit: da3c5f4
_commit: '7849030'
_src_path: https://github.com/worldworm/copier-poetry-meta.git
template_suffix: null
5 changes: 5 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ _subdirectory: template
_templates_suffix: .jinja
_answers_file: .copier-answers.poetry.yml

_tasks:
- "[ -f README.md ] || touch README.md"
- "poetry install"
- "[ -d .git ] && poetry run pre-commit install --install-hooks || true"

project_name:
type: str
help: Project name
Expand Down
27 changes: 27 additions & 0 deletions template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- repo: local
hooks:
- id: check-poetry
name: Poetry check
description: Validates the structure of the pyproject.toml file
entry: poetry check
language: system
pass_filenames: false
files: pyproject.toml
- repo: local
hooks:
- id: forbidden-files
name: forbidden files
entry: found Copier update rejection files; review them and remove them
language: fail
files: "\\.rej$"
2 changes: 1 addition & 1 deletion template/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"recommendations": [
"ms-python.python"
]
}
}
2 changes: 1 addition & 1 deletion template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"python.formatting.autopep8Args": [
"--max-line-length=150"
]
}
}
2 changes: 1 addition & 1 deletion template/Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ RUN poetry install --only main --no-dev --no-root --no-interaction --no-ansi

COPY . /app/

CMD ["poetry", "run", "python", "-m", "{{package_import_name}}"]
CMD ["poetry", "run", "python", "-m", "{{package_import_name}}"]
2 changes: 2 additions & 0 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ packages = [{include = "{{ package_import_name }}"}]
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
[tool.poetry.group.dev.dependencies]
pre-commit = "^3.2.1"
[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 775251e

Please sign in to comment.