Skip to content

Commit

Permalink
Add new JSON and YAML pattern files for fixture setups
Browse files Browse the repository at this point in the history
Introduce JSON and YAML files for 'mkdocs', 'python-boilerplate', and 'python-package' fixtures. These files define template locations, questions, and extra context to streamline repository setups.
  • Loading branch information
coordt committed Oct 19, 2024
1 parent 92cbb91 commit ca6df6d
Show file tree
Hide file tree
Showing 6 changed files with 289 additions and 0 deletions.
54 changes: 54 additions & 0 deletions tests/fixtures/mkdocs/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"template_location": "{{ repo_name }}",
"copy_only": [
"overrides/**/*",
"overrides/**/.*"
],
"questions": [
{
"name": "project_name",
"prompt": "What is the human-friendly name of the project?",
"type": "str",
"default": "My Project"
},
{
"name": "package_name",
"prompt": "What is the name of the Python package?",
"type": "str",
"default": "{{ project_name|lower|replace(' ', '_') }}"
},
{
"name": "repo_name",
"prompt": "What is the name of the project repository?",
"type": "str",
"default": "{{ package_name|replace('_', '-') }}"
},
{
"name": "project_description",
"help": "A sentence or two about what this project does.",
"type": "str",
"default": ""
}
],
"extra_context": {
"requirements": {
"docs": [
"black",
"markdown-customblocks",
"mdx-truly-sane-lists",
"mkdocs",
"mkdocs-click",
"mkdocs-gen-files",
"mkdocs-git-authors-plugin",
"mkdocs-git-committers-plugin",
"mkdocs-git-revision-date-localized-plugin",
"mkdocs-include-markdown-plugin",
"mkdocs-literate-nav",
"mkdocs-material",
"mkdocs-section-index",
"mkdocstrings[python]",
"python-frontmatter"
]
}
}
}
39 changes: 39 additions & 0 deletions tests/fixtures/mkdocs/pattern.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
copy_only:
- overrides/**/*
- overrides/**/.*
extra_context:
requirements:
docs:
- black
- markdown-customblocks
- mdx-truly-sane-lists
- mkdocs
- mkdocs-click
- mkdocs-gen-files
- mkdocs-git-authors-plugin
- mkdocs-git-committers-plugin
- mkdocs-git-revision-date-localized-plugin
- mkdocs-include-markdown-plugin
- mkdocs-literate-nav
- mkdocs-material
- mkdocs-section-index
- mkdocstrings[python]
- python-frontmatter
questions:
- default: My Project
name: project_name
prompt: What is the human-friendly name of the project?
type: str
- default: '{{ project_name|lower|replace('' '', ''_'') }}'
name: package_name
prompt: What is the name of the Python package?
type: str
- default: '{{ package_name|replace(''_'', ''-'') }}'
name: repo_name
prompt: What is the name of the project repository?
type: str
- default: ''
help: A sentence or two about what this project does.
name: project_description
type: str
template_location: '{{ repo_name }}'
78 changes: 78 additions & 0 deletions tests/fixtures/python-boilerplate/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"template_location": "{{ repo_name }}",
"copy_only": [
".github/**/*.jinja",
".github/workflows/*",
".github/actions/*"
],
"questions": [
{
"name": "project_name",
"prompt": "What is the human-friendly name of the project?",
"type": "str",
"default": "My Project"
},
{
"name": "package_name",
"promp": "What is the name of the Python package?",
"type": "str",
"default": "{{ project_name|lower|replace(' ', '_') }}"
},
{
"name": "repo_name",
"prompt": "What is the name of the project repository?",
"type": "str",
"default": "{{ package_name|replace('_', '-') }}"
},
{
"name": "project_description",
"help": "A sentence or two about what this project does.",
"type": "str",
"default": ""
},
{
"name": "initial_version",
"prompt": "What should the initial version be?",
"type": "str",
"default": "0.1.0"
},
{
"name": "author",
"prompt": "What is the author's name?",
"default": "Who am I?",
"type": "str"
},
{
"name": "email",
"prompt": "What is the author's email address?",
"default": "[email protected]",
"type": "str"
},
{
"name": "github_user",
"prompt": "What is the GitHub user name or organization?",
"default": "whoami",
"type": "str"
}
],
"extra_context": {
"requirements": [
{
"prod": [
"environs"
],
"test": [
"coverage",
"pre-commit",
"pytest-cov",
"pytest"
],
"dev": [
"bump-my-version",
"generate-changelog",
"uv"
]
}
]
}
}
51 changes: 51 additions & 0 deletions tests/fixtures/python-boilerplate/pattern.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
copy_only:
- .github/**/*.jinja
- .github/workflows/*
- .github/actions/*
extra_context:
requirements:
- dev:
- bump-my-version
- generate-changelog
- uv
prod:
- environs
test:
- coverage
- pre-commit
- pytest-cov
- pytest
questions:
- default: My Project
name: project_name
prompt: What is the human-friendly name of the project?
type: str
- default: '{{ project_name|lower|replace('' '', ''_'') }}'
name: package_name
promp: What is the name of the Python package?
type: str
- default: '{{ package_name|replace(''_'', ''-'') }}'
name: repo_name
prompt: What is the name of the project repository?
type: str
- default: ''
help: A sentence or two about what this project does.
name: project_description
type: str
- default: 0.1.0
name: initial_version
prompt: What should the initial version be?
type: str
- default: Who am I?
name: author
prompt: What is the author's name?
type: str
- default: [email protected]
name: email
prompt: What is the author's email address?
type: str
- default: whoami
name: github_user
prompt: What is the GitHub user name or organization?
type: str
template_location: '{{ repo_name }}'
41 changes: 41 additions & 0 deletions tests/fixtures/python-package/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"template_location": "{{ repo_name }}",
"questions": [
{
"name": "project_name",
"prompt": "What is the human-friendly name of the project?",
"type": "str",
"default": "My Project"
},
{
"name": "package_name",
"promp": "What is the name of the Python package?",
"type": "str",
"default": "{{ project_name|lower|replace(' ', '_') }}"
},
{
"name": "repo_name",
"prompt": "What is the name of the project repository?",
"type": "str",
"default": "{{ package_name|replace('_', '-') }}"
},
{
"name": "project_description",
"help": "A sentence or two about what this project does.",
"type": "str",
"default": ""
},
{
"name": "initial_version",
"prompt": "What should the initial version be?",
"type": "str",
"default": "0.1.0"
},
{
"name": "author",
"prompt": "What is the author's name?",
"default": "Who am I?",
"type": "str"
}
]
}
26 changes: 26 additions & 0 deletions tests/fixtures/python-package/pattern.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
questions:
- default: My Project
name: project_name
prompt: What is the human-friendly name of the project?
type: str
- default: '{{ project_name|lower|replace('' '', ''_'') }}'
name: package_name
promp: What is the name of the Python package?
type: str
- default: '{{ package_name|replace(''_'', ''-'') }}'
name: repo_name
prompt: What is the name of the project repository?
type: str
- default: ''
help: A sentence or two about what this project does.
name: project_description
type: str
- default: 0.1.0
name: initial_version
prompt: What should the initial version be?
type: str
- default: Who am I?
name: author
prompt: What is the author's name?
type: str
template_location: '{{ repo_name }}'

0 comments on commit ca6df6d

Please sign in to comment.