Skip to content

Commit 12fce12

Browse files
committed
Switch references in getting_started to cookiecutter-template
1 parent 93c0f4f commit 12fce12

File tree

5 files changed

+46
-59
lines changed

5 files changed

+46
-59
lines changed

doc/user_guide/features/formatting_code/index.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,29 @@ deterministic manner.
3838
`pre-commit`
3939
++++++++++++
4040

41+
.. _formatting_configuration:
4142

4243
Configuration
4344
+++++++++++++
45+
black
46+
^^^^^
4447

48+
Your ``black`` configuration should look similar to this:
4549

46-
Ensure ``isort`` is configured with compatibility for ``black``:
47-
48-
.. code-block:: toml
50+
.. literalinclude:: ../../../../project-template/{{cookiecutter.repo_name}}/pyproject.toml
51+
:language: toml
52+
:start-at: [tool.black]
53+
:end-before: [tool.isort]
4954

50-
[tool.isort]
51-
profile = "black"
52-
force_grid_wrap = 2
53-
54-
Additionally, your black configuration should look similar to this:
55+
isort
56+
^^^^^
57+
Ensure ``isort`` is configured with compatibility for ``black``:
5558

56-
.. code-block:: toml
59+
.. literalinclude:: ../../../../project-template/{{cookiecutter.repo_name}}/pyproject.toml
60+
:language: toml
61+
:start-at: [tool.isort]
62+
:end-before: [tool.pylint.master]
5763

58-
[tool.black]
59-
line-length = 88
60-
verbose = false
61-
include = "\\.pyi?$"
64+
pyupgrade
65+
^^^^^^^^^
66+
No initial configuration of ``pyupgrade`` is required.

doc/user_guide/features/formatting_code/troubleshooting.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ If when you execute:
1111
#. Run ``project:format``
1212

1313
you receive an error from ``project:format`` (i.e. ``isort`` or ``black``), it it
14-
likely that you need to update your configuration to align with :ref:formatting_code.
15-
# TODO REFERENCE
14+
likely that you need to update your configuration to align with
15+
:ref:`formatting_configuration`.
1616

1717
The automatic formatting is doing x, but we shouldn't do that because of y
1818
---------------------------------------------------------------------------
@@ -42,20 +42,20 @@ might want to ignore automatically applied formatting.
4242
In the ``checks.yml``, ``project:format`` wants me to reformat code I did not modify
4343
------------------------------------------------------------------------------------
4444

45-
This is likely due to one of our tools (i.e. `black`) being upgraded. Within the
46-
`pyproject.toml` of the PTB, dependencies are specified to allow
47-
compatible versions or a restricted version range (i.e., `^6.0.1`, `>=24.1.0,<26.0.0`).
45+
This is likely due to one of our tools (i.e. ``black``) being upgraded. Within the
46+
``pyproject.toml`` of the PTB, dependencies are specified to allow
47+
compatible versions or a restricted version range (i.e., ``^6.0.1``, ``>=24.1.0,<26.0.0``).
4848
Such specifications should restrict major reformatting changes to coincide only with a
4949
new major version of the PTB. However, sometimes a tool's versioning may not properly
5050
adhere to semantic versioning.
5151

5252
If you encounter this scenario, please:
5353

54-
#. Ensure that your `pyproject.toml` has the PTB restricted to compatible versions
55-
(i.e., `^1.7.0`).
54+
#. Ensure that your ``pyproject.toml`` has the PTB restricted to compatible versions
55+
(i.e., ``^1.7.0``).
5656
#. Identify which tool is trying to reformat files that you did not modify.
57-
#. Reset your `poetry.lock` to align with what's in the project's **default branch**.
58-
#. More selectively update your `poetry.lock` with `poetry update <package-name>`.
57+
#. Reset your ``poetry.lock`` to align with what's in the project's **default branch**.
58+
#. More selectively update your ``poetry.lock`` with `poetry update <package-name>`.
5959
#. Share with your team which tool & version led to the unexpected changes. So that
6060
other PTB users do not experience the same difficulties, we will update the PTB with
6161
a patch version to avoid this tool's version and later do a major release to better

doc/user_guide/getting_started.rst

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -91,54 +91,38 @@ Integrating Exasol-Toolbox into your Project
9191
2. Provide a project configuration
9292
++++++++++++++++++++++++++++++++++
9393
Make sure you provide the required configuration. Configuration for the exasol-toolbox gets provided by creating
94-
a ``noxconfig.py`` file in the workspace root. This file should contain at least
95-
a single module constant with the name **PROJECT_CONFIG** pointing to an object,
96-
which is required to to provide the following attributes:
97-
98-
* .. py:attribute:: root
99-
:type: Path
100-
101-
* .. py:attribute:: doc
102-
:type: Path
103-
104-
* .. py:attribute:: version_file
105-
:type: Path
106-
107-
Alternatively you can use the *noxconfig.py* file bellow and adjust the value of the attributes if needed:
94+
a ``noxconfig.py`` file in the workspace root. This file should be similar to the
95+
example shown below.
10896

10997
.. note::
11098

111-
Be aware that the plugin definitions are completely optional. For further details on plugins, see the customization section.
99+
For further details on plugins, see the customization section.
112100

113-
.. literalinclude:: ../../noxconfig.py
101+
.. literalinclude:: ../../project-template/{{cookiecutter.repo_name}}/noxconfig.py
114102
:language: python3
115103

116104
3. Configure the tooling
117105
++++++++++++++++++++++++
118-
In order to make all standard task work properly, you need add the configuration settings below to your ``pyproject.toml``,
119-
and adjust the following settings to your project needs:
106+
Configuration values for the tooling should be defined in the ``pyproject.toml``.
107+
Copy the example below & adapt it for your project's specific needs.
120108

121-
* coverage
122-
- source
123-
- fail_under
124-
* pylint
125-
- fail-under
126-
* mypy (overrides)
127-
- module
109+
.. literalinclude:: ../../project-template/{{cookiecutter.repo_name}}/pyproject.toml
110+
:language: toml
111+
:start-after: # Tooling
112+
113+
For further reference, see the specific configurations for:
114+
115+
* :ref:`formatting code <formatting_configuration>`
128116

129-
.. literalinclude:: ../../pyproject.toml
130-
:language: toml
131-
:start-after: # Tooling
132117

133118
4. Make the toolbox tasks available
134119
+++++++++++++++++++++++++++++++++++
135-
In order to use the standard toolbox task via nox, just import them in your ``noxfile.py``.
136-
If you only need the standard tasks provided by the toolbox, your ``noxfile.py`` is straight
137-
forward, and you just can use the example ``noxfile.py`` below.
120+
To use the standard toolbox task via nox, just import them in your ``noxfile.py``.
121+
If you only need the standard tasks provided by the toolbox, your ``noxfile.py`` is
122+
straightforward, and you just can use the example ``noxfile.py`` below.
138123

139-
.. literalinclude:: ../../noxfile.py
124+
.. literalinclude:: ../../project-template/{{cookiecutter.repo_name}}/noxfile.py
140125
:language: python3
141-
:end-before: # entry point for debugging
142126

143127

144128
.. attention::
@@ -147,16 +131,14 @@ forward, and you just can use the example ``noxfile.py`` below.
147131

148132
For additional information on resolving this issue, please :ref:`refer to <faq_no_module_noxconfig>`.
149133

150-
151-
152134
5. Set up the pre-commit hooks [optional]
153135
+++++++++++++++++++++++++++++++++++++++++
154136

155137
#. Add a :code:`.pre-commit-config.yaml` file to your project root
156138

157139
If you want to reuse Nox tasks in the pre-commit hooks, feel free to get some inspiration from the Python toolbox itself:
158140

159-
.. literalinclude:: ../../.pre-commit-config.yaml
141+
.. literalinclude:: ../../project-template/{{cookiecutter.repo_name}}/.pre-commit-config.yaml
160142
:language: yaml
161143

162144
#. Enable pre-commit hooks for your workspace

project-template/{{cookiecutter.repo_name}}/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ exasol-toolbox = "^1.6.0"
3030
requires = ["poetry-core>=2.0.0"]
3131
build-backend = "poetry.core.masonry.api"
3232

33+
# Tooling - marking what to show in the documentation
3334
[tool.coverage.run]
3435
relative_files = true
3536
source = [

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ cookiecutter = "^2.6.0"
7474
requires = ["poetry-core>=2.0.0"]
7575
build-backend = "poetry.core.masonry.api"
7676

77-
# Tooling
7877
[tool.coverage.run]
7978
relative_files = true
8079
source = [

0 commit comments

Comments
 (0)