Skip to content

Commit d83f87f

Browse files
authored
Merge pull request #22 from sdss/python-template-v2
Python Template v2
2 parents be06573 + f951e22 commit d83f87f

62 files changed

Lines changed: 1686 additions & 1803 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,7 @@ ENV/
101101
# mypy
102102
.mypy_cache/
103103

104+
# Vim temporary files
105+
*~
106+
*.swp
107+
*.swo

CHANGELOG.rst

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,34 @@ Change Log
66

77
This document records the main changes to the python-template code.
88

9+
910
.. _python-template-master:
1011

1112
master
1213
------
1314

14-
`View commits since the last tag <https://github.com/sdss/python_template/compare/1.0.6...HEAD>`__.
15+
`View commits since the last tag <https://github.com/sdss/python_template/compare/2.0.0...HEAD>`__.
16+
17+
18+
.. _python-template-2.0.0:
19+
20+
2.0.0 (2020-04-13)
21+
------------------
22+
23+
Changed
24+
^^^^^^^
25+
* Dropped support for Python 2.
26+
* Move style guide to root level.
27+
* Use ``setup.cfg`` for packaging and configuration of ``pytest``, ``flake8``, ``isort``, and ``coverage``.
28+
* Move ``tests`` outside of the package to simplify packaging.
29+
* Replace ``utils`` with `sdsstools <https://github.com/sdss/sdsstools>`__.
30+
* Remove use of ``bumpversion``. Instead, get the package version using ``sdsstools.get_package_version``.
31+
* Updated the template Sphinx docs.
32+
* Updated style guide and documentation.
33+
* Allow to choose between setuptools and poetry.
34+
* Allow to choose between ``sphinx-bootstrap-theme`` and ``alabaster``.
35+
36+
`View commits <https://github.com/sdss/python_template/compare/1.0.6...2.0.0>`__.
1537

1638

1739
.. _python-template-1.0.6:

README.md

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,73 @@
11
# cookiecutter-python
22

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).
44

55
The full documentation on how to use this template can be found [here](http://sdss-python-template.readthedocs.io/en/latest/).
66

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+
79
## User Installation
810

911
To install and initialize this template:
1012

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+
```
1524

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
1726

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
1933

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.
2142

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
2544

45+
Before you start writing your code, make sure to read and understand the [SDSS coding standards](./\{\{cookiecutter.package_name\}\}/STYLE.rst).
2646

2747
## Developers
2848

2949
If you are developing on this template, first clone the product:
3050

31-
git clone https://github.com/sdss/python_template.git
51+
```console
52+
git clone https://github.com/sdss/python_template.git
53+
```
3254

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.
3456

35-
{{cookiecutter.full_name}}
57+
```console
58+
{{cookiecutter.full_name}}
59+
```
3660

3761
To test install the cookiecutter package locally, run:
3862

39-
cookiecutter [path_to_my_local_clone_directory]
63+
```console
64+
cookiecutter [path_to_my_local_clone_directory]
65+
```
4066

4167
It is good practice to test install the package locally before you commit any changes to ensure the package can properly install without error.
4268

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
5870

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

Comments
 (0)