|
1 | 1 | # cookiecutter-python |
2 | 2 |
|
3 | | -This is a [cookiecutter](https://github.com/audreyr/cookiecutter) template for creating Python packages that adhere to the [SDSS standard](./\{\{cookiecutter.repo_name\}\}/STYLE.rst). |
| 3 | +This is a [cookiecutter](https://github.com/audreyr/cookiecutter) template for creating Python packages that adhere to the [SDSS standards](./STYLE.rst). |
4 | 4 |
|
5 | 5 | The full documentation on how to use this template can be found [here](http://sdss-python-template.readthedocs.io/en/latest/). |
6 | 6 |
|
| 7 | +> **WARNING:** version 2 of the Python Template is significantly different from version 1, whose documentation can be found [here](http://sdss-python-template.readthedocs.io/en/latest/v1/v1.html). |
| 8 | +
|
7 | 9 | ## User Installation |
8 | 10 |
|
9 | 11 | To install and initialize this template: |
10 | 12 |
|
11 | | - pip install invoke |
12 | | - pip install bumpversion |
13 | | - pip install cookiecutter |
14 | | - cookiecutter https://github.com/sdss/python_template.git |
| 13 | +```console |
| 14 | +pip install invoke |
| 15 | +pip install cookiecutter |
| 16 | +cookiecutter https://github.com/sdss/python_template.git |
| 17 | +``` |
| 18 | + |
| 19 | +If you want to install [version 1](https://github.com/sdss/python_template/tree/python-template-v1) of the template, you can do: |
| 20 | + |
| 21 | +```console |
| 22 | +cookiecutter https://github.com/sdss/python_template.git --checkout python-template-v1 |
| 23 | +``` |
15 | 24 |
|
16 | | -or to optionally install a specific branch: |
| 25 | +During the installation, you will be asked a series of prompts to specify options and variable names, e.g. your name, the desired package name, etc. These definitions will be inserted into the package in designated places. The final prompts ask |
17 | 26 |
|
18 | | - cookiecutter https://github.com/sdss/python_template.git --checkout [branchname] |
| 27 | +* Do you want to use [setuptools](https://setuptools.readthedocs.io/en/latest/setuptools.html) or [poetry](https://python-poetry.org/) to manage your dependencies? |
| 28 | +* What Sphinx theme do you want to use? |
| 29 | +* Do you want to create a git repository out of your new package? |
| 30 | +* Do you want to connect your new git repo to an account on github? |
| 31 | + |
| 32 | +## What you get in this template |
19 | 33 |
|
20 | | -During the installation, you will be asked a series of prompts to specify options and variable names, e.g. your name, the desired package name, etc. These definitions will be inserted into the package in designated places. The final prompts ask |
| 34 | +* Python 3 compatibility (Python 2 has been dropped as of verson 2 of the template). |
| 35 | +* Pip-ready product. |
| 36 | +* Sphinx Documentation with Read The Docs integration. |
| 37 | +* Pytest testing framework. |
| 38 | +* Improved logging, versioning, and configuration tools using [sdsstools](https://github.com/sdss/sdsstools), as well as commonly used tasks for building the documentation and deploying to PyPI. |
| 39 | +* Continuous Integration with Travis. |
| 40 | +* Code coverage with [codecov](https://codecov.io). |
| 41 | +* Module file. |
21 | 42 |
|
22 | | -* do you want to install the new python package with python setup.py install? |
23 | | -* do you want to create a git repository out of your new package? |
24 | | -* do you want to connect your new git repo to an account on github? |
| 43 | +## Coding standards |
25 | 44 |
|
| 45 | +Before you start writing your code, make sure to read and understand the [SDSS coding standards](./\{\{cookiecutter.package_name\}\}/STYLE.rst). |
26 | 46 |
|
27 | 47 | ## Developers |
28 | 48 |
|
29 | 49 | If you are developing on this template, first clone the product: |
30 | 50 |
|
31 | | - git clone https://github.com/sdss/python_template.git |
| 51 | +```console |
| 52 | +git clone https://github.com/sdss/python_template.git |
| 53 | +``` |
32 | 54 |
|
33 | | -Now edit / add to the code as one normally does. This package contains a Jinja2 template structure, with variable substitution that occurs upon installation. Variables to be inserted into the template are defined in `cookiecutter.json`. To reference a variable inside the template structure use the Jinja2 double bracket nomenclature. |
| 55 | +Now edit / add to the code as one normally does. This package contains a Jinja2 template structure, with variable substitution that occurs upon installation. Variables to be inserted into the template are defined in `cookiecutter.json`. To reference a variable inside the template structure use the Jinja2 double bracket nomenclature. |
34 | 56 |
|
35 | | - {{cookiecutter.full_name}} |
| 57 | +```console |
| 58 | +{{cookiecutter.full_name}} |
| 59 | +``` |
36 | 60 |
|
37 | 61 | To test install the cookiecutter package locally, run: |
38 | 62 |
|
39 | | - cookiecutter [path_to_my_local_clone_directory] |
| 63 | +```console |
| 64 | +cookiecutter [path_to_my_local_clone_directory] |
| 65 | +``` |
40 | 66 |
|
41 | 67 | It is good practice to test install the package locally before you commit any changes to ensure the package can properly install without error. |
42 | 68 |
|
43 | | -## What you get in this template |
44 | | - |
45 | | -* Python 2/3 compatibility |
46 | | -* Pip-ready product |
47 | | -* Sphinx Documentation with Read The Docs integration |
48 | | -* Pytest Testing Framework |
49 | | -* Tox for Multiple Python Environment Testing (in a future versions) |
50 | | -* Improved Logging |
51 | | -* [Versioning with BumpVersion](https://github.com/peritus/bumpversion) |
52 | | -* Continuous Integration with Travis |
53 | | -* Code Coverage with Coveralls |
54 | | -* Module File |
55 | | -* Invoke for shell tasks |
56 | | - |
57 | | -## Coding standards |
| 69 | +You can also fork this template or create new branches with your specific preferences; then just install it by doing |
58 | 70 |
|
59 | | -Before you start writing your code, make sure to read and digest the [SDSS coding standards](./\{\{cookiecutter.repo_name\}\}/STYLE.rst). |
| 71 | +```console |
| 72 | +cookiecutter https://github.com/sdss/python_template.git --checkout <branch> |
| 73 | +``` |
0 commit comments