From 90e2bd11d3bdfd7d40100c86e9a6861cb36a19c3 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:37:07 -0500 Subject: [PATCH 1/2] Add to the documentation --- docs/source/new_project.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/source/new_project.rst b/docs/source/new_project.rst index a92b90ca..7f886d10 100644 --- a/docs/source/new_project.rst +++ b/docs/source/new_project.rst @@ -11,12 +11,26 @@ Choose where you would like to create your new project, and call copier with the >> copier gh:lincc-frameworks/python-project-template +Copier will ask you questions for how to set up the project. These questions will be used to fill in aspects of the project's configuration, including both metadata and parameters. Below we provide some high-level overview of the questions: + + * *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. The main thing this controls is 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 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 pre commit hooks. + * *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 pre-commit. + * *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. + +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. Create a new environment and install your new package ------------------------------------------------------------------------------- -Create a new environment with your choice of environment tools (virtualenv, conda, etc.). Activate it, and change into the package directory. +If you are using `virtual environments `_ create a new environment with your choice of environment tools (virtualenv, conda, etc.) and activate it. This step is optional, but we recommend using virtual environments to better manage different project's dependencies. See Python's `description of virtual environments `_ for more details. + +Go to the new package's directory (e.g. ``cd {{project_name}}``) Install the newly created python package. Use ``pip`` to install both the standard set of dependencies as well as the ``[dev]`` dependencies. (Note: depending on your system, you may not need the single quotes about ``'.[dev]'``) From 57578b5bc07d7973b3cc64f6464bd09c79578a44 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:08:44 -0500 Subject: [PATCH 2/2] Add link to pre-commit page --- docs/source/new_project.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/new_project.rst b/docs/source/new_project.rst index 7f886d10..b3eccda1 100644 --- a/docs/source/new_project.rst +++ b/docs/source/new_project.rst @@ -17,8 +17,8 @@ Copier will ask you questions for how to set up the project. These questions wil * *What is your python module name?* (``module_name``): The name of your (first) module. The main thing this controls is 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 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 pre commit hooks. - * *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 pre-commit. + * *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. + * *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>`. * *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. 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 `_