From 42f5e84162c239d0a0bb031268e14f29f9ddf018 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Mon, 13 Mar 2023 10:35:18 -0400 Subject: [PATCH 1/3] Add a simple install option. --- copier.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/copier.yml b/copier.yml index 445f145c..e4121828 100644 --- a/copier.yml +++ b/copier.yml @@ -1,3 +1,11 @@ +custom_install: + help: Would you like to use simple (default tooling) or customized installation? + type: bool + default: customized + choices: + customized: true + simple: false + project_name: type: str help: What is the name of your project? @@ -43,6 +51,7 @@ preferred_linter: pylint: pylint black: black none: none + when: "{% if custom_install %}true{% endif %}" use_isort: help: Do you want to use a tool to maintain a specific ordering for module imports? @@ -51,6 +60,7 @@ use_isort: choices: yes: true no: false + when: "{{ custom_install }}" create_example_module: help: Do you want to create some example module code? @@ -59,6 +69,7 @@ create_example_module: choices: yes: true no: false + when: "{{ custom_install }}" ### # Below this line are Copier configuration options. From d811be5f06b46c715c5c7e6eba66cd808a536f78 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Mon, 13 Mar 2023 10:42:04 -0400 Subject: [PATCH 2/3] Update documentation for simple install --- docs/source/new_project.rst | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/docs/source/new_project.rst b/docs/source/new_project.rst index 3041138b..5bf2a530 100644 --- a/docs/source/new_project.rst +++ b/docs/source/new_project.rst @@ -17,34 +17,27 @@ Copier will ask you questions for how to set up the project. These questions wil :header-rows: 1 * - **Question** - - **Variable** - **Notes** + * - *Would you like to use simple (default tooling) or customized installation?* + - If a simple install is used, the template automatically selects the recommended tooling options (linter, isort, and create example module). * - *What is the name of your project?* - - ``project_name`` - The name of your project. * - *What is your python module name?* - - ``module_name`` - The name of your (first) module. This controls where your source code will live (``src/{{module_name}}``). * - *Your first and last name?* - - ``author_name`` - The name of code's author. This will be used in the project and documentation metadata. * - *Your preferred email address?* - - ``author_email`` - The contact email for the code's author. This will be used in the project and documentation metadata. * - *What license would you like to use?* - - ``project_license`` - - The license type you wwant to use for this project. Options are MIT and BSD. For more information on these options see `Github's license page `_. + - The license type you want to use for this project. Options are MIT and BSD. For more information on these options see `Github's license page `_. * - *What tooling would you like to use to enforce code style?* - - ``preferred_linter`` - - A linter is a tool to automatically format for consistency (see :doc:`Linting <../practices/linting>`). We provide options for `black `_, `pylint `_, or no linter. Choosing a linter will include it as a project dependency and include it in the :doc:`pre-commit <../practices/precommit>` hooks. + - A linter is a tool to automatically format for consistency (see :doc:`Linting <../practices/linting>`). We provide options for `black `_, `pylint `_, or no linter. Choosing a linter will include it as a project dependency and include it in the :doc:`pre-commit <../practices/precommit>` hooks. Defaults to ``pylint`` during simple installation. * - *Do you want to use a tool to maintain a specific ordering for module imports?* - - ``use_isort`` - - `isort `_ is a tool for ordering imports in a standard order. Enabling the option will include ``isort`` as part of github's :doc:`pre-commit <../practices/precommit>`. + - `isort `_ is a tool for ordering imports in a standard order. Enabling the option will include ``isort`` as part of github's :doc:`pre-commit <../practices/precommit>`. Defaults to ``True`` during simple installation. * - *Do you want to create some example module code?* - - ``create_example_module`` - - If this option is selected the template will create a model in ``src/{{module_name}}`` and create a corresponding example test file. + - If this option is selected the template will create a model in ``src/{{module_name}}`` and create a corresponding example test file. Defaults to ``True`` during simple installation. -While these choices will provide the initial structure for your project, most can be changed later. See Copier's `documentation for changing answers to the question `_ +While these choices will provide the initial structure for your project, most can be changed later. See Copier's `documentation for changing answers to the question `_ After providing answers to the prompts, Copier will hydrate a project template and save it in the specified location. Additionally Copier will run ``git init`` in the new project directory to initialize it as a local repository. From 793d6fc26bdd66fe7ad4d6e39055ad93d6375a6a Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Mon, 13 Mar 2023 10:43:14 -0400 Subject: [PATCH 3/3] Update copier.yml --- copier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier.yml b/copier.yml index e4121828..d77f7bfa 100644 --- a/copier.yml +++ b/copier.yml @@ -51,7 +51,7 @@ preferred_linter: pylint: pylint black: black none: none - when: "{% if custom_install %}true{% endif %}" + when: "{{ custom_install }}" use_isort: help: Do you want to use a tool to maintain a specific ordering for module imports?