Skip to content

Commit 1a5e87e

Browse files
authored
Address findings from team retro (#289)
1 parent eb0b90f commit 1a5e87e

File tree

9 files changed

+114
-123
lines changed

9 files changed

+114
-123
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
default_stages: [ commit ]
1+
default_stages: [ pre-commit, pre-push ]
22
repos:
33

44
- repo: local
55
hooks:
66
- id: code-format
77
name: code-format
88
types: [ python ]
9-
files: "pyproject.toml"
109
pass_filenames: false
1110
language: system
12-
entry: poetry run nox -s fix
11+
entry: poetry run nox -s project:fix
12+
stages: [ pre-commit ]
13+
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.4.0
16+
hooks:
17+
- id: check-yaml
18+
stages: [ pre-commit ]
19+
- id: end-of-file-fixer
20+
stages: [ pre-commit ]
21+
- id: trailing-whitespace
22+
stages: [ pre-commit ]
1323

1424
- repo: local
1525
hooks:
@@ -18,7 +28,8 @@ repos:
1828
types: [ python ]
1929
pass_filenames: false
2030
language: system
21-
entry: poetry run nox -s type-check
31+
entry: poetry run nox -s lint:typing
32+
stages: [ pre-push ]
2233

2334
- repo: local
2435
hooks:
@@ -27,11 +38,5 @@ repos:
2738
types: [ python ]
2839
pass_filenames: false
2940
language: system
30-
entry: poetry run nox -s lint
31-
32-
- repo: https://github.com/pre-commit/pre-commit-hooks
33-
rev: v4.4.0
34-
hooks:
35-
- id: check-yaml
36-
- id: end-of-file-fixer
37-
- id: trailing-whitespace
41+
entry: poetry run nox -s lint:code
42+
stages: [ pre-push ]

doc/_static/github-workflows.png

60.1 KB
Loading

doc/user_guide/getting_started.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ and adjust the following settings to your project needs:
142142
:language: toml
143143
:start-after: # Tooling
144144

145-
5. Make the toolbox task available
146-
++++++++++++++++++++++++++++++++++
145+
5. Make the toolbox tasks available
146+
+++++++++++++++++++++++++++++++++++
147147
In order to use the standard toolbox task via nox, just import them in your *noxfile.py*.
148148
If you only need the standard tasks provided by the toolbox your *noxfile.py* is straight
149149
forward and you just can use the example *noxfile.py* bellow.
@@ -161,10 +161,12 @@ forward and you just can use the example *noxfile.py* bellow.
161161

162162

163163

164-
6. Setup the pre-commit hooks
165-
+++++++++++++++++++++++++++++
164+
6. Setup the pre-commit hooks [optional]
165+
++++++++++++++++++++++++++++++++++++++++
166+
167+
#. Add a :code:`.pre-commit-config.yaml` file to your project root
166168

167-
#. Add the following .pre-commit-config.yaml to your project root
169+
If you want to reuse Nox tasks in the pre-commit hooks, feel free to get some inspiration from the Python toolbox itself:
168170

169171
.. literalinclude:: ../../.pre-commit-config.yaml
170172
:language: yaml
@@ -173,7 +175,7 @@ forward and you just can use the example *noxfile.py* bellow.
173175

174176
.. code-block:: shell
175177
176-
poetry run pre-commit install
178+
poetry run pre-commit install --hook-type pre-commit --hook-type pre-push
177179
178180
7. Go 🥜
179181
+++++++++++++

doc/user_guide/workflows.rst

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
Github Workflows
1+
GitHub Workflows
22
================
33

4-
The exasol-toolbox ships with various GitHub workflows. By default, we suggest installing all of them,
5-
while the core workflows are:
4+
.. figure:: ../_static/github-workflows.png
5+
:alt: GitHub Workflow Example
66

7-
**Workflows**:
7+
The exasol-toolbox ships with various GitHub workflow templates. To leverage the full feature set of the toolbox, you should use them.
88

9-
* CI
10-
Verifies PRs and regularly checks the project.
9+
.. attention::
1110

12-
* CD
13-
Publishes releases of the project.
11+
Generally, it is advised to install/use all workflows provided by the toolbox as a whole due to their interdependencies.
1412

15-
* PR-Merge
16-
Validates merges and updates the documentation.
13+
However, if you know what you are doing and are well-versed in GitHub workflows and actions, you can use just select individual ones or use them as inspiration. Still, an individual approach is likely to be more error-prone.
1714

15+
.. note::
1816

19-
The toolbox command itself, :code:`tbx`, provides various CLI functions to help you maintain those workflows.
20-
For further help, run the command :code:`tbx workflow --help`.
17+
The toolbox command itself, :code:`tbx`, provides various CLI functions to help you maintain those workflows.
18+
For further help, run the command :code:`tbx workflow --help`.
2119

22-
1. Configure your project
23-
+++++++++++++++++++++++++
20+
21+
1. Configure the GitHub project
22+
+++++++++++++++++++++++++++++++
2423

2524
* Make sure your GitHub project has access to a deployment token for PyPi with the following name: **PYPI_TOKEN**. It should be available to the repository either as an Organization-, Repository-, or Environment-secret.
2625

exasol/toolbox/nox/tasks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def check(session: Session) -> None:
3636
context = _context(session, coverage=True)
3737
py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)]
3838
_version(session, Mode.Check, PROJECT_CONFIG.version_file)
39-
_pyupgrade(session, py_files)
4039
_code_format(session, Mode.Check, py_files)
4140
_pylint(session, py_files)
4241
_type_check(session, py_files)

exasol/toolbox/templates/github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: exasol/python-toolbox/.github/actions/[email protected]
2323

2424
- name: Check Version(s)
25-
run: poetry run version-check `poetry run python -c "from noxconfig import PROJECT_CONFIG; print(PROJECT_CONFIG.version_file)"`
25+
run: |
2626
echo "Please enable the version check by replacing this output with shell command bellow:"
2727
echo ""
2828
echo "poetry run version-check <<VERSION_PY>>"

0 commit comments

Comments
 (0)