Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use subdirectory for template. #97

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,14 @@ jobs:
run: python -m pip install --user copier
- name: Generate the project with the default value
run: |
rm -rf src/serious_scaffold
rm -rf .github
rm -rf .gitlab-ci.yml
copier copy -x '!src/serious_scaffold' -d repo_host_type=gitlab.com -r HEAD -f . .
find . -maxdepth 1 | grep -vE "(\.|template|includes|\.git|copier\.yaml)$" | xargs -I {} rm -r {}
copier copy -d repo_host_type=gitlab.com -r HEAD -f . .
rm .copier-answers.yml
copier copy -r HEAD -f . .
rm .copier-answers.yml
- run: git diff
- run: git status --porcelain
- run: |
if [[ -n `git status --porcelain` ]]; then
exit 1
fi
- run: test -z "$(git status --porcelain)"
strategy:
matrix:
python-version:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"vscode-yaml-sort.customSortKeywords_2": [
"_envops",
"_exclude",
"_subdirectory",
"project_name",
"project_description",
"author_name",
Expand Down
12 changes: 1 addition & 11 deletions copier.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
_envops:
block_end_string: '%]'
block_start_string: '[%'
_exclude:
- '*.py[co]'
- .DS_Store
- .git
- .svn
- __pycache__
- copier.yaml
- copier.yml
- includes
- src/serious_scaffold
- ~*
_subdirectory: template
project_name:
default: Serious Scaffold Python
help: 'Enter the name of the project in CamelCase format:'
Expand Down
File renamed without changes.
74 changes: 74 additions & 0 deletions template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
repos:
- hooks:
- id: check-added-large-files
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
- stages:
- push
id: no-commit-to-branch
- args:
- '--autofix'
id: pretty-format-json
- args:
- constraints/default.txt
- requirements.txt
- requirements/docs.txt
- requirements/lint.txt
- requirements/package.txt
- requirements/test.txt
id: requirements-txt-fixer
- files: .pre-commit-config.yaml
id: sort-simple-yaml
- id: trailing-whitespace
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
- hooks:
- entry: pipenv run python -m black
id: black
language: system
name: black
types:
- python
- entry: pipenv run python -m isort
id: isort
language: system
name: isort
require_serial: true
types_or:
- cython
- pyi
- python
- entry: make mypy
id: mypy
language: system
name: mypy
pass_filenames: false
require_serial: true
types:
- python
- entry: pipenv run python -m ruff
id: ruff
language: system
name: ruff
types:
- python
- entry: pipenv run toml-sort
id: toml-sort
language: system
name: toml-sort
types:
- toml
- entry: found Copier update rejection files; review them and remove them
files: \.rej$
id: forbidden-files
language: fail
name: forbidden files
repo: local
File renamed without changes.
14 changes: 14 additions & 0 deletions template/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"recommendations": [
"DavidAnson.vscode-markdownlint",
"PascalReitermann93.vscode-yaml-sort",
"charliermarsh.ruff",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"ms-python.python",
"richie5um2.vscode-sort-json",
"shd101wyy.markdown-preview-enhanced",
"streetsidesoftware.code-spell-checker",
"trond-snekvik.simple-rst"
]
}
115 changes: 115 additions & 0 deletions template/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.defaultFormatter": "ms-python.black-formatter"
},
"[yaml]": {
"editor.defaultFormatter": "PascalReitermann93.vscode-yaml-sort"
},
"cSpell.words": [
"autofix",
"automodule",
"cobertura",
"codecov",
"elif",
"endmacro",
"epub",
"furo",
"huxuan",
"interruptible",
"isort",
"JPKXI",
"mypy",
"pathjoin",
"pipenv",
"pipx",
"pycache",
"pydantic",
"pytest",
"Quickstart",
"setuptools",
"typer"
],
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.formatOnSave": true,
"editor.rulers": [
88
],
"files.exclude": {
"**/*.egg-info": true,
"**/.coverage": true,
"**/.mypy_cache": true,
"**/.pytest_cache": true,
"**/.ruff_cache": true,
"**/.venv": true,
"**/Pipfile*": true,
"**/__pycache__": true,
"**/_build": true,
"**/coverage.xml": true,
"**/htmlcov": true
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"markdown-preview-enhanced.breakOnSingleNewLine": false,
"sortJSON.contextMenu": {
"sortJSONAlphaNum": false,
"sortJSONAlphaNumReverse": false,
"sortJSONKeyLength": false,
"sortJSONKeyLengthReverse": false,
"sortJSONReverse": false,
"sortJSONType": false,
"sortJSONTypeReverse": false,
"sortJSONValues": false,
"sortJSONValuesReverse": false
},
"vscode-yaml-sort.customSortKeywords_2": [
"_envops",
"_subdirectory",
"project_name",
"project_description",
"author_name",
"organization_name",
"author_email",
"repo_host_type",
"repo_host",
"ci",
"repo_namespace",
"repo_name",
"package_name",
"module_name",
"coverage_threshold",
"min_py",
"max_py",
"default_py",
"choices",
"stages",
"default",
"lint",
"test",
"package",
"pages",
"release",
"3.8",
"3.9",
"3.10",
"3.11"
],
"vscode-yaml-sort.noCompatMode": true,
"vscode-yaml-sort.sortOnSave": 2,
"vscode-yaml-sort.useArrayProcessor": false,
"vscode-yaml-sort.useBlockProcessor": false,
"vscode-yaml-sort.useCustomSortRecursively": true,
"vscode-yaml-sort.useHelmProcessor": false,
"vscode-yaml-sort.useLeadingDashes": false
}
21 changes: 21 additions & 0 deletions template/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Xuan (Sean) Hu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,14 @@ jobs:
run: python -m pip install --user copier
- name: Generate the project with the default value
run: |
rm -rf src/serious_scaffold
rm -rf .github
rm -rf .gitlab-ci.yml
copier copy -x '!src/serious_scaffold' -d repo_host_type=gitlab.com -r HEAD -f . .
find . -maxdepth 1 | grep -vE "(\.|template|includes|\.git|copier\.yaml)$" | xargs -I {} rm -r {}
copier copy -d repo_host_type=gitlab.com -r HEAD -f . .
rm .copier-answers.yml
copier copy -r HEAD -f . .
rm .copier-answers.yml
- run: git diff
- run: git status --porcelain
- run: |
if [[ -n `git status --porcelain` ]]; then
exit 1
fi
- run: test -z "$(git status --porcelain)"
strategy:
matrix:
python-version:
Expand Down
75 changes: 75 additions & 0 deletions template/constraints/default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
alabaster==0.7.13
annotated-types==0.5.0
autodoc-pydantic==2.0.1
Babel==2.12.1
beautifulsoup4==4.12.2
black==23.7.0
bleach==6.0.0
build==0.10.0
certifi==2023.7.22
charset-normalizer==3.2.0
click==8.1.6
colorama==0.4.6
coverage==7.2.7
docutils==0.20.1
exceptiongroup==1.1.2
furo==2023.7.26
idna==3.4
imagesize==1.4.1
importlib-metadata==6.8.0
iniconfig==2.0.0
isort==5.12.0
jaraco.classes==3.3.0
Jinja2==3.1.2
keyring==24.2.0
livereload==2.6.3
lxml==4.9.3
markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdurl==0.1.2
more-itertools==10.0.0
mypy==1.4.1
mypy-extensions==1.0.0
packaging==23.1
pathspec==0.11.2
pkginfo==1.9.6
platformdirs==3.10.0
pluggy==1.2.0
pydantic==2.1.1
pydantic-settings==2.0.2
pydantic_core==2.4.0
Pygments==2.15.1
pyproject_hooks==1.0.0
pytest==7.4.0
python-dotenv==1.0.0
readme-renderer==40.0
requests==2.31.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.5.2
ruff==0.0.282
setuptools-scm==7.1.0
shellingham==1.5.0.post1
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.4.1
Sphinx==7.1.2
sphinx-autobuild==2021.3.14
sphinx-basic-ng==1.0.0b2
sphinx-click==4.4.0
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
toml-sort==0.23.1
tomli==2.0.1
tomlkit==0.12.1
tornado==6.3.2
twine==4.0.2
typer==0.9.0
typing_extensions==4.7.1
urllib3==2.0.4
webencodings==0.5.1
zipp==3.16.2
Loading