python-libei 0.4.0__tar.gz → 0.4.1__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.
Files changed (32) hide show
  1. {python_libei-0.4.0/src/python_libei.egg-info → python_libei-0.4.1}/PKG-INFO +2 -2
  2. {python_libei-0.4.0 → python_libei-0.4.1}/README.md +1 -1
  3. {python_libei-0.4.0 → python_libei-0.4.1}/pyproject.toml +19 -1
  4. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/__init__.py +1 -1
  5. {python_libei-0.4.0 → python_libei-0.4.1/src/python_libei.egg-info}/PKG-INFO +2 -2
  6. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_loader.py +17 -8
  7. {python_libei-0.4.0 → python_libei-0.4.1}/LICENSE +0 -0
  8. {python_libei-0.4.0 → python_libei-0.4.1}/setup.cfg +0 -0
  9. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/_capi/__init__.py +0 -0
  10. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/_capi/libei.py +0 -0
  11. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/_capi/libeis.py +0 -0
  12. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/_capi/liboeffis.py +0 -0
  13. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/_capi/loader.py +0 -0
  14. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/_cobject.py +0 -0
  15. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/ei.py +0 -0
  16. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/eis.py +0 -0
  17. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/oeffis.py +0 -0
  18. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/portal.py +0 -0
  19. {python_libei-0.4.0 → python_libei-0.4.1}/src/libei/py.typed +0 -0
  20. {python_libei-0.4.0 → python_libei-0.4.1}/src/python_libei.egg-info/SOURCES.txt +0 -0
  21. {python_libei-0.4.0 → python_libei-0.4.1}/src/python_libei.egg-info/dependency_links.txt +0 -0
  22. {python_libei-0.4.0 → python_libei-0.4.1}/src/python_libei.egg-info/requires.txt +0 -0
  23. {python_libei-0.4.0 → python_libei-0.4.1}/src/python_libei.egg-info/top_level.txt +0 -0
  24. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_cobject.py +0 -0
  25. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_documentation_shape.py +0 -0
  26. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_documented_examples.py +0 -0
  27. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_ei_objects.py +0 -0
  28. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_eis_objects.py +0 -0
  29. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_integration_extras.py +0 -0
  30. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_integration_socketpair.py +0 -0
  31. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_oeffis.py +0 -0
  32. {python_libei-0.4.0 → python_libei-0.4.1}/tests/test_portal.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-libei
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Inject and receive input on Wayland from Python: ctypes bindings for libei, libeis and liboeffis
5
5
  Author: Dennis K. Paulsen
6
6
  License-Expression: MIT
@@ -136,7 +136,7 @@ pointer.
136
136
 
137
137
  ## Status
138
138
 
139
- Beta (`0.4.0`), published on [PyPI](https://pypi.org/project/python-libei/)
139
+ Beta (`0.4.1`), published on [PyPI](https://pypi.org/project/python-libei/)
140
140
  since `0.1.0`, and the API is not frozen — expect renames before 1.0. What
141
141
  that qualifier covers, concretely:
142
142
 
@@ -100,7 +100,7 @@ pointer.
100
100
 
101
101
  ## Status
102
102
 
103
- Beta (`0.4.0`), published on [PyPI](https://pypi.org/project/python-libei/)
103
+ Beta (`0.4.1`), published on [PyPI](https://pypi.org/project/python-libei/)
104
104
  since `0.1.0`, and the API is not frozen — expect renames before 1.0. What
105
105
  that qualifier covers, concretely:
106
106
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-libei"
7
- version = "0.4.0"
7
+ version = "0.4.1"
8
8
  description = "Inject and receive input on Wayland from Python: ctypes bindings for libei, libeis and liboeffis"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -101,6 +101,24 @@ strict = true
101
101
  # Every property in ei.py/eis.py/oeffis.py re-types a raw C call's result,
102
102
  # so this fires everywhere in the wrapper layer for no actionable reason.
103
103
  warn_return_any = false
104
+ # mypy defaults this to true and imports sqlite3 unconditionally to honor
105
+ # it -- a crash, not a fallback, on a Python built without it. Confirmed on
106
+ # FreeBSD 15 (GhostBSD's python3.11 port has no _sqlite3), which is the
107
+ # only place this has come up, but the flag is harmless anywhere the
108
+ # module is present: the cache just becomes one file per module instead of
109
+ # one sqlite db.
110
+ sqlite_cache = false
111
+ # Without this, results depend on the OS mypy happens to run on: it
112
+ # defaults to `sys.platform` of the invoking interpreter, and typeshed
113
+ # gates os.memfd_create to sys.platform == "linux" even though FreeBSD has
114
+ # implemented the syscall for years -- confirmed working at runtime on
115
+ # FreeBSD 15 (hasattr(os, "memfd_create") is True, round-trips real data),
116
+ # so the three call sites in tests/test_ei_objects.py,
117
+ # tests/test_eis_objects.py and tests/test_integration_extras.py are
118
+ # correct and this was a typeshed staleness false-positive, not a bug.
119
+ # Pinning to "linux" makes CI and every contributor's machine check the
120
+ # same thing regardless of what they develop on.
121
+ platform = "linux"
104
122
 
105
123
  # PyGObject is an optional extra (see [project.optional-dependencies].portal),
106
124
  # so `gi` may or may not be importable where mypy runs. Without this, the two
@@ -29,6 +29,6 @@ the full breakdown, including which features need which libei version.
29
29
  Beta: the API is not frozen.
30
30
  """
31
31
 
32
- __version__ = "0.4.0"
32
+ __version__ = "0.4.1"
33
33
 
34
34
  __all__ = ["__version__"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-libei
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Inject and receive input on Wayland from Python: ctypes bindings for libei, libeis and liboeffis
5
5
  Author: Dennis K. Paulsen
6
6
  License-Expression: MIT
@@ -136,7 +136,7 @@ pointer.
136
136
 
137
137
  ## Status
138
138
 
139
- Beta (`0.4.0`), published on [PyPI](https://pypi.org/project/python-libei/)
139
+ Beta (`0.4.1`), published on [PyPI](https://pypi.org/project/python-libei/)
140
140
  since `0.1.0`, and the API is not frozen — expect renames before 1.0. What
141
141
  that qualifier covers, concretely:
142
142
 
@@ -1,18 +1,27 @@
1
1
  """Unit tests for the deferred-loading mechanism itself.
2
2
 
3
- Uses libc.so.6 as a stand-in shared library (present on every Linux system)
4
- so these run without libei installed at all -- they're testing the loader,
5
- not libei.
3
+ Uses the C library as a stand-in shared library (present on every POSIX
4
+ system) so these run without libei installed at all -- they're testing the
5
+ loader, not libei. The soname isn't portable -- glibc is libc.so.6, FreeBSD
6
+ is libc.so.7 -- so it's resolved with ctypes.util.find_library rather than
7
+ hardcoded; a hardcoded libc.so.6 here once made every test below fail on
8
+ FreeBSD, not because LazyLibrary was wrong but because the soname it was
9
+ asked to load doesn't exist there.
6
10
  """
7
11
 
8
12
  from __future__ import annotations
9
13
 
10
- from ctypes import c_char_p, c_int
14
+ from ctypes import c_char_p, c_int, util
11
15
 
12
16
  import pytest
13
17
 
14
18
  from libei._capi.loader import LazyLibrary, LibraryNotFoundError
15
19
 
20
+ _found_libc = util.find_library("c")
21
+ if _found_libc is None:
22
+ raise RuntimeError("no C library found -- these tests need one to stand in")
23
+ _LIBC: str = _found_libc
24
+
16
25
 
17
26
  def test_import_does_not_touch_the_filesystem() -> None:
18
27
  # Constructing a LazyLibrary and declaring functions on it must not
@@ -35,12 +44,12 @@ def test_missing_library_is_not_available() -> None:
35
44
 
36
45
 
37
46
  def test_real_library_is_available() -> None:
38
- lib = LazyLibrary("libc.so.6")
47
+ lib = LazyLibrary(_LIBC)
39
48
  assert lib.is_available() is True
40
49
 
41
50
 
42
51
  def test_real_function_call_round_trips() -> None:
43
- lib = LazyLibrary("libc.so.6")
52
+ lib = LazyLibrary(_LIBC)
44
53
  abs_ = lib.function("abs", (c_int,), c_int)
45
54
  assert abs_(-7) == 7
46
55
  assert abs_(7) == 7
@@ -59,14 +68,14 @@ def test_function_result_is_cached_across_calls() -> None:
59
68
 
60
69
 
61
70
  def test_missing_symbol_raises_library_not_found_error() -> None:
62
- lib = LazyLibrary("libc.so.6")
71
+ lib = LazyLibrary(_LIBC)
63
72
  nonexistent = lib.function("this_symbol_does_not_exist_in_libc", (c_char_p,), c_int)
64
73
  with pytest.raises(LibraryNotFoundError, match="does not export"):
65
74
  nonexistent(b"x")
66
75
 
67
76
 
68
77
  def test_two_lazy_libraries_are_independent() -> None:
69
- good = LazyLibrary("libc.so.6")
78
+ good = LazyLibrary(_LIBC)
70
79
  bad = LazyLibrary("this-library-definitely-does-not-exist.so.999")
71
80
  assert good.is_available() is True
72
81
  assert bad.is_available() is False
File without changes
File without changes