Skip to content

Commit edcf6a2

Browse files
committed
Merge branch 'feature/env' into develop
2 parents d85aab2 + 0f39925 commit edcf6a2

29 files changed

+137
-144
lines changed

.vscode/launch.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"program": "${workspaceFolder}/plotpy/tests/__init__.py",
1212
"console": "integratedTerminal",
1313
"envFile": "${workspaceFolder}/.env",
14-
"python": "${config:python.defaultInterpreterPath}",
1514
"justMyCode": true,
1615
"env": {
1716
"QT_COLOR_MODE": "light",
@@ -24,7 +23,6 @@
2423
"program": "${file}",
2524
"console": "integratedTerminal",
2625
"envFile": "${workspaceFolder}/.env",
27-
"python": "${config:python.defaultInterpreterPath}",
2826
"justMyCode": false,
2927
"pythonArgs": [
3028
"-W error::DeprecationWarning",
@@ -39,7 +37,6 @@
3937
"program": "${file}",
4038
"console": "integratedTerminal",
4139
"envFile": "${workspaceFolder}/.env",
42-
"python": "${config:python.defaultInterpreterPath}",
4340
"pythonArgs": [
4441
"-W error::DeprecationWarning",
4542
],

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
},
1717
"files.trimFinalNewlines": true,
1818
"files.trimTrailingWhitespace": true,
19-
"python.defaultInterpreterPath": "${env:PPSTACK_PYTHONEXE}",
2019
"editor.formatOnSave": true,
2120
"python.analysis.autoFormatStrings": true,
2221
"python.testing.unittestEnabled": false,

.vscode/tasks.json

Lines changed: 92 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,94 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7-
"label": "gettext - Scan",
8-
"type": "shell",
9-
"command": "cmd",
7+
"label": "Run Ruff Formatter",
8+
"command": "ruff",
109
"args": [
11-
"/c",
12-
"gettext.bat",
13-
"rescan",
10+
"format"
1411
],
1512
"options": {
16-
"cwd": "scripts",
17-
"env": {
18-
"UNATTENDED": "1",
19-
"PYTHONUTF8": "1",
20-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
21-
}
13+
"cwd": "${workspaceFolder}"
2214
},
2315
"group": {
2416
"kind": "build",
2517
"isDefault": true
2618
},
2719
"presentation": {
20+
"clear": true,
2821
"echo": true,
22+
"focus": false,
23+
"panel": "dedicated",
2924
"reveal": "always",
25+
"showReuseMessage": true
26+
},
27+
"type": "shell"
28+
},
29+
{
30+
"label": "Run Ruff Linter",
31+
"command": "ruff",
32+
"args": [
33+
"check",
34+
],
35+
"options": {
36+
"cwd": "${workspaceFolder}"
37+
},
38+
"group": {
39+
"kind": "build",
40+
"isDefault": true
41+
},
42+
"presentation": {
43+
"clear": true,
44+
"echo": true,
3045
"focus": false,
31-
"panel": "shared",
46+
"panel": "dedicated",
47+
"reveal": "always",
3248
"showReuseMessage": true,
33-
"clear": false
34-
}
49+
},
50+
"type": "shell"
3551
},
3652
{
37-
"label": "gettext - Compile",
53+
"label": "Run Pylint",
54+
"command": "pylint",
55+
"args": [
56+
"plotpy",
57+
"--disable=C",
58+
"--disable=fixme",
59+
"--disable=R",
60+
"--disable=W",
61+
"--ignore=external"
62+
],
63+
"options": {
64+
"cwd": "${workspaceFolder}"
65+
},
66+
"group": {
67+
"kind": "build",
68+
"isDefault": true
69+
},
70+
"presentation": {
71+
"clear": true,
72+
"echo": true,
73+
"focus": false,
74+
"panel": "dedicated",
75+
"reveal": "always",
76+
"showReuseMessage": true
77+
},
78+
"type": "shell"
79+
},
80+
{
81+
"label": "gettext - Scan",
3882
"type": "shell",
3983
"command": "cmd",
4084
"args": [
4185
"/c",
4286
"gettext.bat",
43-
"compile",
87+
"rescan",
4488
],
4589
"options": {
4690
"cwd": "scripts",
4791
"env": {
4892
"UNATTENDED": "1",
49-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
93+
"PYTHONUTF8": "1",
94+
"PYTHON": "${command:python.interpreterPath}",
5095
}
5196
},
5297
"group": {
@@ -63,18 +108,19 @@
63108
}
64109
},
65110
{
66-
"label": "Run Coverage",
111+
"label": "gettext - Compile",
67112
"type": "shell",
68113
"command": "cmd",
69114
"args": [
70115
"/c",
71-
"run_coverage.bat",
116+
"gettext.bat",
117+
"compile",
72118
],
73119
"options": {
74120
"cwd": "scripts",
75121
"env": {
76122
"UNATTENDED": "1",
77-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
123+
"PYTHON": "${command:python.interpreterPath}",
78124
}
79125
},
80126
"group": {
@@ -85,9 +131,9 @@
85131
"echo": true,
86132
"reveal": "always",
87133
"focus": false,
88-
"panel": "dedicated",
134+
"panel": "shared",
89135
"showReuseMessage": true,
90-
"clear": true
136+
"clear": false
91137
}
92138
},
93139
{
@@ -102,7 +148,7 @@
102148
"cwd": "scripts",
103149
"env": {
104150
"UNATTENDED": "1",
105-
"PYTHON": "${env:PPSTACK_PYTHONEXE}"
151+
"PYTHON": "${command:python.interpreterPath}"
106152
}
107153
},
108154
"group": {
@@ -119,49 +165,44 @@
119165
}
120166
},
121167
{
122-
"label": "Run Pylint",
123-
"type": "shell",
124-
"command": "cmd",
168+
"label": "Update requirements.txt",
169+
"command": "toml-to-req",
125170
"args": [
126-
"/c",
127-
"run_pylint.bat",
128-
// "--disable=R0801,C0103,C0114,C0115,C0116,W0612,W0613",
129-
"--disable=fixme,C,R,W",
130-
"--ignore=external",
171+
"--toml-file",
172+
"pyproject.toml",
173+
"--optional-lists",
174+
"dev,doc,test",
131175
],
132176
"options": {
133-
"cwd": "scripts",
134-
"env": {
135-
"UNATTENDED": "1",
136-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
137-
}
177+
"cwd": "${workspaceFolder}"
138178
},
139179
"group": {
140180
"kind": "build",
141181
"isDefault": true
142182
},
143183
"presentation": {
184+
"clear": true,
144185
"echo": true,
145-
"reveal": "always",
146186
"focus": false,
147187
"panel": "dedicated",
188+
"reveal": "always",
148189
"showReuseMessage": true,
149-
"clear": true
150-
}
190+
},
191+
"type": "shell"
151192
},
152193
{
153-
"label": "Run Ruff",
194+
"label": "Run Coverage",
154195
"type": "shell",
155196
"command": "cmd",
156197
"args": [
157198
"/c",
158-
"run_ruff.bat",
199+
"run_coverage.bat",
159200
],
160201
"options": {
161202
"cwd": "scripts",
162203
"env": {
163-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
164-
"UNATTENDED": "1"
204+
"UNATTENDED": "1",
205+
"PYTHON": "${command:python.interpreterPath}",
165206
}
166207
},
167208
"group": {
@@ -213,7 +254,7 @@
213254
"cwd": "scripts",
214255
"env": {
215256
"UNATTENDED": "1",
216-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
257+
"PYTHON": "${command:python.interpreterPath}",
217258
}
218259
},
219260
"group": {
@@ -241,7 +282,7 @@
241282
"cwd": "scripts",
242283
"env": {
243284
"UNATTENDED": "1",
244-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
285+
"PYTHON": "${command:python.interpreterPath}",
245286
}
246287
},
247288
"group": {
@@ -264,7 +305,7 @@
264305
"options": {
265306
"cwd": "scripts",
266307
"env": {
267-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
308+
"PYTHON": "${command:python.interpreterPath}",
268309
"UNATTENDED": "1",
269310
}
270311
},
@@ -293,7 +334,7 @@
293334
"options": {
294335
"cwd": "scripts",
295336
"env": {
296-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
337+
"PYTHON": "${command:python.interpreterPath}",
297338
"UNATTENDED": "1",
298339
}
299340
},
@@ -326,7 +367,7 @@
326367
"options": {
327368
"cwd": "scripts",
328369
"env": {
329-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
370+
"PYTHON": "${command:python.interpreterPath}",
330371
"UNATTENDED": "1",
331372
}
332373
},
@@ -359,7 +400,7 @@
359400
"options": {
360401
"cwd": "scripts",
361402
"env": {
362-
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
403+
"PYTHON": "${command:python.interpreterPath}",
363404
"UNATTENDED": "1",
364405
}
365406
},
@@ -398,7 +439,7 @@
398439
},
399440
"group": {
400441
"kind": "build",
401-
"isDefault": false
442+
"isDefault": true
402443
},
403444
"presentation": {
404445
"echo": true,

colormaps/matplotlib_cmaps.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117

118118
def rgb_colors_to_hex_list(
119-
colors: list[tuple[int, int, int]]
119+
colors: list[tuple[int, int, int]],
120120
) -> list[tuple[float, str]]:
121121
"""Convert a list of RGB colors to a list of tuples with the position of the color
122122
and the color in hex format. Positions evenly distributed between 0 and 1.
@@ -261,7 +261,6 @@ def append_non_mpl_colormaps(mpl_colormaps: CmapDictType, colormaps: CmapDictTyp
261261

262262

263263
def main(cmaps: CmapDictType, out_json_path: str = DEFAULT_COLORMAPS_PATH):
264-
265264
new_cmaps: dict[str, list[tuple[float, str]]] = {}
266265

267266
# Uniform colormaps with a .colors attribute that return a list of RGB colors

doc/dev/contribute.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,9 @@ development environment. The easiest way to do this is to use `virtualenv
9393
<http://pypi.python.org/pypi/virtualenv>`_ and `pip
9494
<http://pypi.python.org/pypi/pip>`_.
9595

96-
Some parameters are required to be set before using the project from within
97-
Visual Studio Code (used in `launch.json` and `tasks.json`). These are:
96+
Visual Studio Code `.env` file:
9897

99-
* ``PPSTACK_PYTHONEXE``: The path to the Python interpreter to use. This is
100-
used to launch the application from within Visual Studio Code. If not set,
101-
the default Python interpreter will be used.
102-
103-
* `.env` file: This file is used to set environment variables for the
98+
* This file is used to set environment variables for the
10499
application. It is used to set the ``PYTHONPATH`` environment variable to
105100
the root of the project. This is required to be able to import the project
106101
modules from within Visual Studio Code. To create this file, copy the

doc/dev/platforms.rst

Lines changed: 3 additions & 10 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
@@ -75,13 +75,6 @@ That's it, you can now run the tests using the following command:
7575
7676
pytest plotpy
7777
78-
If you want to rely on Visual Studio Code for editing and take advantage of the
79-
project settings and tasks, you will need to set the following environment variable:
80-
81-
.. code-block:: bash
82-
83-
set PPSTACK_PYTHONEXE=C:\WPy64-31110\python-3.11.1.amd64\python.exe
84-
8578
CentOS Stream 8.8
8679
^^^^^^^^^^^^^^^^^
8780

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

0 commit comments

Comments
 (0)