generated from seapagan/poetry-dev-setup
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from seapagan/custom-files
Implement custom template additions
- Loading branch information
Showing
29 changed files
with
917 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--8<-- "TODO.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# The Internal Template | ||
|
||
By default, the generated application will have a basic template that you can | ||
use to get started, this template is stored inside the package itself. It will | ||
contain all you need to get started, including a basic `README.md` file. | ||
|
||
The dependency management is handled by | ||
[Poetry](<https://python-poetry.org/>){:target="_blank"}, and we include a | ||
`pyproject.toml` file with several useful dependencies: | ||
|
||
- [PyTest](https://docs.pytest.org/en/stable/contents.html){:target="_blank"} | ||
for testing, along with several useful plugins. | ||
- The [Black](https://black.readthedocs.io/en/stable/){:target="_blank"} | ||
code formatter. | ||
- The [Flake8](https://flake8.pycqa.org/en/latest/){:target="_blank"} linter, | ||
along with a good selection of plugins. It is also set up to use the | ||
`pyproject.toml` for it's configuration, and to work nicely with Black. | ||
- [Pylint](<https://www.pylint.org/>){:target="_blank"} and | ||
[Pydocstyle](https://www.pydocstyle.org/en/stable/){:target="_blank"} | ||
linters. | ||
- [MyPy](https://mypy.readthedocs.io/en/stable/){:target="_blank"} for static | ||
type checking. | ||
- [Isort](https://pycqa.github.io/isort/){:target="_blank"} for sorting | ||
imports. | ||
- [pre-commit](https://pre-commit.com/){:target="_blank"} for running checks | ||
before committing code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Adding or Modifying files in the template | ||
|
||
If you wish to add or change specific files in the template, you can do so by | ||
adding them to the `~/.pymaker/template` folder. The files (and folders) in this | ||
folder will be copied to the root of the project when the template is generated. | ||
|
||
Files in this global template folder will override any files in the default | ||
template, so you can for example change the `README.md` file, add to the | ||
`.gitignore` or even add a complete extra folder structure. | ||
|
||
If you want to do a major change to the template, you can actually dump the | ||
default template to this folder and modify or delete files as you see fit. See | ||
the next section for more information on how to do this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Replacing the Default Template | ||
|
||
## Dump the Default Template | ||
|
||
Should you wish to heavily modify the default template, or even replace it | ||
completely, you can do so by dumping the default template to the | ||
`~/.pymaker/template` folder. This will copy all files from the default template | ||
to the global template folder, where you can modify or delete them as you see | ||
fit. | ||
|
||
To do this, run the following command: | ||
|
||
```console | ||
$ pymaker template dump | ||
``` | ||
|
||
This will copy the default template to the global template folder | ||
(`~/.pymaker/template`). You can then modify or delete files as you see fit. | ||
|
||
Running this command will ask you if you wish to set this exported template as | ||
the default template. It will then ask you if you want to disable the internal | ||
template. If you answer yes, then the internal template will be | ||
disabled, and ONLY the exported template will be used instead. Otherwise, both | ||
will still be used with the exported template taking precedence. | ||
|
||
## Change the location of the Template folder | ||
|
||
If you wish to change the location of the template folder, you can do so in 2 | ||
ways: | ||
|
||
1. By adding the `--local` flag to the above command (e.g. `pymaker template | ||
dump --local`). This will dump the default template to the current folder, | ||
giving you the option to disable the default template if needed. Note that | ||
any files in the folder will be overwritten. | ||
2. By changing to the folder containing your template and running `pymaker | ||
template set`. This will set the current folder as the template folder and | ||
give you the same option to disable the default template. | ||
|
||
You can reset the template location back to the default `~/.pymaker/template` | ||
folder by running the following command: | ||
|
||
```console | ||
$ pymaker template reset | ||
``` | ||
|
||
## Choose to use the Default Template or not | ||
|
||
Running the `dump` command will give you the option to disable the default | ||
template completely and ONLY use the exported template. You can also do this (or | ||
revert back to the default template) by running the following command: | ||
|
||
```console | ||
$ pymaker template default <enable|disable> | ||
``` | ||
|
||
`enable` will enable the default template, and `disable` will disable it. Please | ||
note that any custom templates you have created will still be used, and will | ||
overwrite the default template if they have the same file name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.