Skip to content

Commit 16768b0

Browse files
committed
Add task to update requirements.txt and include toml-to-requirements in dependencies
1 parent 0ce8693 commit 16768b0

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

.vscode/tasks.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,32 @@
172172
},
173173
"type": "shell"
174174
},
175+
{
176+
"label": "Update requirements.txt",
177+
"command": "toml-to-req",
178+
"args": [
179+
"--toml-file",
180+
"pyproject.toml",
181+
"--optional-lists",
182+
"dev,doc,test",
183+
],
184+
"options": {
185+
"cwd": "${workspaceFolder}"
186+
},
187+
"group": {
188+
"kind": "build",
189+
"isDefault": false
190+
},
191+
"presentation": {
192+
"clear": true,
193+
"echo": true,
194+
"focus": false,
195+
"panel": "dedicated",
196+
"reveal": "always",
197+
"showReuseMessage": true,
198+
},
199+
"type": "shell"
200+
},
175201
{
176202
"label": "Clean Up",
177203
"type": "shell",

doc/dev/platforms.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ which is the reference file for the project dependencies.
3737
Please note that the generation is not systematic and the ``requirements.txt``
3838
file may not be up-to-date.
3939

40-
To update the ``requirements.txt`` file, you need to install the
41-
``toml-to-requirements`` and execute the following command:
40+
To update the ``requirements.txt`` file, use the Visual Studio task
41+
``Update requirements.txt`` or execute the following command:
4242

4343
.. code-block:: bash
4444
45-
toml-to-req --toml-file .\pyproject.toml --include-optional
45+
toml-to-req --toml-file pyproject.toml --include-optional-lists dev,doc,test
4646
4747
4848
Microsoft Windows 10

doc/requirements.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ Optional modules for development:
5151
-
5252
- Code coverage measurement for Python
5353
* - Cython
54-
-
54+
- >=3.0
5555
- The Cython compiler for writing C extensions in the Python language.
56+
* - toml-to-requirements
57+
- ==0.3.0
58+
- Convert a pyproject.toml file to a requirements.txt file
5659

5760
Optional modules for building the documentation:
5861

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ plotpy-tests = "plotpy.tests:run"
5656
plotpy-benchmarks = "plotpy.tests.benchmarks:run"
5757

5858
[project.optional-dependencies]
59-
dev = ["ruff", "pylint", "Coverage", "Cython>=3.0"]
59+
dev = ["ruff", "pylint", "Coverage", "Cython>=3.0", "toml-to-requirements==0.3.0"]
6060
doc = [
6161
"PyQt5",
6262
"sphinx",

0 commit comments

Comments
 (0)