xmlsec 1.3.17__tar.gz → 1.3.18__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 (108) hide show
  1. {xmlsec-1.3.17 → xmlsec-1.3.18}/.pre-commit-config.yaml +2 -2
  2. {xmlsec-1.3.17 → xmlsec-1.3.18}/.readthedocs.yaml +2 -2
  3. {xmlsec-1.3.17/src/xmlsec.egg-info → xmlsec-1.3.18}/PKG-INFO +60 -26
  4. xmlsec-1.3.17/PKG-INFO → xmlsec-1.3.18/README.md +52 -49
  5. xmlsec-1.3.18/build_libs_xmlsec.py +55 -0
  6. {xmlsec-1.3.17 → xmlsec-1.3.18}/build_support/build_ext.py +17 -6
  7. xmlsec-1.3.17/build_support/static_build.py → xmlsec-1.3.18/build_support/lib_xmlsec_dependency_builder.py +125 -155
  8. xmlsec-1.3.18/build_support/static_build.py +115 -0
  9. xmlsec-1.3.18/libs/README.md +50 -0
  10. {xmlsec-1.3.17 → xmlsec-1.3.18}/pyproject.toml +69 -11
  11. xmlsec-1.3.18/setup.cfg +4 -0
  12. xmlsec-1.3.18/setup.py +15 -0
  13. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/constants.c +7 -0
  14. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/ds.c +41 -0
  15. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/enc.c +11 -0
  16. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/main.c +17 -3
  17. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/template.c +5 -5
  18. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/xmlsec/__init__.pyi +1 -0
  19. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/xmlsec/constants.pyi +6 -0
  20. xmlsec-1.3.17/README.md → xmlsec-1.3.18/src/xmlsec.egg-info/PKG-INFO +83 -0
  21. {xmlsec-1.3.17/src/pyxmlsec.egg-info → xmlsec-1.3.18/src/xmlsec.egg-info}/SOURCES.txt +11 -19
  22. xmlsec-1.3.18/src/xmlsec.egg-info/scm_file_list.json +123 -0
  23. xmlsec-1.3.18/src/xmlsec.egg-info/scm_version.json +8 -0
  24. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/base.py +3 -3
  25. xmlsec-1.3.18/tests/conftest.py +11 -0
  26. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_ds.py +17 -0
  27. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_main.py +2 -0
  28. xmlsec-1.3.18/tests/test_xmlsec.py +16 -0
  29. xmlsec-1.3.17/setup.cfg +0 -18
  30. xmlsec-1.3.17/setup.py +0 -61
  31. xmlsec-1.3.17/src/python_xmlsec1.egg-info/PKG-INFO +0 -258
  32. xmlsec-1.3.17/src/python_xmlsec1.egg-info/SOURCES.txt +0 -103
  33. xmlsec-1.3.17/src/pyxmlsec.egg-info/PKG-INFO +0 -258
  34. xmlsec-1.3.17/src/pyxmlsec.egg-info/dependency_links.txt +0 -1
  35. xmlsec-1.3.17/src/pyxmlsec.egg-info/not-zip-safe +0 -1
  36. xmlsec-1.3.17/src/pyxmlsec.egg-info/requires.txt +0 -1
  37. xmlsec-1.3.17/src/pyxmlsec.egg-info/top_level.txt +0 -1
  38. xmlsec-1.3.17/src/xmlsec.cpython-39-darwin.so +0 -0
  39. xmlsec-1.3.17/src/xmlsec.egg-info/SOURCES.txt +0 -108
  40. xmlsec-1.3.17/src/xmlsec.egg-info/dependency_links.txt +0 -1
  41. xmlsec-1.3.17/src/xmlsec.egg-info/not-zip-safe +0 -1
  42. xmlsec-1.3.17/src/xmlsec.egg-info/requires.txt +0 -1
  43. xmlsec-1.3.17/src/xmlsec.egg-info/top_level.txt +0 -1
  44. xmlsec-1.3.17/tests/conftest.py +0 -10
  45. xmlsec-1.3.17/tests/test_xmlsec.py +0 -13
  46. {xmlsec-1.3.17 → xmlsec-1.3.18}/LICENSE +0 -0
  47. {xmlsec-1.3.17 → xmlsec-1.3.18}/MANIFEST.in +0 -0
  48. {xmlsec-1.3.17 → xmlsec-1.3.18}/build_support/__init__.py +0 -0
  49. {xmlsec-1.3.17 → xmlsec-1.3.18}/build_support/network.py +0 -0
  50. {xmlsec-1.3.17 → xmlsec-1.3.18}/build_support/releases.py +0 -0
  51. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/common.h +0 -0
  52. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/constants.h +0 -0
  53. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/debug.h +0 -0
  54. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/exception.c +0 -0
  55. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/exception.h +0 -0
  56. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/keys.c +0 -0
  57. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/keys.h +0 -0
  58. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/lxml.c +0 -0
  59. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/lxml.h +0 -0
  60. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/platform.h +0 -0
  61. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/tree.c +0 -0
  62. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/utils.c +0 -0
  63. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/utils.h +0 -0
  64. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/xmlsec/py.typed +0 -0
  65. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/xmlsec/template.pyi +0 -0
  66. {xmlsec-1.3.17 → xmlsec-1.3.18}/src/xmlsec/tree.pyi +0 -0
  67. {xmlsec-1.3.17/src/python_xmlsec1.egg-info → xmlsec-1.3.18/src/xmlsec.egg-info}/dependency_links.txt +0 -0
  68. {xmlsec-1.3.17/src/python_xmlsec1.egg-info → xmlsec-1.3.18/src/xmlsec.egg-info}/not-zip-safe +0 -0
  69. {xmlsec-1.3.17/src/python_xmlsec1.egg-info → xmlsec-1.3.18/src/xmlsec.egg-info}/requires.txt +0 -0
  70. {xmlsec-1.3.17/src/python_xmlsec1.egg-info → xmlsec-1.3.18/src/xmlsec.egg-info}/top_level.txt +0 -0
  71. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/__init__.py +0 -0
  72. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/deskey.bin +0 -0
  73. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/doc.xml +0 -0
  74. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/dsacert.der +0 -0
  75. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/dsakey.der +0 -0
  76. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/enc1-in.xml +0 -0
  77. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/enc1-out.xml +0 -0
  78. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/enc2-in.xml +0 -0
  79. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/enc2-out.xml +0 -0
  80. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/enc3-in.xml +0 -0
  81. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/enc3-out.xml +0 -0
  82. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/enc_template.xml +0 -0
  83. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/rsacert.pem +0 -0
  84. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/rsakey.pem +0 -0
  85. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/rsapub.pem +0 -0
  86. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign1-in.xml +0 -0
  87. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign1-out.xml +0 -0
  88. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign2-in.xml +0 -0
  89. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign2-out.xml +0 -0
  90. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign3-in.xml +0 -0
  91. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign3-out.xml +0 -0
  92. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign4-in.xml +0 -0
  93. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign4-out.xml +0 -0
  94. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign5-in.xml +0 -0
  95. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign5-out-xmlsec_1_2_36_to_37.xml +0 -0
  96. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign5-out.xml +0 -0
  97. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign6-in.bin +0 -0
  98. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign6-out.bin +0 -0
  99. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/data/sign_template.xml +0 -0
  100. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/softhsm_setup.py +0 -0
  101. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_constants.py +0 -0
  102. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_doc_examples.py +0 -0
  103. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_enc.py +0 -0
  104. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_keys.py +0 -0
  105. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_pkcs11.py +0 -0
  106. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_templates.py +0 -0
  107. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_tree.py +0 -0
  108. {xmlsec-1.3.17 → xmlsec-1.3.18}/tests/test_type_stubs.py +0 -0
@@ -2,7 +2,7 @@
2
2
  # See https://pre-commit.com/hooks.html for more hooks
3
3
  repos:
4
4
  - repo: https://github.com/astral-sh/ruff-pre-commit
5
- rev: v0.14.4
5
+ rev: v0.17.1
6
6
  hooks:
7
7
  - id: ruff
8
8
  args: ["--fix"]
@@ -28,7 +28,7 @@ repos:
28
28
  args: [--autofix]
29
29
 
30
30
  - repo: https://github.com/pre-commit/mirrors-mypy
31
- rev: v1.18.2
31
+ rev: v2.4.0
32
32
  hooks:
33
33
  - id: mypy
34
34
  exclude: (setup.py|tests|build_support/.*.py|doc/.*)
@@ -1,9 +1,9 @@
1
1
  version: 2
2
2
 
3
3
  build:
4
- os: ubuntu-20.04
4
+ os: ubuntu-24.04
5
5
  tools:
6
- python: '3.9'
6
+ python: '3.14'
7
7
 
8
8
  sphinx:
9
9
  configuration: doc/source/conf.py
@@ -1,51 +1,33 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xmlsec
3
- Version: 1.3.17
3
+ Version: 1.3.18
4
4
  Summary: Python bindings for the XML Security Library
5
- Home-page: https://github.com/mehcode/python-xmlsec
6
- Author: Bulat Gaifullin
7
- Author-email: support@mehcode.com
8
- Maintainer: Oleg Hoefling
9
- Maintainer-email: oleg.hoefling@gmail.com
10
- License: MIT
5
+ Author-email: Bulat Gaifullin <support@mehcode.com>
6
+ Maintainer-email: Oleg Hoefling <oleg.hoefling@gmail.com>, Amin Solhizadeh <amin.solhizadeh@gmail.com>
7
+ License-Expression: MIT
11
8
  Project-URL: Documentation, https://xmlsec.readthedocs.io
12
- Project-URL: Source, https://github.com/mehcode/python-xmlsec
13
- Project-URL: Changelog, https://github.com/mehcode/python-xmlsec/releases
9
+ Project-URL: Source, https://github.com/xmlsec/python-xmlsec
10
+ Project-URL: Changelog, https://github.com/xmlsec/python-xmlsec/releases
14
11
  Keywords: xmlsec
15
12
  Classifier: Development Status :: 5 - Production/Stable
16
13
  Classifier: Intended Audience :: Developers
17
14
  Classifier: Intended Audience :: System Administrators
18
- Classifier: License :: OSI Approved :: MIT License
19
15
  Classifier: Operating System :: OS Independent
20
16
  Classifier: Programming Language :: C
21
17
  Classifier: Programming Language :: Python :: 3
22
- Classifier: Programming Language :: Python :: 3.9
23
18
  Classifier: Programming Language :: Python :: 3.10
24
19
  Classifier: Programming Language :: Python :: 3.11
25
20
  Classifier: Programming Language :: Python :: 3.12
26
21
  Classifier: Programming Language :: Python :: 3.13
27
22
  Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Programming Language :: Python :: 3.15
28
24
  Classifier: Topic :: Text Processing :: Markup :: XML
29
25
  Classifier: Typing :: Typed
30
- Requires-Python: >=3.9
26
+ Requires-Python: >=3.10
31
27
  Description-Content-Type: text/markdown
32
28
  License-File: LICENSE
33
29
  Requires-Dist: lxml>=3.8
34
- Dynamic: author
35
- Dynamic: author-email
36
- Dynamic: classifier
37
- Dynamic: description
38
- Dynamic: description-content-type
39
- Dynamic: home-page
40
- Dynamic: keywords
41
- Dynamic: license
42
30
  Dynamic: license-file
43
- Dynamic: maintainer
44
- Dynamic: maintainer-email
45
- Dynamic: project-url
46
- Dynamic: requires-dist
47
- Dynamic: requires-python
48
- Dynamic: summary
49
31
 
50
32
  # python-xmlsec
51
33
 
@@ -136,6 +118,58 @@ apk add build-base openssl libffi-dev openssl-dev libxslt-dev libxml2-dev xmlsec
136
118
 
137
119
  ## Troubleshooting
138
120
 
121
+ ### `lxml & xmlsec libxml2 library version mismatch`
122
+
123
+ `xmlsec` passes `lxml` XML nodes to the underlying `xmlsec1` library. Both
124
+ libraries use `libxml2`, so they must use compatible `libxml2` versions at
125
+ runtime. If `lxml` is installed from a wheel that bundles one `libxml2`
126
+ version while `xmlsec` is built against another system `libxml2`, importing
127
+ or using `xmlsec` can fail with:
128
+
129
+ ``` text
130
+ xmlsec.InternalError: (-1, 'lxml & xmlsec libxml2 library version mismatch')
131
+ ```
132
+
133
+ The most reliable fixes are:
134
+
135
+ - Use prebuilt wheels for both `lxml` and `xmlsec` when wheels are available
136
+ for your platform:
137
+
138
+ ``` bash
139
+ pip install --only-binary=lxml,xmlsec lxml xmlsec
140
+ ```
141
+
142
+ - If you need to build from source, build both packages against the same
143
+ locally installed `libxml2`:
144
+
145
+ ``` bash
146
+ pip install --no-binary=lxml,xmlsec lxml xmlsec
147
+ ```
148
+
149
+ Do not mix a wheel-built `lxml` with a locally built `xmlsec`, or the other
150
+ way around, unless you know they use the same `libxml2` version.
151
+
152
+ An `lxml` release upgrade does not by itself mean `xmlsec` is incompatible;
153
+ this error is about the `libxml2` libraries loaded in that environment.
154
+
155
+ If the error appears only under uWSGI, uWSGI may have loaded the system
156
+ `libxml2` before Python imports `lxml` or `xmlsec`. In that case, make sure
157
+ uWSGI and the Python packages resolve to the same `libxml2`, or rebuild the
158
+ Python packages from source in that environment. If you use `uv`, clear any
159
+ cached mixed builds before reinstalling. For example, to reinstall from
160
+ wheels:
161
+
162
+ ``` bash
163
+ uv pip uninstall lxml xmlsec
164
+ uv cache clean
165
+ uv pip install --only-binary lxml --only-binary xmlsec lxml xmlsec
166
+ ```
167
+
168
+ For background, see
169
+ [issue #356](https://github.com/xmlsec/python-xmlsec/issues/356) and the
170
+ uWSGI edge case in
171
+ [issue #415](https://github.com/xmlsec/python-xmlsec/issues/415).
172
+
139
173
  ### Mac
140
174
 
141
175
  If you get any fatal errors about missing `.h` files, update your
@@ -1,52 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: xmlsec
3
- Version: 1.3.17
4
- Summary: Python bindings for the XML Security Library
5
- Home-page: https://github.com/mehcode/python-xmlsec
6
- Author: Bulat Gaifullin
7
- Author-email: support@mehcode.com
8
- Maintainer: Oleg Hoefling
9
- Maintainer-email: oleg.hoefling@gmail.com
10
- License: MIT
11
- Project-URL: Documentation, https://xmlsec.readthedocs.io
12
- Project-URL: Source, https://github.com/mehcode/python-xmlsec
13
- Project-URL: Changelog, https://github.com/mehcode/python-xmlsec/releases
14
- Keywords: xmlsec
15
- Classifier: Development Status :: 5 - Production/Stable
16
- Classifier: Intended Audience :: Developers
17
- Classifier: Intended Audience :: System Administrators
18
- Classifier: License :: OSI Approved :: MIT License
19
- Classifier: Operating System :: OS Independent
20
- Classifier: Programming Language :: C
21
- Classifier: Programming Language :: Python :: 3
22
- Classifier: Programming Language :: Python :: 3.9
23
- Classifier: Programming Language :: Python :: 3.10
24
- Classifier: Programming Language :: Python :: 3.11
25
- Classifier: Programming Language :: Python :: 3.12
26
- Classifier: Programming Language :: Python :: 3.13
27
- Classifier: Programming Language :: Python :: 3.14
28
- Classifier: Topic :: Text Processing :: Markup :: XML
29
- Classifier: Typing :: Typed
30
- Requires-Python: >=3.9
31
- Description-Content-Type: text/markdown
32
- License-File: LICENSE
33
- Requires-Dist: lxml>=3.8
34
- Dynamic: author
35
- Dynamic: author-email
36
- Dynamic: classifier
37
- Dynamic: description
38
- Dynamic: description-content-type
39
- Dynamic: home-page
40
- Dynamic: keywords
41
- Dynamic: license
42
- Dynamic: license-file
43
- Dynamic: maintainer
44
- Dynamic: maintainer-email
45
- Dynamic: project-url
46
- Dynamic: requires-dist
47
- Dynamic: requires-python
48
- Dynamic: summary
49
-
50
1
  # python-xmlsec
51
2
 
52
3
  [![image](https://img.shields.io/pypi/v/xmlsec.svg?logo=python&logoColor=white)](https://pypi.python.org/pypi/xmlsec)
@@ -136,6 +87,58 @@ apk add build-base openssl libffi-dev openssl-dev libxslt-dev libxml2-dev xmlsec
136
87
 
137
88
  ## Troubleshooting
138
89
 
90
+ ### `lxml & xmlsec libxml2 library version mismatch`
91
+
92
+ `xmlsec` passes `lxml` XML nodes to the underlying `xmlsec1` library. Both
93
+ libraries use `libxml2`, so they must use compatible `libxml2` versions at
94
+ runtime. If `lxml` is installed from a wheel that bundles one `libxml2`
95
+ version while `xmlsec` is built against another system `libxml2`, importing
96
+ or using `xmlsec` can fail with:
97
+
98
+ ``` text
99
+ xmlsec.InternalError: (-1, 'lxml & xmlsec libxml2 library version mismatch')
100
+ ```
101
+
102
+ The most reliable fixes are:
103
+
104
+ - Use prebuilt wheels for both `lxml` and `xmlsec` when wheels are available
105
+ for your platform:
106
+
107
+ ``` bash
108
+ pip install --only-binary=lxml,xmlsec lxml xmlsec
109
+ ```
110
+
111
+ - If you need to build from source, build both packages against the same
112
+ locally installed `libxml2`:
113
+
114
+ ``` bash
115
+ pip install --no-binary=lxml,xmlsec lxml xmlsec
116
+ ```
117
+
118
+ Do not mix a wheel-built `lxml` with a locally built `xmlsec`, or the other
119
+ way around, unless you know they use the same `libxml2` version.
120
+
121
+ An `lxml` release upgrade does not by itself mean `xmlsec` is incompatible;
122
+ this error is about the `libxml2` libraries loaded in that environment.
123
+
124
+ If the error appears only under uWSGI, uWSGI may have loaded the system
125
+ `libxml2` before Python imports `lxml` or `xmlsec`. In that case, make sure
126
+ uWSGI and the Python packages resolve to the same `libxml2`, or rebuild the
127
+ Python packages from source in that environment. If you use `uv`, clear any
128
+ cached mixed builds before reinstalling. For example, to reinstall from
129
+ wheels:
130
+
131
+ ``` bash
132
+ uv pip uninstall lxml xmlsec
133
+ uv cache clean
134
+ uv pip install --only-binary lxml --only-binary xmlsec lxml xmlsec
135
+ ```
136
+
137
+ For background, see
138
+ [issue #356](https://github.com/xmlsec/python-xmlsec/issues/356) and the
139
+ uWSGI edge case in
140
+ [issue #415](https://github.com/xmlsec/python-xmlsec/issues/415).
141
+
139
142
  ### Mac
140
143
 
141
144
  If you get any fatal errors about missing `.h` files, update your
@@ -0,0 +1,55 @@
1
+ import argparse
2
+ import os
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ from build_support.lib_xmlsec_dependency_builder import LibXmlsecDependencyBuilder
7
+
8
+
9
+ def _console_info(message):
10
+ print(message)
11
+
12
+
13
+ def main(argv=None):
14
+ parser = argparse.ArgumentParser(description='Download and build static dependency libraries for python-xmlsec.')
15
+ parser.add_argument(
16
+ '--platform',
17
+ default=sys.platform,
18
+ help='Target platform (default: current interpreter platform).',
19
+ )
20
+ parser.add_argument(
21
+ '--plat-name',
22
+ default=os.environ.get('PYXMLSEC_PLAT_NAME'),
23
+ help='Target platform tag for cross-compiling (for example macosx-11.0-arm64).',
24
+ )
25
+ parser.add_argument(
26
+ '--libs-dir',
27
+ default=os.environ.get('PYXMLSEC_LIBS_DIR', 'libs'),
28
+ help='Directory where source/binary archives are stored.',
29
+ )
30
+ parser.add_argument(
31
+ '--buildroot',
32
+ default=Path('build', 'tmp'),
33
+ type=Path,
34
+ help='Build root for extracted/build artifacts.',
35
+ )
36
+ parser.add_argument(
37
+ '--download-only',
38
+ action='store_true',
39
+ help='Only download dependency archives; do not extract/build.',
40
+ )
41
+
42
+ args = parser.parse_args(argv)
43
+ builder = LibXmlsecDependencyBuilder(
44
+ platform_name=args.platform,
45
+ info=_console_info,
46
+ libs_dir=Path(args.libs_dir),
47
+ buildroot=args.buildroot,
48
+ plat_name=args.plat_name,
49
+ )
50
+ builder.prepare(download_only=args.download_only)
51
+ return 0
52
+
53
+
54
+ if __name__ == '__main__':
55
+ raise SystemExit(main())
@@ -8,16 +8,27 @@ from setuptools.command.build_ext import build_ext as build_ext_orig
8
8
  from .static_build import CrossCompileInfo, StaticBuildHelper
9
9
 
10
10
 
11
+ def _env_flag(name: str, default: bool) -> bool:
12
+ value = os.environ.get(name)
13
+ if value is None:
14
+ return default
15
+
16
+ return value.strip().lower() not in {'', '0', 'false', 'no', 'off'}
17
+
18
+
11
19
  class build_ext(build_ext_orig):
12
- def info(self, message):
20
+ def __init__(self, *args, **kwargs) -> None:
21
+ super().__init__(*args, **kwargs)
22
+
23
+ self.debug = _env_flag('PYXMLSEC_ENABLE_DEBUG', False)
24
+ self.static = _env_flag('PYXMLSEC_STATIC_DEPS', False)
25
+ self.size_opt = _env_flag('PYXMLSEC_OPTIMIZE_SIZE', True)
26
+
27
+ def info(self, message) -> None:
13
28
  self.announce(message, level=log.INFO)
14
29
 
15
- def run(self):
30
+ def run(self) -> None:
16
31
  ext = self.ext_map['xmlsec']
17
- self.debug = os.environ.get('PYXMLSEC_ENABLE_DEBUG', False)
18
- self.static = os.environ.get('PYXMLSEC_STATIC_DEPS', False)
19
- self.size_opt = os.environ.get('PYXMLSEC_OPTIMIZE_SIZE', True)
20
-
21
32
  if self.static or sys.platform == 'win32':
22
33
  helper = StaticBuildHelper(self)
23
34
  helper.prepare(sys.platform)