-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
scaraplate-example-template
to docs
- Loading branch information
1 parent
c001ecb
commit 3dffe71
Showing
3 changed files
with
130 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Scaraplate template | ||
Scaraplate Template | ||
=================== | ||
|
||
Scaraplate uses cookiecutter under the hood, so the scaraplate template | ||
|
@@ -37,6 +37,124 @@ directories (i.e. the template git repo must be cloned manually, | |
scaraplate doesn't support retrieving templates from git remote directly). | ||
|
||
|
||
.. _scaraplate_example_template: | ||
|
||
Scaraplate Example Template | ||
--------------------------- | ||
|
||
We maintain an example template for a new Python project here: | ||
https://github.com/rambler-digital-solutions/scaraplate-example-template | ||
|
||
You may use it as a starting point for creating your own scaraplate template. | ||
Of course it doesn't have to be for a Python project: the cookiecutter | ||
template might be for anything. A Python project is just an example. | ||
|
||
Creating a new project from the template | ||
++++++++++++++++++++++++++++++++++++++++ | ||
|
||
:: | ||
|
||
$ git clone https://github.com/rambler-digital-solutions/scaraplate-example-template.git | ||
$ scaraplate rollup ./scaraplate-example-template ./myproject | ||
`myproject1/.scaraplate.conf` file doesn't exist, continuing with an empty context... | ||
`project_dest` must equal to "myproject" | ||
project_dest [myproject]: | ||
project_monorepo_name []: | ||
python_package [myproject]: | ||
metadata_name [myproject]: | ||
metadata_author: Kostya Esmukov | ||
metadata_author_email: [email protected] | ||
metadata_description: My example project | ||
metadata_long_description [file: README.md]: | ||
metadata_url [https://github.com/rambler-digital-solutions/myproject]: | ||
coverage_fail_under [100]: 90 | ||
mypy_enabled [1]: | ||
Done! | ||
$ tree -a myproject | ||
myproject | ||
├── .editorconfig | ||
├── .gitignore | ||
├── .scaraplate.conf | ||
├── MANIFEST.in | ||
├── Makefile | ||
├── README.md | ||
├── mypy.ini | ||
├── setup.cfg | ||
├── setup.py | ||
├── src | ||
│ └── myproject | ||
│ └── __init__.py | ||
└── tests | ||
├── __init__.py | ||
└── test_metadata.py | ||
|
||
3 directories, 12 files | ||
|
||
The example template also contains a ``project_monorepo_name`` variable | ||
which simplifies creating subprojects in monorepos (e.g. a single git | ||
repository for multiple projects). In this case scaraplate should be | ||
applied to the inner projects: | ||
|
||
:: | ||
|
||
$ scaraplate rollup ./scaraplate-example-template ./mymonorepo/innerproject | ||
`mymonorepo/innerproject/.scaraplate.conf` file doesn't exist, continuing with an empty context... | ||
`project_dest` must equal to "innerproject" | ||
project_dest [innerproject]: | ||
project_monorepo_name []: mymonorepo | ||
python_package [mymonorepo_innerproject]: | ||
metadata_name [mymonorepo-innerproject]: | ||
metadata_author: Kostya Esmukov | ||
metadata_author_email: [email protected] | ||
metadata_description: My example project in a monorepo | ||
metadata_long_description [file: README.md]: | ||
metadata_url [https://github.com/rambler-digital-solutions/mymonorepo]: | ||
coverage_fail_under [100]: 90 | ||
mypy_enabled [1]: | ||
Done! | ||
$ tree -a mymonorepo | ||
mymonorepo | ||
└── innerproject | ||
├── .editorconfig | ||
├── .gitignore | ||
├── .scaraplate.conf | ||
├── MANIFEST.in | ||
├── Makefile | ||
├── README.md | ||
├── mypy.ini | ||
├── setup.cfg | ||
├── setup.py | ||
├── src | ||
│ └── mymonorepo_innerproject | ||
│ └── __init__.py | ||
└── tests | ||
├── __init__.py | ||
└── test_metadata.py | ||
|
||
4 directories, 12 files | ||
|
||
Updating a project from the template | ||
++++++++++++++++++++++++++++++++++++ | ||
|
||
:: | ||
|
||
$ scaraplate rollup ./scaraplate-example-template ./myproject --no-input | ||
Continuing with the following context from the `myproject/.scaraplate.conf` file: | ||
{'_template': 'scaraplate-example-template', | ||
'coverage_fail_under': '90', | ||
'metadata_author': 'Kostya Esmukov', | ||
'metadata_author_email': '[email protected]', | ||
'metadata_description': 'My example project', | ||
'metadata_long_description': 'file: README.md', | ||
'metadata_name': 'myproject', | ||
'metadata_url': 'https://github.com/rambler-digital-solutions/myproject', | ||
'mypy_enabled': '1', | ||
'project_dest': 'myproject', | ||
'project_monorepo_name': '', | ||
'python_package': 'myproject'} | ||
Done! | ||
|
||
|
||
.. _cookiecutter_context_types: | ||
|
||
Cookiecutter context types | ||
|
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