summaryrefslogtreecommitdiff
path: root/python-psgtest.spec
blob: 3e3e0e0bd6bfb96cbdf15163a32f44a4b07bd4ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
%global _empty_manifest_terminate_build 0
Name:		python-psgtest
Version:	3.4
Release:	1
Summary:	Run your Python programs, capture the output, using your choice of interpreters
License:	GNU Lesser General Public License v3 or later (LGPLv3+)
URL:		https://github.com/PySimpleGUI/psgtest
Source0:	https://mirrors.aliyun.com/pypi/web/packages/50/ef/c92867043fb8ff472aec87ca46c23bf38d52280055a2e7d4e57a5ad0edb6/psgtest-3.4.tar.gz
BuildArch:	noarch

Requires:	python3-PySimpleGUI
Requires:	python3-psutil

%description

<p align="center">
  <img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
  <h2 align="center">psgtest</h2>
  <h2 align="center">Simple Python Testing</h2>
</p>

Run your Python programs using the interpreter version of your choice, and display the output in a GUI window.

![psgtest 3 0](https://user-images.githubusercontent.com/46163555/233642958-730f19f0-43a9-4bea-833e-9524c2d770ff.gif)


## Installation

### Old-school Straight Pip

pip install psgtest

### pip via `python -m pip` the python recommended way

#### If `python` is your command

`python -m pip install psgtest`

#### If `python3` is your command

`python3 -m pip install psgtest`

## Usage

Once pip installed, you can launch psgtest by typing on the command line:  
`psgtest`

You can also create a Windows shortcut by following the instructions below.

## About

This is an example of another utility used in the development of PySimpleGUI that is being released for other PySimpleGUI users to use either as a standalone tool or as example code / design pattern to follow.

It can be challenging to manage multiple versions of Python and the need to test across multiple versions.  Virtual Environments are one approach that are often used.  psgtest does not use virtual environments.  Instead, it invokes the Python interpreter of your choice directly.

The advantage is that changing which version of Python that's used is changed in a single drop-down menu selection as shown in the example GIF above.  The session in the GIF shows launching the PySimpleGUI main test harness using multiple versions of Python by selecting the version from the drop-down at the top.

## Executing Multiple Programs

To run multiple programs, select the files to run from the list of files on the left portion of the window.  Then click the "Run" button.


## Editing Programs

You can also edit the programs selected by clicking the "Edit" button.  You will need to set up your editor using the PySimpleGUI global settings.  If you have pip installed a version of PySimpleGUI that's 4.53.0.14 or greater, then you can type `psgsettings` from the command line.  You can also change the settings by calling `sg.main()` (or typing from the command line `psgmain`).

## Specifying/Selecting Python Interpreter Locations

The Setup Window is where you enter the path to each version of Python that you want to test with.  The settings are stored in a file and thus will be saved from one run to another.

Selecting the version to use can be done in either the settings window or using the drop-down menu in the main window.

## Output

The stdout and stderr from each program you execute are  displayed in a tab with a name that matches your filename.  Each program you run will open a new tab.

In each tab you'll find 2 buttons that operate on the output shown in that tab.

Use the `Copy To Clipboard` button to copy the contents of the output to the clipboard.  

Use the `Clear` button to delete the output.

The `Close Tab` button closes the tab as does the right click menu item `Close`.  If you run the program again after closing the tab, the old contents of the tab are retained and shown when the tab is "re-opened".  (See the GIF above for an example)

## Make a Windows Shortcut

If you're running Windows, then you can use `psgshortcut` to make a shortcut to the .pyw file (if you download psgtest from GitHub) or the .py file (if you pip installed).  The icon for `psgtest` is in this repo and is also included when you pip install psgtest.  It's in the same folder as the gui.py file.  

You can find the location of psgtest after pip installing it by running psgtest, right clicking, and choosing "File Location".  You'll be shown where the `gui.py` file is located (the name of the psgtest program when pip installed).  It will usually be located in the `site-packages` folder in a folder named  `psgtest`.

Instructions on how to make shortcuts to pip installed PySimpleGUI programs can be found in [description for psgshortcut on PyPI](https://pypi.org/project/psgshortcut/).


## Release Notes

### 3.4   29-Apr-2023


- Allow non-python programs to be run.  If the file does not end in .py or .pyw, then the file will be executed directly

### 3.3   23-Apr-2023

- Remove the entry from sp_to_filename when killing process

### 3.2   22-Apr-2023

- Added piped output for regression testing
- Added cleanup of processes when exiting. If any processes are running, they will be killed.

### 3.0   21-Apr-2023

- Greatly expanded the Regression test features
- Made regression multi-threaded
- Added testing across all Python interpreters
- Removed direct calls to Python Thread module and using only PySimpleGUI supplied calls


### 1.13.0

* Run all Interpreters feature added

### 1.12.0

* Addition of a "custom release" of Python entry in setup
	* Enables using other "Python flavors" like pypy
	* One custom item is allowed

### 1.11.0

* Addition of a "run a single file" option so that you can quickly and easily test one program against many versions of Python

### 1.10.0

* Regression Test Feature - run large sets of tests.  Will keep tabs open that have failures and show an error popup

### 1.9.0

* Fix for exception when no settings are initially found.  Oy.... bad bug to have released reight away
* Will create a settings file with the currently running version of Python if one is not found
* Added minimum of 4.55.1 requirement for PySimpleGUI to the setup.py file

### 1.8.0

* Support for Python 3.4, 3.5, 3.11 added to settings 
* Set the settings filename to be `psgtest` instead of the default filename. This is needed because the file for these psg projects on PyPI are all name gui.py and thus will have all point to the same settings file if not explicitly set
* Only show configured interpreters in the Combo in main window     

## License

Licensed under an LGPL3 License

## Designed and Written By

Mike from PySimpleGUI.org

## Contributing

Like the PySimpleGUI project, this project is currently licensed under an open-source license, the project itself is structured like a proprietary product. Pull Requests are not accepted.

## Copyright

Copyright 2021 PySimpleGUI




%package -n python3-psgtest
Summary:	Run your Python programs, capture the output, using your choice of interpreters
Provides:	python-psgtest
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-psgtest

<p align="center">
  <img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
  <h2 align="center">psgtest</h2>
  <h2 align="center">Simple Python Testing</h2>
</p>

Run your Python programs using the interpreter version of your choice, and display the output in a GUI window.

![psgtest 3 0](https://user-images.githubusercontent.com/46163555/233642958-730f19f0-43a9-4bea-833e-9524c2d770ff.gif)


## Installation

### Old-school Straight Pip

pip install psgtest

### pip via `python -m pip` the python recommended way

#### If `python` is your command

`python -m pip install psgtest`

#### If `python3` is your command

`python3 -m pip install psgtest`

## Usage

Once pip installed, you can launch psgtest by typing on the command line:  
`psgtest`

You can also create a Windows shortcut by following the instructions below.

## About

This is an example of another utility used in the development of PySimpleGUI that is being released for other PySimpleGUI users to use either as a standalone tool or as example code / design pattern to follow.

It can be challenging to manage multiple versions of Python and the need to test across multiple versions.  Virtual Environments are one approach that are often used.  psgtest does not use virtual environments.  Instead, it invokes the Python interpreter of your choice directly.

The advantage is that changing which version of Python that's used is changed in a single drop-down menu selection as shown in the example GIF above.  The session in the GIF shows launching the PySimpleGUI main test harness using multiple versions of Python by selecting the version from the drop-down at the top.

## Executing Multiple Programs

To run multiple programs, select the files to run from the list of files on the left portion of the window.  Then click the "Run" button.


## Editing Programs

You can also edit the programs selected by clicking the "Edit" button.  You will need to set up your editor using the PySimpleGUI global settings.  If you have pip installed a version of PySimpleGUI that's 4.53.0.14 or greater, then you can type `psgsettings` from the command line.  You can also change the settings by calling `sg.main()` (or typing from the command line `psgmain`).

## Specifying/Selecting Python Interpreter Locations

The Setup Window is where you enter the path to each version of Python that you want to test with.  The settings are stored in a file and thus will be saved from one run to another.

Selecting the version to use can be done in either the settings window or using the drop-down menu in the main window.

## Output

The stdout and stderr from each program you execute are  displayed in a tab with a name that matches your filename.  Each program you run will open a new tab.

In each tab you'll find 2 buttons that operate on the output shown in that tab.

Use the `Copy To Clipboard` button to copy the contents of the output to the clipboard.  

Use the `Clear` button to delete the output.

The `Close Tab` button closes the tab as does the right click menu item `Close`.  If you run the program again after closing the tab, the old contents of the tab are retained and shown when the tab is "re-opened".  (See the GIF above for an example)

## Make a Windows Shortcut

If you're running Windows, then you can use `psgshortcut` to make a shortcut to the .pyw file (if you download psgtest from GitHub) or the .py file (if you pip installed).  The icon for `psgtest` is in this repo and is also included when you pip install psgtest.  It's in the same folder as the gui.py file.  

You can find the location of psgtest after pip installing it by running psgtest, right clicking, and choosing "File Location".  You'll be shown where the `gui.py` file is located (the name of the psgtest program when pip installed).  It will usually be located in the `site-packages` folder in a folder named  `psgtest`.

Instructions on how to make shortcuts to pip installed PySimpleGUI programs can be found in [description for psgshortcut on PyPI](https://pypi.org/project/psgshortcut/).


## Release Notes

### 3.4   29-Apr-2023


- Allow non-python programs to be run.  If the file does not end in .py or .pyw, then the file will be executed directly

### 3.3   23-Apr-2023

- Remove the entry from sp_to_filename when killing process

### 3.2   22-Apr-2023

- Added piped output for regression testing
- Added cleanup of processes when exiting. If any processes are running, they will be killed.

### 3.0   21-Apr-2023

- Greatly expanded the Regression test features
- Made regression multi-threaded
- Added testing across all Python interpreters
- Removed direct calls to Python Thread module and using only PySimpleGUI supplied calls


### 1.13.0

* Run all Interpreters feature added

### 1.12.0

* Addition of a "custom release" of Python entry in setup
	* Enables using other "Python flavors" like pypy
	* One custom item is allowed

### 1.11.0

* Addition of a "run a single file" option so that you can quickly and easily test one program against many versions of Python

### 1.10.0

* Regression Test Feature - run large sets of tests.  Will keep tabs open that have failures and show an error popup

### 1.9.0

* Fix for exception when no settings are initially found.  Oy.... bad bug to have released reight away
* Will create a settings file with the currently running version of Python if one is not found
* Added minimum of 4.55.1 requirement for PySimpleGUI to the setup.py file

### 1.8.0

* Support for Python 3.4, 3.5, 3.11 added to settings 
* Set the settings filename to be `psgtest` instead of the default filename. This is needed because the file for these psg projects on PyPI are all name gui.py and thus will have all point to the same settings file if not explicitly set
* Only show configured interpreters in the Combo in main window     

## License

Licensed under an LGPL3 License

## Designed and Written By

Mike from PySimpleGUI.org

## Contributing

Like the PySimpleGUI project, this project is currently licensed under an open-source license, the project itself is structured like a proprietary product. Pull Requests are not accepted.

## Copyright

Copyright 2021 PySimpleGUI




%package help
Summary:	Development documents and examples for psgtest
Provides:	python3-psgtest-doc
%description help

<p align="center">
  <img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
  <h2 align="center">psgtest</h2>
  <h2 align="center">Simple Python Testing</h2>
</p>

Run your Python programs using the interpreter version of your choice, and display the output in a GUI window.

![psgtest 3 0](https://user-images.githubusercontent.com/46163555/233642958-730f19f0-43a9-4bea-833e-9524c2d770ff.gif)


## Installation

### Old-school Straight Pip

pip install psgtest

### pip via `python -m pip` the python recommended way

#### If `python` is your command

`python -m pip install psgtest`

#### If `python3` is your command

`python3 -m pip install psgtest`

## Usage

Once pip installed, you can launch psgtest by typing on the command line:  
`psgtest`

You can also create a Windows shortcut by following the instructions below.

## About

This is an example of another utility used in the development of PySimpleGUI that is being released for other PySimpleGUI users to use either as a standalone tool or as example code / design pattern to follow.

It can be challenging to manage multiple versions of Python and the need to test across multiple versions.  Virtual Environments are one approach that are often used.  psgtest does not use virtual environments.  Instead, it invokes the Python interpreter of your choice directly.

The advantage is that changing which version of Python that's used is changed in a single drop-down menu selection as shown in the example GIF above.  The session in the GIF shows launching the PySimpleGUI main test harness using multiple versions of Python by selecting the version from the drop-down at the top.

## Executing Multiple Programs

To run multiple programs, select the files to run from the list of files on the left portion of the window.  Then click the "Run" button.


## Editing Programs

You can also edit the programs selected by clicking the "Edit" button.  You will need to set up your editor using the PySimpleGUI global settings.  If you have pip installed a version of PySimpleGUI that's 4.53.0.14 or greater, then you can type `psgsettings` from the command line.  You can also change the settings by calling `sg.main()` (or typing from the command line `psgmain`).

## Specifying/Selecting Python Interpreter Locations

The Setup Window is where you enter the path to each version of Python that you want to test with.  The settings are stored in a file and thus will be saved from one run to another.

Selecting the version to use can be done in either the settings window or using the drop-down menu in the main window.

## Output

The stdout and stderr from each program you execute are  displayed in a tab with a name that matches your filename.  Each program you run will open a new tab.

In each tab you'll find 2 buttons that operate on the output shown in that tab.

Use the `Copy To Clipboard` button to copy the contents of the output to the clipboard.  

Use the `Clear` button to delete the output.

The `Close Tab` button closes the tab as does the right click menu item `Close`.  If you run the program again after closing the tab, the old contents of the tab are retained and shown when the tab is "re-opened".  (See the GIF above for an example)

## Make a Windows Shortcut

If you're running Windows, then you can use `psgshortcut` to make a shortcut to the .pyw file (if you download psgtest from GitHub) or the .py file (if you pip installed).  The icon for `psgtest` is in this repo and is also included when you pip install psgtest.  It's in the same folder as the gui.py file.  

You can find the location of psgtest after pip installing it by running psgtest, right clicking, and choosing "File Location".  You'll be shown where the `gui.py` file is located (the name of the psgtest program when pip installed).  It will usually be located in the `site-packages` folder in a folder named  `psgtest`.

Instructions on how to make shortcuts to pip installed PySimpleGUI programs can be found in [description for psgshortcut on PyPI](https://pypi.org/project/psgshortcut/).


## Release Notes

### 3.4   29-Apr-2023


- Allow non-python programs to be run.  If the file does not end in .py or .pyw, then the file will be executed directly

### 3.3   23-Apr-2023

- Remove the entry from sp_to_filename when killing process

### 3.2   22-Apr-2023

- Added piped output for regression testing
- Added cleanup of processes when exiting. If any processes are running, they will be killed.

### 3.0   21-Apr-2023

- Greatly expanded the Regression test features
- Made regression multi-threaded
- Added testing across all Python interpreters
- Removed direct calls to Python Thread module and using only PySimpleGUI supplied calls


### 1.13.0

* Run all Interpreters feature added

### 1.12.0

* Addition of a "custom release" of Python entry in setup
	* Enables using other "Python flavors" like pypy
	* One custom item is allowed

### 1.11.0

* Addition of a "run a single file" option so that you can quickly and easily test one program against many versions of Python

### 1.10.0

* Regression Test Feature - run large sets of tests.  Will keep tabs open that have failures and show an error popup

### 1.9.0

* Fix for exception when no settings are initially found.  Oy.... bad bug to have released reight away
* Will create a settings file with the currently running version of Python if one is not found
* Added minimum of 4.55.1 requirement for PySimpleGUI to the setup.py file

### 1.8.0

* Support for Python 3.4, 3.5, 3.11 added to settings 
* Set the settings filename to be `psgtest` instead of the default filename. This is needed because the file for these psg projects on PyPI are all name gui.py and thus will have all point to the same settings file if not explicitly set
* Only show configured interpreters in the Combo in main window     

## License

Licensed under an LGPL3 License

## Designed and Written By

Mike from PySimpleGUI.org

## Contributing

Like the PySimpleGUI project, this project is currently licensed under an open-source license, the project itself is structured like a proprietary product. Pull Requests are not accepted.

## Copyright

Copyright 2021 PySimpleGUI




%prep
%autosetup -n psgtest-3.4

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-psgtest -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 3.4-1
- Package Spec generated