Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit a3053b2

Browse files
Updated README.md template content (#10)
2 parents 9a8506d + 76b8b6f commit a3053b2

File tree

4 files changed

+167
-4
lines changed

4 files changed

+167
-4
lines changed

src/PythonProjectBootstrapper/package/hooks/post_gen_project.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@
145145
3. Click "Update secret"
146146
""",
147147
),
148+
"Update README.md": textwrap.dedent(
149+
"""\
150+
In this step, we will update the README.md file with information about your project.
151+
152+
1. Edit README.md
153+
2. Replace the "TODO" comment in the "Overview" section.
154+
3. Replace the "TODO" comment in the "How to use {{ cookiecutter.github_project_name }}" section.
155+
""",
156+
),
148157
}
149158

150159

src/PythonProjectBootstrapper/package/hooks/pre_gen_project.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# ----------------------------------------------------------------------
77
errors: list[str] = []
88

9-
# BugBug: Ensure that the dir has a .git directory
10-
119
# fmt: off
1210
if "{{ cookiecutter.name }}".startswith("<") and "{{ cookiecutter.name }}".endswith(">"):
1311
errors.append('name ("{{ cookiecutter.name }}")')

src/PythonProjectBootstrapper/package/hooks/startup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def Execute(
5050
print(
5151
Panel(
5252
panel_content.rstrip(),
53-
border_style="red",
53+
border_style="green",
5454
padding=1,
5555
title="Python Package",
5656
),

src/PythonProjectBootstrapper/package/{{ cookiecutter.__empty_dir }}/README.md

Lines changed: 157 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,160 @@
88
[![PyPI - Version](https://img.shields.io/pypi/v/{{ cookiecutter.pypi_project_name }}?color=dark-green)](https://pypi.org/project/{{ cookiecutter.pypi_project_name | pypi_string }}/)
99
[![PyPI - Downloads](https://img.shields.io/pypi/dm/{{ cookiecutter.pypi_project_name }})](https://pypistats.org/packages/{{ cookiecutter.pypi_project_name | pypi_string }})
1010

11-
BugBug: Usage information here
11+
# {{ cookiecutter.github_project_name }}
12+
{{ cookiecutter.project_description }}
13+
14+
### Overview
15+
16+
TODO: Complete this section
17+
18+
### How to use {{ cookiecutter.github_project_name }}
19+
20+
TODO: Complete this section
21+
22+
## Installation via pip
23+
24+
`pip install {{ cookiecutter.pypi_project_name }}`
25+
26+
## Local Development
27+
28+
1) Clone this repository
29+
2) Bootstrap the local repository by running...
30+
<table>
31+
<tr>
32+
<th>Operating System</th>
33+
<th>Command</th>
34+
</tr>
35+
<tr>
36+
<td>Linux / MacOS</td>
37+
<td><code>Bootstrap.sh --package</code></td>
38+
</tr>
39+
<tr>
40+
<td>Windows</td>
41+
<td><code>Bootstrap.cmd --package</code></td>
42+
</tr>
43+
</table>
44+
3) Activate the development environment by running...
45+
<table>
46+
<tr>
47+
<th>Operating System</th>
48+
<th>Command</th>
49+
</tr>
50+
<tr>
51+
<td>Linux / MacOS</td>
52+
<td><code>. ./Activate.sh</code></td>
53+
</tr>
54+
<tr>
55+
<td>Windows</td>
56+
<td><code>Activate.cmd</code></td>
57+
</tr>
58+
</table>
59+
4) Invoke `Build.py`
60+
<table>
61+
<tr>
62+
<th>Command</th>
63+
<th>Description</th>
64+
<th>Example</th>
65+
</tr>
66+
<tr>
67+
<td><code>black</code></td>
68+
<td>Validates that the source code is formatted by <a href="https://github.com/psf/black" target="_blank">black</a>.</td>
69+
<td>
70+
<p>
71+
Validation:<br/>
72+
<code>python Build.py black</code>
73+
</p>
74+
<p>
75+
Perform formatting:<br/>
76+
<code>python Build.py black --format</code>
77+
</p>
78+
</td>
79+
</tr>
80+
<tr>
81+
<td><code>pylint</code></td>
82+
<td>Validates the source code using <a href="https://github.com/pylint-dev/pylint" target="_blank">pylint</a>.</td>
83+
<td><code>python Build.py pylint</code></td>
84+
</tr>
85+
<tr>
86+
<td><code>pytest</code></py>
87+
<td>Runs automated tests using <a href="https://docs.pytest.org/" target="_blank">pytest</a>.</td>
88+
<td>
89+
<p>
90+
Without Code Coverage:<br/>
91+
<code>python Build.py pytest</code>
92+
</p>
93+
<p>
94+
With Code Coverage:<br/>
95+
<code>python Build.py pytest --code-coverage</code>
96+
</p>
97+
</td>
98+
</tr>
99+
<tr>
100+
<td><code>update_version</code></td>
101+
<td>Updates the <a href="https://semver.org/" target="_blank">semantic version</a> of the package based on git commits using <a href="https://github.com/davidbrownell/AutoGitSemVer" target="_blank">AutoGitSemVer</a>.</td>
102+
<td><code>python Build.py update_version</code></td>
103+
</tr>
104+
<tr>
105+
<td><code>package</code></td>
106+
<td>Creates a Python wheel package for distribution; outputs to the <code>/dist</code> directory.</td>
107+
<td><code>python Build.py package</code></td>
108+
</tr>
109+
<tr>
110+
<td><code>publish</code></td>
111+
<td>Publishes a Python wheel package to <a href="https://pypi.org/" target="_blank">PyPi</a>.</td>
112+
<td>
113+
<p>
114+
<a href="https://test.pypi.org/" target="_blank">https://test.pypi.org</a>:<br/>
115+
<code>python Build.py publish &lt;your PyPi API token here&gt;</code>
116+
</p>
117+
<p>
118+
<a href="https://pypi.org/" target="_blank">https://pypi.org</a>:<br/>
119+
<code>python Build.py publish &lt;your PyPi API token here&gt; --production</code>
120+
</p>
121+
</td>
122+
</tr>
123+
<tr>
124+
<td><code>build_binary</code></td>
125+
<td>Builds an executable for your package that can be run on machines without a python installation; outputs to the <code>/build</code> directory.</td>
126+
<td><code>python Build.py build_binary</code></td>
127+
</tr>
128+
{%- if cookiecutter.create_docker_image -%}
129+
<tr>
130+
<td><code>create_docker_image</code></td>
131+
<td>Creates a <a href="https://www.docker.com/" target="_blank">Docker</a> image based on the current development environment. This supports the "Reusable" aspect of <a href="https://www.go-fair.org/fair-principles/" target="_blank">FAIR principles</a> by creating a snapshot of the repository and all of its dependencies as they exist in a single moment in time.</td>
132+
<td><code>python Build.py create_docker_image</code></td>
133+
</tr>
134+
{% endif %}
135+
</table>
136+
137+
5) [Optional] Deactivate the development environment by running:
138+
<table>
139+
<tr>
140+
<th>Operating System</th>
141+
<th>Command</th>
142+
</tr>
143+
<tr>
144+
<td>Linux / MacOS</td>
145+
<td><code>. ./Deactivate.sh</code></td>
146+
</tr>
147+
<tr>
148+
<td>Windows</td>
149+
<td><code>Deactivate.cmd</code></td>
150+
</tr>
151+
</table>
152+
153+
## License
154+
155+
{{ cookiecutter.github_project_name }} is licensed under the <a href="
156+
{%- if cookiecutter.license == "MIT" -%}
157+
https://choosealicense.com/licenses/mit/
158+
{%- elif cookiecutter.license == "Apache-2.0" -%}
159+
https://choosealicense.com/licenses/apache-2.0/
160+
{%- elif cookiecutter.license == "BSD-3-Clause-Clear" -%}
161+
https://choosealicense.com/licenses/bsd-3-clause-clear/
162+
{%- elif cookiecutter.license == "GPL-3.0-or-later" -%}
163+
https://choosealicense.com/licenses/gpl-3.0/
164+
{%- elif cookiecutter.license == "BSL-1.0" -%}
165+
https://choosealicense.com/licenses/bsl-1.0/
166+
{%- endif -%}
167+
" target="_blank">{{ cookiecutter.license }}</a> license.

0 commit comments

Comments
 (0)