python-msilib 0.4.0__tar.gz → 0.4.2__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 (23) hide show
  1. python_msilib-0.4.2/MANIFEST.in +4 -0
  2. {python_msilib-0.4.0 → python_msilib-0.4.2}/Makefile +1 -0
  3. {python_msilib-0.4.0/src/python_msilib.egg-info → python_msilib-0.4.2}/PKG-INFO +9 -6
  4. {python_msilib-0.4.0 → python_msilib-0.4.2}/README.md +1 -1
  5. {python_msilib-0.4.0 → python_msilib-0.4.2}/pyproject.toml +14 -9
  6. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/msilib/__init__.py +14 -6
  7. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/msilib/include/pythoncapi_compat.h +100 -28
  8. {python_msilib-0.4.0 → python_msilib-0.4.2/src/python_msilib.egg-info}/PKG-INFO +9 -6
  9. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/python_msilib.egg-info/SOURCES.txt +1 -0
  10. python_msilib-0.4.2/src/python_msilib.egg-info/requires.txt +9 -0
  11. python_msilib-0.4.0/MANIFEST.in +0 -4
  12. python_msilib-0.4.0/src/python_msilib.egg-info/requires.txt +0 -9
  13. {python_msilib-0.4.0 → python_msilib-0.4.2}/LICENSE +0 -0
  14. {python_msilib-0.4.0 → python_msilib-0.4.2}/setup.cfg +0 -0
  15. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/msilib/_msi.c +0 -0
  16. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/msilib/include/_msi.h +0 -0
  17. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/msilib/schema.py +0 -0
  18. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/msilib/sequence.py +0 -0
  19. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/msilib/text.py +0 -0
  20. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/python_msilib.egg-info/dependency_links.txt +0 -0
  21. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/python_msilib.egg-info/not-zip-safe +0 -0
  22. {python_msilib-0.4.0 → python_msilib-0.4.2}/src/python_msilib.egg-info/top_level.txt +0 -0
  23. {python_msilib-0.4.0 → python_msilib-0.4.2}/tests/test_msilib.py +0 -0
@@ -0,0 +1,4 @@
1
+ include Makefile
2
+ recursive-include src *.c
3
+ recursive-include src *.h
4
+ recursive-include tests *.py
@@ -70,6 +70,7 @@ release:
70
70
  @echo "--or--"
71
71
  @echo " bump-my-version bump patch --new-version=X.XX.X"
72
72
  @echo "--then--"
73
+ @echo " git push origin `git branch --show-current`"
73
74
  @echo " git push origin `git branch --show-current` --tags"
74
75
 
75
76
  .PHONY: release-dev
@@ -1,10 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-msilib
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Read and write Microsoft Installer files
5
+ Author: Martin v. Löwis
5
6
  Author-email: Marcelo Duarte <marcelotduarte@users.noreply.github.com>
6
7
  License-Expression: PSF-2.0
7
8
  Project-URL: Source, https://github.com/marcelotduarte/python-msilib
9
+ Project-URL: Changelog, https://github.com/marcelotduarte/python-msilib/releases
10
+ Project-URL: Documentation, https://docs.python.org/3.12/library/msilib.html
8
11
  Keywords: msilib
9
12
  Classifier: Development Status :: 5 - Production/Stable
10
13
  Classifier: Intended Audience :: Developers
@@ -26,11 +29,11 @@ Description-Content-Type: text/markdown
26
29
  License-File: LICENSE
27
30
  Provides-Extra: dev
28
31
  Requires-Dist: bump-my-version==1.2.3; extra == "dev"
29
- Requires-Dist: cibuildwheel==3.2.0; extra == "dev"
30
- Requires-Dist: pre-commit==4.3.0; extra == "dev"
32
+ Requires-Dist: cibuildwheel==3.2.1; extra == "dev"
33
+ Requires-Dist: pre-commit==4.4.0; extra == "dev"
31
34
  Provides-Extra: tests
32
- Requires-Dist: coverage==7.10.7; extra == "tests"
33
- Requires-Dist: pytest==8.4.2; extra == "tests"
35
+ Requires-Dist: coverage==7.11.3; extra == "tests"
36
+ Requires-Dist: pytest==9.0.0; extra == "tests"
34
37
  Dynamic: license-file
35
38
 
36
39
  # python-msilib
@@ -38,7 +41,7 @@ Dynamic: license-file
38
41
  Read and write Microsoft Installer files.
39
42
 
40
43
  This library is legacy code borrowed from Python 3.12, intended to allow
41
- cx_Freeze's bdist_msi command to continue working in Python 3.13 and 3.14.
44
+ cx_Freeze's `bdist_msi` command to continue working in Python 3.13 and 3.14.
42
45
 
43
46
  [![PyPI version](https://img.shields.io/pypi/v/python-msilib)](https://pypi.org/project/python-msilib/)
44
47
  [![PyPi Downloads](https://img.shields.io/pypi/dm/python-msilib)](https://pypistats.org/packages/python-msilib)
@@ -3,7 +3,7 @@
3
3
  Read and write Microsoft Installer files.
4
4
 
5
5
  This library is legacy code borrowed from Python 3.12, intended to allow
6
- cx_Freeze's bdist_msi command to continue working in Python 3.13 and 3.14.
6
+ cx_Freeze's `bdist_msi` command to continue working in Python 3.13 and 3.14.
7
7
 
8
8
  [![PyPI version](https://img.shields.io/pypi/v/python-msilib)](https://pypi.org/project/python-msilib/)
9
9
  [![PyPi Downloads](https://img.shields.io/pypi/dm/python-msilib)](https://pypistats.org/packages/python-msilib)
@@ -37,22 +37,24 @@ requires-python = ">=3.13"
37
37
  name = "Marcelo Duarte"
38
38
  email = "marcelotduarte@users.noreply.github.com"
39
39
 
40
+ [[project.authors]]
41
+ name = " Martin v. Löwis"
42
+
40
43
  [project.optional-dependencies]
41
44
  dev = [
42
45
  "bump-my-version==1.2.3",
43
- "cibuildwheel==3.2.0",
44
- "pre-commit==4.3.0", # python_version >= 3.9
46
+ "cibuildwheel==3.2.1",
47
+ "pre-commit==4.4.0",
45
48
  ]
46
49
  tests = [
47
- "coverage==7.10.7",
48
- "pytest==8.4.2",
50
+ "coverage==7.11.3",
51
+ "pytest==9.0.0",
49
52
  ]
50
53
 
51
54
  [project.urls]
52
- #Home = "https://marcelotduarte.github.io/cx_Freeze"
53
- #Changelog = "https://github.com/marcelotduarte/python-msilib/CHANGELOG.md"
54
- #Documentation = "https://cx-freeze.readthedocs.io"
55
55
  Source = "https://github.com/marcelotduarte/python-msilib"
56
+ Changelog = "https://github.com/marcelotduarte/python-msilib/releases"
57
+ Documentation = "https://docs.python.org/3.12/library/msilib.html"
56
58
 
57
59
  [tool.setuptools]
58
60
  include-package-data = true
@@ -65,7 +67,10 @@ version = {attr = "msilib.__version__"}
65
67
  [[tool.setuptools.ext-modules]]
66
68
  name = "msilib._msi"
67
69
  sources = ["src/msilib/_msi.c"]
68
- depends = ["src/msilib/include/_msi.h"]
70
+ depends = [
71
+ "src/msilib/include/_msi.h",
72
+ "src/msilib/include/pythoncapi_compat.h"
73
+ ]
69
74
  libraries = ["msi","rpcrt4", "cabinet"]
70
75
 
71
76
  [tool.setuptools.packages.find]
@@ -74,7 +79,7 @@ where = ["src"]
74
79
 
75
80
  [tool.bumpversion]
76
81
  commit = true
77
- current_version = "0.4.0"
82
+ current_version = "0.4.2"
78
83
  message = "Bump version: {current_version} → {new_version} [ci skip]"
79
84
  parse = """(?x)
80
85
  (?P<major>0|[1-9]\\d*)\\.
@@ -56,7 +56,7 @@ from msilib._msi import (
56
56
  UuidCreate,
57
57
  )
58
58
 
59
- __version__ = "0.4.0"
59
+ __version__ = "0.4.2"
60
60
 
61
61
  __all__ = [
62
62
  "CAB",
@@ -135,6 +135,9 @@ __all__ = [
135
135
  AMD64 = platform.machine() in ("x64", "x86_64", "AMD64")
136
136
  ARM64 = platform.machine() in ("aarch64", "arm64", "ARM64")
137
137
 
138
+ # Keep msilib.Win64 around to preserve backwards compatibility.
139
+ Win64 = AMD64
140
+
138
141
  # Partially taken from Wine
139
142
  datasizemask = 0x00FF
140
143
  type_valid = 0x0100
@@ -292,10 +295,15 @@ def init_database(
292
295
  else:
293
296
  si.SetProperty(PID_TEMPLATE, "Intel;1033")
294
297
  si.SetProperty(PID_REVNUMBER, gen_uuid())
295
- si.SetProperty(
296
- PID_WORDCOUNT, 2
297
- ) # long file names, compressed, original media
298
- si.SetProperty(PID_PAGECOUNT, 200)
298
+ # https://learn.microsoft.com/en-us/windows/win32/msi/word-count-summary
299
+ # 2 = long file names, compressed, original media
300
+ si.SetProperty(PID_WORDCOUNT, 2)
301
+ # https://learn.microsoft.com/en-us/windows/win32/msi/page-count-summary
302
+ # https://learn.microsoft.com/en-us/windows/win32/msi/using-64-bit-windows-installer-packages
303
+ if ARM64:
304
+ si.SetProperty(PID_PAGECOUNT, 500) # minimum of Windows Installer 5.0
305
+ else:
306
+ si.SetProperty(PID_PAGECOUNT, 200) # minimum of Windows Installer 2.0
299
307
  si.SetProperty(PID_APPNAME, "Python MSI Library")
300
308
  # XXX more properties
301
309
  si.Persist()
@@ -433,7 +441,7 @@ class Directory:
433
441
  if component is None:
434
442
  component = self.logical
435
443
  self.component = component
436
- # https://learn.microsoft.com/pt-br/windows/win32/msi/component-table
444
+ # https://learn.microsoft.com/en-us/windows/win32/msi/component-table
437
445
  if AMD64 or ARM64:
438
446
  flags |= 256 # msidbComponentAttributes64bit
439
447
  if keyfile:
@@ -25,9 +25,6 @@ extern "C" {
25
25
  #if PY_VERSION_HEX < 0x030b00B4 && !defined(PYPY_VERSION)
26
26
  # include "frameobject.h" // PyFrameObject, PyFrame_GetBack()
27
27
  #endif
28
- #if PY_VERSION_HEX < 0x030C00A3
29
- # include <structmember.h> // T_SHORT, READONLY
30
- #endif
31
28
 
32
29
 
33
30
  #ifndef _Py_CAST
@@ -1919,33 +1916,33 @@ PyLongWriter_Finish(PyLongWriter *writer)
1919
1916
 
1920
1917
 
1921
1918
  #if PY_VERSION_HEX < 0x030C00A3
1922
- # define Py_T_SHORT T_SHORT
1923
- # define Py_T_INT T_INT
1924
- # define Py_T_LONG T_LONG
1925
- # define Py_T_FLOAT T_FLOAT
1926
- # define Py_T_DOUBLE T_DOUBLE
1927
- # define Py_T_STRING T_STRING
1928
- # define _Py_T_OBJECT T_OBJECT
1929
- # define Py_T_CHAR T_CHAR
1930
- # define Py_T_BYTE T_BYTE
1931
- # define Py_T_UBYTE T_UBYTE
1932
- # define Py_T_USHORT T_USHORT
1933
- # define Py_T_UINT T_UINT
1934
- # define Py_T_ULONG T_ULONG
1935
- # define Py_T_STRING_INPLACE T_STRING_INPLACE
1936
- # define Py_T_BOOL T_BOOL
1937
- # define Py_T_OBJECT_EX T_OBJECT_EX
1938
- # define Py_T_LONGLONG T_LONGLONG
1939
- # define Py_T_ULONGLONG T_ULONGLONG
1940
- # define Py_T_PYSSIZET T_PYSSIZET
1919
+ # define Py_T_SHORT 0
1920
+ # define Py_T_INT 1
1921
+ # define Py_T_LONG 2
1922
+ # define Py_T_FLOAT 3
1923
+ # define Py_T_DOUBLE 4
1924
+ # define Py_T_STRING 5
1925
+ # define _Py_T_OBJECT 6
1926
+ # define Py_T_CHAR 7
1927
+ # define Py_T_BYTE 8
1928
+ # define Py_T_UBYTE 9
1929
+ # define Py_T_USHORT 10
1930
+ # define Py_T_UINT 11
1931
+ # define Py_T_ULONG 12
1932
+ # define Py_T_STRING_INPLACE 13
1933
+ # define Py_T_BOOL 14
1934
+ # define Py_T_OBJECT_EX 16
1935
+ # define Py_T_LONGLONG 17
1936
+ # define Py_T_ULONGLONG 18
1937
+ # define Py_T_PYSSIZET 19
1941
1938
 
1942
1939
  # if PY_VERSION_HEX >= 0x03000000 && !defined(PYPY_VERSION)
1943
- # define _Py_T_NONE T_NONE
1940
+ # define _Py_T_NONE 20
1944
1941
  # endif
1945
1942
 
1946
- # define Py_READONLY READONLY
1947
- # define Py_AUDIT_READ READ_RESTRICTED
1948
- # define _Py_WRITE_RESTRICTED PY_WRITE_RESTRICTED
1943
+ # define Py_READONLY 1
1944
+ # define Py_AUDIT_READ 2
1945
+ # define _Py_WRITE_RESTRICTED 4
1949
1946
  #endif
1950
1947
 
1951
1948
 
@@ -1992,6 +1989,8 @@ static inline int Py_fclose(FILE *file)
1992
1989
 
1993
1990
 
1994
1991
  #if 0x03080000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x030E0000 && !defined(PYPY_VERSION)
1992
+ PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void);
1993
+
1995
1994
  static inline PyObject*
1996
1995
  PyConfig_Get(const char *name)
1997
1996
  {
@@ -2127,8 +2126,6 @@ PyConfig_Get(const char *name)
2127
2126
  return Py_NewRef(value);
2128
2127
  }
2129
2128
 
2130
- PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void);
2131
-
2132
2129
  const PyConfig *config = _Py_GetConfig();
2133
2130
  void *member = (char *)config + spec->offset;
2134
2131
  switch (spec->type) {
@@ -2231,6 +2228,81 @@ static inline int PyUnstable_Object_IsUniquelyReferenced(PyObject *obj)
2231
2228
  }
2232
2229
  #endif
2233
2230
 
2231
+ // gh-128926 added PyUnstable_TryIncRef() and PyUnstable_EnableTryIncRef() to
2232
+ // Python 3.14.0a5. Adapted from _Py_TryIncref() and _PyObject_SetMaybeWeakref().
2233
+ #if PY_VERSION_HEX < 0x030E00A5
2234
+ static inline int PyUnstable_TryIncRef(PyObject *op)
2235
+ {
2236
+ #ifndef Py_GIL_DISABLED
2237
+ if (Py_REFCNT(op) > 0) {
2238
+ Py_INCREF(op);
2239
+ return 1;
2240
+ }
2241
+ return 0;
2242
+ #else
2243
+ // _Py_TryIncrefFast()
2244
+ uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
2245
+ local += 1;
2246
+ if (local == 0) {
2247
+ // immortal
2248
+ return 1;
2249
+ }
2250
+ if (_Py_IsOwnedByCurrentThread(op)) {
2251
+ _Py_INCREF_STAT_INC();
2252
+ _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, local);
2253
+ #ifdef Py_REF_DEBUG
2254
+ _Py_INCREF_IncRefTotal();
2255
+ #endif
2256
+ return 1;
2257
+ }
2258
+
2259
+ // _Py_TryIncRefShared()
2260
+ Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);
2261
+ for (;;) {
2262
+ // If the shared refcount is zero and the object is either merged
2263
+ // or may not have weak references, then we cannot incref it.
2264
+ if (shared == 0 || shared == _Py_REF_MERGED) {
2265
+ return 0;
2266
+ }
2267
+
2268
+ if (_Py_atomic_compare_exchange_ssize(
2269
+ &op->ob_ref_shared,
2270
+ &shared,
2271
+ shared + (1 << _Py_REF_SHARED_SHIFT))) {
2272
+ #ifdef Py_REF_DEBUG
2273
+ _Py_INCREF_IncRefTotal();
2274
+ #endif
2275
+ _Py_INCREF_STAT_INC();
2276
+ return 1;
2277
+ }
2278
+ }
2279
+ #endif
2280
+ }
2281
+
2282
+ static inline void PyUnstable_EnableTryIncRef(PyObject *op)
2283
+ {
2284
+ #ifdef Py_GIL_DISABLED
2285
+ // _PyObject_SetMaybeWeakref()
2286
+ if (_Py_IsImmortal(op)) {
2287
+ return;
2288
+ }
2289
+ for (;;) {
2290
+ Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);
2291
+ if ((shared & _Py_REF_SHARED_FLAG_MASK) != 0) {
2292
+ // Nothing to do if it's in WEAKREFS, QUEUED, or MERGED states.
2293
+ return;
2294
+ }
2295
+ if (_Py_atomic_compare_exchange_ssize(
2296
+ &op->ob_ref_shared, &shared, shared | _Py_REF_MAYBE_WEAKREF)) {
2297
+ return;
2298
+ }
2299
+ }
2300
+ #else
2301
+ (void)op; // unused argument
2302
+ #endif
2303
+ }
2304
+ #endif
2305
+
2234
2306
 
2235
2307
  #if PY_VERSION_HEX < 0x030F0000
2236
2308
  static inline PyObject*
@@ -1,10 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-msilib
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Read and write Microsoft Installer files
5
+ Author: Martin v. Löwis
5
6
  Author-email: Marcelo Duarte <marcelotduarte@users.noreply.github.com>
6
7
  License-Expression: PSF-2.0
7
8
  Project-URL: Source, https://github.com/marcelotduarte/python-msilib
9
+ Project-URL: Changelog, https://github.com/marcelotduarte/python-msilib/releases
10
+ Project-URL: Documentation, https://docs.python.org/3.12/library/msilib.html
8
11
  Keywords: msilib
9
12
  Classifier: Development Status :: 5 - Production/Stable
10
13
  Classifier: Intended Audience :: Developers
@@ -26,11 +29,11 @@ Description-Content-Type: text/markdown
26
29
  License-File: LICENSE
27
30
  Provides-Extra: dev
28
31
  Requires-Dist: bump-my-version==1.2.3; extra == "dev"
29
- Requires-Dist: cibuildwheel==3.2.0; extra == "dev"
30
- Requires-Dist: pre-commit==4.3.0; extra == "dev"
32
+ Requires-Dist: cibuildwheel==3.2.1; extra == "dev"
33
+ Requires-Dist: pre-commit==4.4.0; extra == "dev"
31
34
  Provides-Extra: tests
32
- Requires-Dist: coverage==7.10.7; extra == "tests"
33
- Requires-Dist: pytest==8.4.2; extra == "tests"
35
+ Requires-Dist: coverage==7.11.3; extra == "tests"
36
+ Requires-Dist: pytest==9.0.0; extra == "tests"
34
37
  Dynamic: license-file
35
38
 
36
39
  # python-msilib
@@ -38,7 +41,7 @@ Dynamic: license-file
38
41
  Read and write Microsoft Installer files.
39
42
 
40
43
  This library is legacy code borrowed from Python 3.12, intended to allow
41
- cx_Freeze's bdist_msi command to continue working in Python 3.13 and 3.14.
44
+ cx_Freeze's `bdist_msi` command to continue working in Python 3.13 and 3.14.
42
45
 
43
46
  [![PyPI version](https://img.shields.io/pypi/v/python-msilib)](https://pypi.org/project/python-msilib/)
44
47
  [![PyPi Downloads](https://img.shields.io/pypi/dm/python-msilib)](https://pypistats.org/packages/python-msilib)
@@ -5,6 +5,7 @@ README.md
5
5
  pyproject.toml
6
6
  src/msilib/_msi.c
7
7
  src/msilib/include/_msi.h
8
+ src/msilib/include/pythoncapi_compat.h
8
9
  src/msilib/__init__.py
9
10
  src/msilib/_msi.c
10
11
  src/msilib/schema.py
@@ -0,0 +1,9 @@
1
+
2
+ [dev]
3
+ bump-my-version==1.2.3
4
+ cibuildwheel==3.2.1
5
+ pre-commit==4.4.0
6
+
7
+ [tests]
8
+ coverage==7.11.3
9
+ pytest==9.0.0
@@ -1,4 +0,0 @@
1
- include Makefile
2
- include requirements-dev.txt
3
- recursive-include src *.c *.h
4
- recursive-include tests *.md *.py *.txt
@@ -1,9 +0,0 @@
1
-
2
- [dev]
3
- bump-my-version==1.2.3
4
- cibuildwheel==3.2.0
5
- pre-commit==4.3.0
6
-
7
- [tests]
8
- coverage==7.10.7
9
- pytest==8.4.2
File without changes
File without changes