Skip to content

Commit 72cb474

Browse files
committed
added improvements to noxfile workflow
1 parent 7e94ea4 commit 72cb474

File tree

14 files changed

+66
-54
lines changed

14 files changed

+66
-54
lines changed

cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"full_name": "Eric Lopes",
33
"email": "[email protected]",
44
"github_username": "nullhack",
5-
"project_name": "My Python Project",
5+
"project_name": "Python Base Project",
66
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-') }}",
77
"package_name": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_').replace('project', 'package') }}",
88
"module_name": "{{ cookiecutter.package_name.lower().replace(' ', '_').replace('-', '_').replace('package', 'module') }}",

{{cookiecutter.project_slug}}/.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
ignore = E203, E266, E501, W503
2+
ignore = E203, E266, E501, W503, T499
33
max-line-length = 79
44
enable-extensions=G
55
#select = B,C,E,F,W,T4,T0,N8,DC,DAR,SCS

{{cookiecutter.project_slug}}/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ __pycache__/
66
*.py[cod]
77
*$py.class
88

9+
# Remove tests and coverage reports
10+
docs/cov-report
11+
docs/pytest_report.html
12+
913
# C extensions
1014
*.so
1115

{{cookiecutter.project_slug}}/.pre-commit-config.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ repos:
33
rev: v4.1.0
44
hooks:
55
- id: trailing-whitespace
6+
files: .*\.py
67
- id: check-yaml
78
- id: check-added-large-files
89
- id: check-ast
@@ -24,7 +25,7 @@ repos:
2425
hooks:
2526
- id: black-formatter
2627
name: black-formatter
27-
stages: [commit]
28+
stages: [commit, push]
2829
language: system
2930
entry: nox -s black
3031
types: [python]
@@ -33,33 +34,33 @@ repos:
3334
hooks:
3435
- id: flake8-lint
3536
name: flake8-lint
36-
stages: [commit]
37+
stages: [commit, push]
3738
language: system
3839
entry: nox -s lint
3940
types: [python]
4041
pass_filenames: false
4142
- repo: local
4243
hooks:
43-
- id: pytest-cov
44-
name: pytest-cov
44+
- id: pytest
45+
name: pytest
4546
stages: [commit]
4647
language: system
4748
entry: nox -s tests
4849
types: [python]
4950
pass_filenames: false
5051
- repo: local
5152
hooks:
52-
- id: test-docs
53-
name: test-docs
53+
- id: pytest-docs
54+
name: pytest-docs
5455
stages: [push]
5556
language: system
5657
entry: nox -s test-docs
5758
types: [python]
5859
pass_filenames: false
5960
- repo: local
6061
hooks:
61-
- id: documentation
62-
name: documentation
62+
- id: api-documentation
63+
name: api-documentation
6364
stages: [push]
6465
language: system
6566
entry: nox -s api-docs
@@ -69,7 +70,7 @@ repos:
6970
hooks:
7071
- id: uml-diagram
7172
name: uml-diagram
72-
stages: [commit]
73+
stages: [push]
7374
language: system
7475
entry: nox -s uml
7576
types: [python]

{{cookiecutter.project_slug}}/README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
<a href="https://htmlpreview.github.io/?https://raw.githubusercontent.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/main/docs/api/{{cookiecutter.project_slug}}/index.html"><strong>Explore the docs »</strong></a>
2929
<br />
3030
<br />
31-
<a href="https://htmlpreview.github.io/?https://raw.githubusercontent.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/main/docs/pytest_report.html">Tests</a>
32-
·
33-
<a href="https://htmlpreview.github.io/?https://raw.githubusercontent.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/main/docs/cov-report/index.html">Code Coverage</a>
34-
·
3531
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/issues">Report Bug</a>
3632
·
3733
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/issues">Request Feature</a>
@@ -80,15 +76,15 @@
8076
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/packages_{{cookiecutter.package_name}}.png">
8177
<img src="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/packages_{{cookiecutter.package_name}}.png" alt="uml-diagram-packages">
8278
</a>
83-
79+
8480
---
8581

8682
#### Classes
8783

8884
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/classes_{{cookiecutter.package_name}}.png">
8985
<img src="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/classes_{{cookiecutter.package_name}}.png" alt="uml-diagram-classes">
9086
</a>
91-
87+
9288
<p align="right">(<a href="#top">back to top</a>)</p>
9389

9490
<!-- GETTING STARTED -->
@@ -101,9 +97,9 @@ To get a local copy up and running follow these simple steps.
10197
This Project depends on the following projects.
10298
* poetry
10399
```sh
104-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
100+
pip install --user --upgrade poetry
105101
```
106-
102+
107103
* nox
108104
```sh
109105
pip install --user --upgrade nox
@@ -116,11 +112,15 @@ This Project depends on the following projects.
116112
git clone https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}
117113
cd {{cookiecutter.project_slug}}
118114
```
119-
2. Install Python packages
115+
2. Install nox
116+
```sh
117+
pip install --user --upgrade nox
118+
```
119+
3. Install pre-commit and poetry
120120
```sh
121-
poetry install
121+
nox -s install
122122
```
123-
3. Run tests
123+
4. Run tests
124124
```sh
125125
nox -s tests
126126
```
@@ -134,21 +134,26 @@ This Project depends on the following projects.
134134

135135
Some useful examples of how this project can be used:
136136

137+
* Install and run pre-commit checks
138+
```sh
139+
nox
140+
```
141+
137142
* Run tests
138143
```sh
139144
nox -s tests
140145
```
141-
146+
142147
* Run code lint
143148
```sh
144149
nox -s lint
145150
```
146-
151+
147152
* Generate API documentation
148153
```sh
149154
nox -s api-docs
150155
```
151-
156+
152157
* Run pre-commit checks
153158
```sh
154159
nox -s pre-commit

{{cookiecutter.project_slug}}/docs/api/{{cookiecutter.project_slug}}/index.html

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

{{cookiecutter.project_slug}}/docs/uml/artifacts/classes_{{cookiecutter.package_name}}.dot

Lines changed: 0 additions & 5 deletions
This file was deleted.

{{cookiecutter.project_slug}}/docs/uml/artifacts/packages_{{cookiecutter.package_name}}.dot

Lines changed: 0 additions & 6 deletions
This file was deleted.
1.29 KB
Loading

0 commit comments

Comments
 (0)