xvfbwrapper 0.2.23__tar.gz → 0.2.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xvfbwrapper-0.2.23/xvfbwrapper.egg-info → xvfbwrapper-0.2.24}/PKG-INFO +8 -30
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/README.md +7 -29
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/pyproject.toml +9 -21
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/test_xvfb.py +10 -8
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/tox.ini +4 -8
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24/xvfbwrapper.egg-info}/PKG-INFO +8 -30
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/xvfbwrapper.py +7 -6
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/LICENSE +0 -0
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/MANIFEST.in +0 -0
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/setup.cfg +0 -0
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/xvfbwrapper.egg-info/SOURCES.txt +0 -0
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/xvfbwrapper.egg-info/dependency_links.txt +0 -0
- {xvfbwrapper-0.2.23 → xvfbwrapper-0.2.24}/xvfbwrapper.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xvfbwrapper
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.24
|
|
4
4
|
Summary: Manage headless displays with Xvfb (X virtual framebuffer)
|
|
5
5
|
Author: Corey Goldberg
|
|
6
6
|
Maintainer: Corey Goldberg
|
|
@@ -260,7 +260,7 @@ os.environ["XDG_SESSION_TYPE"] = "x11"
|
|
|
260
260
|
class TestPage(unittest.TestCase):
|
|
261
261
|
|
|
262
262
|
def setUp(self):
|
|
263
|
-
xvfb = Xvfb()
|
|
263
|
+
xvfb = Xvfb(set_xdg_session_type=True)
|
|
264
264
|
xvfb.start()
|
|
265
265
|
self.driver = webdriver.Chrome()
|
|
266
266
|
self.addCleanup(xvfb.stop)
|
|
@@ -282,26 +282,11 @@ if __name__ == "__main__":
|
|
|
282
282
|
|
|
283
283
|
----
|
|
284
284
|
|
|
285
|
-
##
|
|
285
|
+
## Development
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
- Git: [github.com/cgoldberg/xvfbwrapper.git][github-repo]
|
|
288
288
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
## xvfbwrapper Development
|
|
292
|
-
|
|
293
|
-
1. Fork the project repo on [GitHub][github-repo]
|
|
294
|
-
|
|
295
|
-
2. Clone the repo:
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
git clone https://github.com/<USERNAME>/xvfbwrapper.git
|
|
299
|
-
cd xvfbwrapper
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
3. Make changes and run the tests:
|
|
303
|
-
|
|
304
|
-
Create a virtual env and install required testing packages:
|
|
289
|
+
- Create a virtual env and install required testing packages:
|
|
305
290
|
|
|
306
291
|
```
|
|
307
292
|
python -m venv venv
|
|
@@ -309,27 +294,20 @@ To report a bug or request a new feature, please open an issue on [GitHub][githu
|
|
|
309
294
|
pip install --editable --group dev --group test .
|
|
310
295
|
```
|
|
311
296
|
|
|
312
|
-
|
|
297
|
+
- Run all tests in the default Python environment:
|
|
313
298
|
|
|
314
299
|
```
|
|
315
300
|
pytest
|
|
316
301
|
```
|
|
317
302
|
|
|
318
|
-
|
|
319
|
-
|
|
303
|
+
- Run all tests, linting, and type checking across all supported/installed
|
|
304
|
+
Python environments:
|
|
320
305
|
|
|
321
306
|
```
|
|
322
307
|
tox
|
|
323
308
|
```
|
|
324
309
|
|
|
325
|
-
4. Commit and push your changes
|
|
326
|
-
|
|
327
|
-
5. Submit a [Pull Request][github-prs]
|
|
328
|
-
|
|
329
|
-
|
|
330
310
|
[github-profile]: https://github.com/cgoldberg
|
|
331
311
|
[github-repo]: https://github.com/cgoldberg/xvfbwrapper
|
|
332
|
-
[github-issues]: https://github.com/cgoldberg/xvfbwrapper/issues
|
|
333
|
-
[github-prs]: https://github.com/cgoldberg/xvfbwrapper/pulls
|
|
334
312
|
[pypi-home]: https://pypi.org/project/xvfbwrapper
|
|
335
313
|
[mit-license]: https://raw.githubusercontent.com/cgoldberg/xvfbwrapper/refs/heads/master/LICENSE
|
|
@@ -229,7 +229,7 @@ os.environ["XDG_SESSION_TYPE"] = "x11"
|
|
|
229
229
|
class TestPage(unittest.TestCase):
|
|
230
230
|
|
|
231
231
|
def setUp(self):
|
|
232
|
-
xvfb = Xvfb()
|
|
232
|
+
xvfb = Xvfb(set_xdg_session_type=True)
|
|
233
233
|
xvfb.start()
|
|
234
234
|
self.driver = webdriver.Chrome()
|
|
235
235
|
self.addCleanup(xvfb.stop)
|
|
@@ -251,26 +251,11 @@ if __name__ == "__main__":
|
|
|
251
251
|
|
|
252
252
|
----
|
|
253
253
|
|
|
254
|
-
##
|
|
254
|
+
## Development
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
- Git: [github.com/cgoldberg/xvfbwrapper.git][github-repo]
|
|
257
257
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
## xvfbwrapper Development
|
|
261
|
-
|
|
262
|
-
1. Fork the project repo on [GitHub][github-repo]
|
|
263
|
-
|
|
264
|
-
2. Clone the repo:
|
|
265
|
-
|
|
266
|
-
```
|
|
267
|
-
git clone https://github.com/<USERNAME>/xvfbwrapper.git
|
|
268
|
-
cd xvfbwrapper
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
3. Make changes and run the tests:
|
|
272
|
-
|
|
273
|
-
Create a virtual env and install required testing packages:
|
|
258
|
+
- Create a virtual env and install required testing packages:
|
|
274
259
|
|
|
275
260
|
```
|
|
276
261
|
python -m venv venv
|
|
@@ -278,27 +263,20 @@ To report a bug or request a new feature, please open an issue on [GitHub][githu
|
|
|
278
263
|
pip install --editable --group dev --group test .
|
|
279
264
|
```
|
|
280
265
|
|
|
281
|
-
|
|
266
|
+
- Run all tests in the default Python environment:
|
|
282
267
|
|
|
283
268
|
```
|
|
284
269
|
pytest
|
|
285
270
|
```
|
|
286
271
|
|
|
287
|
-
|
|
288
|
-
|
|
272
|
+
- Run all tests, linting, and type checking across all supported/installed
|
|
273
|
+
Python environments:
|
|
289
274
|
|
|
290
275
|
```
|
|
291
276
|
tox
|
|
292
277
|
```
|
|
293
278
|
|
|
294
|
-
4. Commit and push your changes
|
|
295
|
-
|
|
296
|
-
5. Submit a [Pull Request][github-prs]
|
|
297
|
-
|
|
298
|
-
|
|
299
279
|
[github-profile]: https://github.com/cgoldberg
|
|
300
280
|
[github-repo]: https://github.com/cgoldberg/xvfbwrapper
|
|
301
|
-
[github-issues]: https://github.com/cgoldberg/xvfbwrapper/issues
|
|
302
|
-
[github-prs]: https://github.com/cgoldberg/xvfbwrapper/pulls
|
|
303
281
|
[pypi-home]: https://pypi.org/project/xvfbwrapper
|
|
304
282
|
[mit-license]: https://raw.githubusercontent.com/cgoldberg/xvfbwrapper/refs/heads/master/LICENSE
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "xvfbwrapper"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.24"
|
|
8
8
|
description = "Manage headless displays with Xvfb (X virtual framebuffer)"
|
|
9
9
|
license = "MIT"
|
|
10
10
|
license-files = ["LICENSE"]
|
|
@@ -41,17 +41,15 @@ dev = [
|
|
|
41
41
|
"tox",
|
|
42
42
|
]
|
|
43
43
|
lint = [
|
|
44
|
-
"black",
|
|
45
|
-
"refurb",
|
|
46
44
|
"ruff",
|
|
47
45
|
]
|
|
48
46
|
test = [
|
|
49
47
|
"psutil",
|
|
50
48
|
"pytest",
|
|
51
|
-
"pytest-cov",
|
|
52
49
|
]
|
|
53
50
|
type = [
|
|
54
51
|
"mypy",
|
|
52
|
+
"types-psutil",
|
|
55
53
|
]
|
|
56
54
|
validate = [
|
|
57
55
|
"packaging",
|
|
@@ -62,14 +60,8 @@ validate = [
|
|
|
62
60
|
[tool.setuptools]
|
|
63
61
|
py-modules = ["xvfbwrapper"]
|
|
64
62
|
|
|
65
|
-
[tool.pytest
|
|
66
|
-
addopts = "-
|
|
67
|
-
|
|
68
|
-
[tool.black]
|
|
69
|
-
line-length = 88
|
|
70
|
-
target-version = [
|
|
71
|
-
"py310", "py311", "py312", "py313", "py314"
|
|
72
|
-
]
|
|
63
|
+
[tool.pytest]
|
|
64
|
+
addopts = ["-v"]
|
|
73
65
|
|
|
74
66
|
[tool.ruff]
|
|
75
67
|
line-length = 88
|
|
@@ -77,18 +69,14 @@ respect-gitignore = true
|
|
|
77
69
|
target-version = "py310"
|
|
78
70
|
|
|
79
71
|
[tool.ruff.lint]
|
|
80
|
-
|
|
81
|
-
select = [
|
|
82
|
-
"D", "E", "F", "I", "N", "FURB", "RUF", "TID", "UP", "W"
|
|
83
|
-
]
|
|
72
|
+
select = ["ALL"]
|
|
84
73
|
extend-ignore = [
|
|
85
|
-
"
|
|
74
|
+
"ANN", "COM812", "D", "EM101", "EM102", "FBT", "PERF203",
|
|
75
|
+
"PLR", "PT", "PYI034", "SLF001", "S101", "S108", "S311",
|
|
76
|
+
"S603", "TRY003", "TRY400"
|
|
86
77
|
]
|
|
78
|
+
fixable = ["ALL"]
|
|
87
79
|
|
|
88
80
|
[tool.ruff.format]
|
|
89
81
|
docstring-code-format = true
|
|
90
82
|
docstring-code-line-length = 88
|
|
91
|
-
|
|
92
|
-
[tool.refurb]
|
|
93
|
-
python_version = "3.10"
|
|
94
|
-
enable_all = true
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
|
|
2
|
+
# Copyright (c) 2012-2026 Corey Goldberg
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
3
4
|
|
|
4
5
|
"""Tests for xvfbwrapper."""
|
|
5
6
|
|
|
@@ -7,6 +8,7 @@ import os
|
|
|
7
8
|
import sys
|
|
8
9
|
import tempfile
|
|
9
10
|
import unittest
|
|
11
|
+
from contextlib import suppress
|
|
10
12
|
from unittest.mock import patch
|
|
11
13
|
|
|
12
14
|
import psutil
|
|
@@ -52,10 +54,8 @@ class XvfbCleanTestCase(unittest.TestCase):
|
|
|
52
54
|
continue
|
|
53
55
|
_, alive = psutil.wait_procs(procs, timeout=3)
|
|
54
56
|
for proc in alive:
|
|
55
|
-
|
|
57
|
+
with suppress(psutil.NoSuchProcess, psutil.AccessDenied):
|
|
56
58
|
proc.kill()
|
|
57
|
-
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
58
|
-
pass
|
|
59
59
|
|
|
60
60
|
# ---------- Class-level ----------
|
|
61
61
|
|
|
@@ -375,11 +375,13 @@ class TestXvfb(XvfbCleanTestCase):
|
|
|
375
375
|
"bar",
|
|
376
376
|
]
|
|
377
377
|
# Force the display socket to never appear
|
|
378
|
-
with
|
|
379
|
-
|
|
378
|
+
with (
|
|
379
|
+
patch.object(xvfb, "_local_display_exists", return_value=False),
|
|
380
|
+
self.assertRaisesRegex(
|
|
380
381
|
RuntimeError, f"Xvfb display did not open: {expected_cmd_args}"
|
|
381
|
-
)
|
|
382
|
-
|
|
382
|
+
),
|
|
383
|
+
):
|
|
384
|
+
xvfb.start()
|
|
383
385
|
# After failure, calling stop() again must not raise an exception
|
|
384
386
|
xvfb.stop()
|
|
385
387
|
# We never injected DISPLAY into our custom env
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
# "tox -e <env>" (i.e.: "tox -e py314" or "tox -e lint")
|
|
7
7
|
#
|
|
8
8
|
# This tox configuration will skip any Python interpreters that can't be found.
|
|
9
|
-
# To manage multiple Python interpreters for covering all versions, you can use
|
|
10
|
-
# pyenv: https://github.com/pyenv/pyenv
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
[tox]
|
|
@@ -16,6 +14,9 @@ envlist =
|
|
|
16
14
|
lint
|
|
17
15
|
type
|
|
18
16
|
py310
|
|
17
|
+
py311
|
|
18
|
+
py312
|
|
19
|
+
py313
|
|
19
20
|
py314
|
|
20
21
|
pypy3
|
|
21
22
|
skip_missing_interpreters = true
|
|
@@ -27,7 +28,7 @@ platform = linux|darwin|.*bsd.*
|
|
|
27
28
|
dependency_groups =
|
|
28
29
|
test
|
|
29
30
|
commands =
|
|
30
|
-
pytest
|
|
31
|
+
pytest {posargs:.}
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
[testenv:validate]
|
|
@@ -47,13 +48,8 @@ dependency_groups =
|
|
|
47
48
|
lint
|
|
48
49
|
skip_install = true
|
|
49
50
|
commands =
|
|
50
|
-
# crazy workaround so black doesn't print red messages to console on success
|
|
51
|
-
{envpython} -c "import subprocess as s; import sys; "\
|
|
52
|
-
"r = s.run(['black', '.'], capture_output=True, text=True, encoding='utf-8'); "\
|
|
53
|
-
"sys.stdout.write(r.stderr) if not r.returncode else sys.stderr.write(r.stderr)"
|
|
54
51
|
ruff check --fix --show-fixes --exit-non-zero-on-fix .
|
|
55
52
|
ruff format --exit-non-zero-on-format .
|
|
56
|
-
refurb xvfbwrapper.py test_xvfb.py
|
|
57
53
|
|
|
58
54
|
|
|
59
55
|
[testenv:type]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xvfbwrapper
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.24
|
|
4
4
|
Summary: Manage headless displays with Xvfb (X virtual framebuffer)
|
|
5
5
|
Author: Corey Goldberg
|
|
6
6
|
Maintainer: Corey Goldberg
|
|
@@ -260,7 +260,7 @@ os.environ["XDG_SESSION_TYPE"] = "x11"
|
|
|
260
260
|
class TestPage(unittest.TestCase):
|
|
261
261
|
|
|
262
262
|
def setUp(self):
|
|
263
|
-
xvfb = Xvfb()
|
|
263
|
+
xvfb = Xvfb(set_xdg_session_type=True)
|
|
264
264
|
xvfb.start()
|
|
265
265
|
self.driver = webdriver.Chrome()
|
|
266
266
|
self.addCleanup(xvfb.stop)
|
|
@@ -282,26 +282,11 @@ if __name__ == "__main__":
|
|
|
282
282
|
|
|
283
283
|
----
|
|
284
284
|
|
|
285
|
-
##
|
|
285
|
+
## Development
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
- Git: [github.com/cgoldberg/xvfbwrapper.git][github-repo]
|
|
288
288
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
## xvfbwrapper Development
|
|
292
|
-
|
|
293
|
-
1. Fork the project repo on [GitHub][github-repo]
|
|
294
|
-
|
|
295
|
-
2. Clone the repo:
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
git clone https://github.com/<USERNAME>/xvfbwrapper.git
|
|
299
|
-
cd xvfbwrapper
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
3. Make changes and run the tests:
|
|
303
|
-
|
|
304
|
-
Create a virtual env and install required testing packages:
|
|
289
|
+
- Create a virtual env and install required testing packages:
|
|
305
290
|
|
|
306
291
|
```
|
|
307
292
|
python -m venv venv
|
|
@@ -309,27 +294,20 @@ To report a bug or request a new feature, please open an issue on [GitHub][githu
|
|
|
309
294
|
pip install --editable --group dev --group test .
|
|
310
295
|
```
|
|
311
296
|
|
|
312
|
-
|
|
297
|
+
- Run all tests in the default Python environment:
|
|
313
298
|
|
|
314
299
|
```
|
|
315
300
|
pytest
|
|
316
301
|
```
|
|
317
302
|
|
|
318
|
-
|
|
319
|
-
|
|
303
|
+
- Run all tests, linting, and type checking across all supported/installed
|
|
304
|
+
Python environments:
|
|
320
305
|
|
|
321
306
|
```
|
|
322
307
|
tox
|
|
323
308
|
```
|
|
324
309
|
|
|
325
|
-
4. Commit and push your changes
|
|
326
|
-
|
|
327
|
-
5. Submit a [Pull Request][github-prs]
|
|
328
|
-
|
|
329
|
-
|
|
330
310
|
[github-profile]: https://github.com/cgoldberg
|
|
331
311
|
[github-repo]: https://github.com/cgoldberg/xvfbwrapper
|
|
332
|
-
[github-issues]: https://github.com/cgoldberg/xvfbwrapper/issues
|
|
333
|
-
[github-prs]: https://github.com/cgoldberg/xvfbwrapper/pulls
|
|
334
312
|
[pypi-home]: https://pypi.org/project/xvfbwrapper
|
|
335
313
|
[mit-license]: https://raw.githubusercontent.com/cgoldberg/xvfbwrapper/refs/heads/master/LICENSE
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
#
|
|
2
|
-
# License: MIT
|
|
1
|
+
# Copyright (c) 2012-2026 Corey Goldberg
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
3
4
|
|
|
4
5
|
"""Run a headless display inside X virtual framebuffer (Xvfb)."""
|
|
5
6
|
|
|
@@ -16,9 +17,9 @@ from random import randint
|
|
|
16
17
|
|
|
17
18
|
try:
|
|
18
19
|
import fcntl
|
|
19
|
-
except ImportError:
|
|
20
|
+
except ImportError as e:
|
|
20
21
|
system = platform.system()
|
|
21
|
-
raise OSError(f"xvfbwrapper is not supported on this platform: {system}")
|
|
22
|
+
raise OSError(f"xvfbwrapper is not supported on this platform: {system}") from e
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
class Xvfb:
|
|
@@ -60,7 +61,7 @@ class Xvfb:
|
|
|
60
61
|
if not extra_args:
|
|
61
62
|
extra_args = []
|
|
62
63
|
|
|
63
|
-
self.extra_xvfb_args = [
|
|
64
|
+
self.extra_xvfb_args: list[str] = [
|
|
64
65
|
"-screen",
|
|
65
66
|
"0",
|
|
66
67
|
f"{self.width}x{self.height}x{self.colordepth}",
|
|
@@ -134,7 +135,7 @@ class Xvfb:
|
|
|
134
135
|
|
|
135
136
|
def _xvfb_exists(self) -> bool:
|
|
136
137
|
"""Check that Xvfb is available on PATH and is executable."""
|
|
137
|
-
return
|
|
138
|
+
return shutil.which("Xvfb") is not None
|
|
138
139
|
|
|
139
140
|
def _cleanup_lock_file(self):
|
|
140
141
|
"""Delete lock files when stopping.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|