pybase64 1.4.0__tar.gz → 1.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 (109) hide show
  1. {pybase64-1.4.0/src/pybase64.egg-info → pybase64-1.4.2}/PKG-INFO +28 -2
  2. {pybase64-1.4.0 → pybase64-1.4.2}/README.rst +14 -0
  3. {pybase64-1.4.0 → pybase64-1.4.2}/base64/.github/workflows/test.yml +35 -23
  4. {pybase64-1.4.0 → pybase64-1.4.2}/base64/cmake/test-arch.c +2 -1
  5. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon64/codec.c +4 -10
  6. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon64/dec_loop.c +7 -7
  7. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/codec_choose.c +13 -4
  8. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/benchmark.c +6 -4
  9. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/ci/analysis.sh +2 -1
  10. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/ci/test.sh +4 -6
  11. pybase64-1.4.2/base64/test/codec_supported.c +40 -0
  12. pybase64-1.4.2/base64/test/codec_supported.h +3 -0
  13. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/test_base64.c +5 -7
  14. {pybase64-1.4.0 → pybase64-1.4.2}/pyproject.toml +14 -4
  15. {pybase64-1.4.0 → pybase64-1.4.2}/setup.py +17 -4
  16. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/__main__.py +34 -41
  17. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_version.py +1 -1
  18. {pybase64-1.4.0 → pybase64-1.4.2/src/pybase64.egg-info}/PKG-INFO +28 -2
  19. {pybase64-1.4.0 → pybase64-1.4.2}/tests/test_benchmark.py +2 -1
  20. {pybase64-1.4.0 → pybase64-1.4.2}/tests/test_main.py +8 -4
  21. {pybase64-1.4.0 → pybase64-1.4.2}/tests/test_pybase64.py +11 -7
  22. pybase64-1.4.0/base64/test/codec_supported.c +0 -29
  23. pybase64-1.4.0/base64/test/codec_supported.h +0 -3
  24. {pybase64-1.4.0 → pybase64-1.4.2}/LICENSE +0 -0
  25. {pybase64-1.4.0 → pybase64-1.4.2}/MANIFEST.in +0 -0
  26. {pybase64-1.4.0 → pybase64-1.4.2}/base64/CMakeLists.txt +0 -0
  27. {pybase64-1.4.0 → pybase64-1.4.2}/base64/LICENSE +0 -0
  28. {pybase64-1.4.0 → pybase64-1.4.2}/base64/Makefile +0 -0
  29. {pybase64-1.4.0 → pybase64-1.4.2}/base64/README.md +0 -0
  30. {pybase64-1.4.0 → pybase64-1.4.2}/base64/base64-benchmarks.png +0 -0
  31. {pybase64-1.4.0 → pybase64-1.4.2}/base64/bin/base64.c +0 -0
  32. {pybase64-1.4.0 → pybase64-1.4.2}/base64/bin/base64.manifest +0 -0
  33. {pybase64-1.4.0 → pybase64-1.4.2}/base64/bin/base64.rc +0 -0
  34. {pybase64-1.4.0 → pybase64-1.4.2}/base64/cmake/Modules/TargetArch.cmake +0 -0
  35. {pybase64-1.4.0 → pybase64-1.4.2}/base64/cmake/Modules/TargetSIMDInstructionSet.cmake +0 -0
  36. {pybase64-1.4.0 → pybase64-1.4.2}/base64/cmake/base64-config.cmake.in +0 -0
  37. {pybase64-1.4.0 → pybase64-1.4.2}/base64/cmake/config.h.in +0 -0
  38. {pybase64-1.4.0 → pybase64-1.4.2}/base64/include/libbase64.h +0 -0
  39. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx/codec.c +0 -0
  40. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx/enc_loop_asm.c +0 -0
  41. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx2/codec.c +0 -0
  42. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx2/dec_loop.c +0 -0
  43. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx2/dec_reshuffle.c +0 -0
  44. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx2/enc_loop.c +0 -0
  45. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx2/enc_loop_asm.c +0 -0
  46. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx2/enc_reshuffle.c +0 -0
  47. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx2/enc_translate.c +0 -0
  48. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx512/codec.c +0 -0
  49. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx512/enc_loop.c +0 -0
  50. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/avx512/enc_reshuffle_translate.c +0 -0
  51. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/32/dec_loop.c +0 -0
  52. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/32/enc_loop.c +0 -0
  53. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/64/enc_loop.c +0 -0
  54. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/codec.c +0 -0
  55. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/dec_head.c +0 -0
  56. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/dec_tail.c +0 -0
  57. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/enc_head.c +0 -0
  58. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/generic/enc_tail.c +0 -0
  59. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon32/codec.c +0 -0
  60. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon32/dec_loop.c +0 -0
  61. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon32/enc_loop.c +0 -0
  62. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon32/enc_reshuffle.c +0 -0
  63. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon32/enc_translate.c +0 -0
  64. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon64/enc_loop.c +0 -0
  65. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon64/enc_loop_asm.c +0 -0
  66. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/neon64/enc_reshuffle.c +0 -0
  67. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/sse41/codec.c +0 -0
  68. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/sse42/codec.c +0 -0
  69. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/ssse3/codec.c +0 -0
  70. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/ssse3/dec_loop.c +0 -0
  71. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/ssse3/dec_reshuffle.c +0 -0
  72. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/ssse3/enc_loop.c +0 -0
  73. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/ssse3/enc_loop_asm.c +0 -0
  74. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/ssse3/enc_reshuffle.c +0 -0
  75. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/arch/ssse3/enc_translate.c +0 -0
  76. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/codecs.h +0 -0
  77. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/env.h +0 -0
  78. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/exports.txt +0 -0
  79. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/lib.c +0 -0
  80. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/lib_openmp.c +0 -0
  81. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/tables/Makefile +0 -0
  82. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/tables/table_dec_32bit.h +0 -0
  83. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/tables/table_enc_12bit.h +0 -0
  84. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/tables/table_enc_12bit.py +0 -0
  85. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/tables/table_generator.c +0 -0
  86. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/tables/tables.c +0 -0
  87. {pybase64-1.4.0 → pybase64-1.4.2}/base64/lib/tables/tables.h +0 -0
  88. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/CMakeLists.txt +0 -0
  89. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/Makefile +0 -0
  90. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/ci/checksums.txt +0 -0
  91. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/ci//360/237/230/265/342/200/215/360/237/222/253.bin +0 -0
  92. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/moby_dick.h +0 -0
  93. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/moby_dick_base64.txt +0 -0
  94. {pybase64-1.4.0 → pybase64-1.4.2}/base64/test/moby_dick_plain.txt +0 -0
  95. {pybase64-1.4.0 → pybase64-1.4.2}/setup.cfg +0 -0
  96. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/__init__.py +2 -2
  97. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_fallback.py +0 -0
  98. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_license.py +0 -0
  99. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_license.pyi +0 -0
  100. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_pybase64.c +0 -0
  101. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_pybase64.pyi +0 -0
  102. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_pybase64_get_simd_flags.c +0 -0
  103. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_pybase64_get_simd_flags.h +0 -0
  104. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/_typing.py +0 -0
  105. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64/py.typed +0 -0
  106. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64.egg-info/SOURCES.txt +0 -0
  107. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64.egg-info/dependency_links.txt +0 -0
  108. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64.egg-info/entry_points.txt +0 -0
  109. {pybase64-1.4.0 → pybase64-1.4.2}/src/pybase64.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pybase64
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Fast Base64 encoding/decoding
5
5
  Home-page: https://github.com/mayeut/pybase64
6
6
  Author: Matthieu Darbois
@@ -22,9 +22,21 @@ Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
24
  Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
25
26
  Requires-Python: >=3.8
26
27
  Description-Content-Type: text/x-rst
27
28
  License-File: LICENSE
29
+ Dynamic: author
30
+ Dynamic: classifier
31
+ Dynamic: description
32
+ Dynamic: description-content-type
33
+ Dynamic: home-page
34
+ Dynamic: keywords
35
+ Dynamic: license
36
+ Dynamic: license-file
37
+ Dynamic: project-url
38
+ Dynamic: requires-python
39
+ Dynamic: summary
28
40
 
29
41
  .. SETUP VARIABLES
30
42
  .. |license-status| image:: https://img.shields.io/badge/license-BSD%202--Clause-blue.svg
@@ -149,6 +161,20 @@ Running Python 3.7.2, Apple LLVM version 10.0.0 (clang-1000.11.45.5), Mac OS X 1
149
161
 
150
162
  Changelog
151
163
  =========
164
+ 1.4.2
165
+ -----
166
+ - Update base64 library (Windows ARM64 Neon support)
167
+ - Publish Python 3.14 wheels
168
+ - Publish Linux riscv64 wheels
169
+ - Publish Android wheels
170
+ - Publish iOS wheels
171
+ - Publish GraalPy wheels
172
+
173
+ 1.4.1
174
+ -----
175
+ - Publish PyPy 3.11 wheels
176
+ - Publish armv7l wheels
177
+
152
178
  1.4.0
153
179
  -----
154
180
  - Publish python 3.13 wheels
@@ -121,6 +121,20 @@ Running Python 3.7.2, Apple LLVM version 10.0.0 (clang-1000.11.45.5), Mac OS X 1
121
121
 
122
122
  Changelog
123
123
  =========
124
+ 1.4.2
125
+ -----
126
+ - Update base64 library (Windows ARM64 Neon support)
127
+ - Publish Python 3.14 wheels
128
+ - Publish Linux riscv64 wheels
129
+ - Publish Android wheels
130
+ - Publish iOS wheels
131
+ - Publish GraalPy wheels
132
+
133
+ 1.4.1
134
+ -----
135
+ - Publish PyPy 3.11 wheels
136
+ - Publish armv7l wheels
137
+
124
138
  1.4.0
125
139
  -----
126
140
  - Publish python 3.13 wheels
@@ -5,10 +5,10 @@ on: [push, pull_request]
5
5
  jobs:
6
6
  makefile-analysis:
7
7
  name: makefile-analysis
8
- runs-on: ubuntu-22.04
8
+ runs-on: ubuntu-24.04
9
9
  steps:
10
10
  - name: Checkout
11
- uses: actions/checkout@v3
11
+ uses: actions/checkout@v4
12
12
  - name: "Install analysis tools"
13
13
  run: |
14
14
  sudo apt-get update
@@ -23,11 +23,11 @@ jobs:
23
23
  strategy:
24
24
  fail-fast: false
25
25
  matrix:
26
- runner: ["ubuntu-20.04"]
26
+ runner: ["ubuntu-22.04"]
27
27
  compiler: ["gcc", "clang"]
28
28
  openmp: ["0", "1"]
29
29
  include:
30
- - runner: "macos-11"
30
+ - runner: "macos-13"
31
31
  compiler: "clang"
32
32
  openmp: "0"
33
33
  env:
@@ -37,7 +37,12 @@ jobs:
37
37
  OBJCOPY: ${{ (startsWith(matrix.runner, 'macos') && 'echo') || 'objcopy' }}
38
38
  steps:
39
39
  - name: Checkout
40
- uses: actions/checkout@v3
40
+ uses: actions/checkout@v4
41
+ - name: Install Ubuntu libomp support
42
+ if: runner.os == 'Linux' && matrix.compiler == 'clang' && matrix.openmp == 1
43
+ run: |
44
+ sudo apt-get update
45
+ sudo apt-get install -y libomp-dev
41
46
  - name: Run tests
42
47
  run: ./test/ci/test.sh
43
48
 
@@ -48,14 +53,20 @@ jobs:
48
53
  strategy:
49
54
  fail-fast: false
50
55
  matrix:
51
- runner: ["ubuntu-20.04", "macos-11", "windows-2019"]
56
+ runner: ["ubuntu-22.04", "windows-2019"]
52
57
  platform: ["x86_64", "i686"]
53
- exclude:
54
- - runner: "macos-11"
55
- platform: "i686"
58
+ include:
59
+ - runner: "macos-13"
60
+ platform: "x86_64"
61
+ - runner: "macos-14"
62
+ platform: "arm64"
63
+ - runner: "ubuntu-22.04-arm"
64
+ platform: "aarch64"
65
+ - runner: "windows-11-arm"
66
+ platform: "ARM64"
56
67
  steps:
57
68
  - name: Checkout
58
- uses: actions/checkout@v3
69
+ uses: actions/checkout@v4
59
70
  - name: Install Ubuntu i686 support
60
71
  if: runner.os == 'Linux' && matrix.platform == 'i686'
61
72
  run: |
@@ -70,13 +81,13 @@ jobs:
70
81
  -Werror=dev
71
82
  -DBASE64_BUILD_TESTS=ON
72
83
  ${{ runner.os != 'Windows' && '-DCMAKE_BUILD_TYPE=Release' || '' }}
73
- ${{ runner.os == 'macOS' && '-DBASE64_WITH_AVX2=OFF' || '' }}
74
84
  ${{ runner.os == 'Windows' && matrix.platform == 'i686' && '-A Win32' || '' }}
75
- -DBASE64_WITH_AVX512=OFF
76
85
  - name: CMake Build
77
86
  run: cmake --build out --config Release --verbose
78
87
  - name: CTest
79
88
  run: ctest --no-tests=error --test-dir out -VV --build-config Release
89
+ env:
90
+ BASE64_TEST_SKIP_AVX512: "1"
80
91
 
81
92
  alpine-makefile-test:
82
93
  name: makefile-alpine-amd64-gcc
@@ -90,7 +101,7 @@ jobs:
90
101
  - name: Install deps
91
102
  run: apk add --update bash build-base git
92
103
  - name: Checkout
93
- uses: actions/checkout@v3
104
+ uses: actions/checkout@v4
94
105
  - name: Run tests
95
106
  run: ./test/ci/test.sh
96
107
 
@@ -104,20 +115,21 @@ jobs:
104
115
  - name: Install deps
105
116
  run: apk add --update bash build-base cmake git
106
117
  - name: Checkout
107
- uses: actions/checkout@v3
118
+ uses: actions/checkout@v4
108
119
  - name: CMake Configure
109
120
  run: >
110
121
  cmake
111
122
  -B out
112
123
  -Werror=dev
113
124
  -DBASE64_BUILD_TESTS=ON
114
- -DBASE64_WITH_AVX512=OFF
115
125
  -DCMAKE_BUILD_TYPE=Release
116
126
  - name: CMake Build
117
127
  run: cmake --build out --config Release --verbose
118
128
  - name: CTest
119
129
  run: ctest --no-tests=error -VV --build-config Release
120
130
  working-directory: ./out
131
+ env:
132
+ BASE64_TEST_SKIP_AVX512: "1"
121
133
 
122
134
  alpine-alt-arch-makefile-test:
123
135
  name: makefile-alpine-${{matrix.arch}}-${{matrix.cc}}
@@ -130,8 +142,8 @@ jobs:
130
142
  cc: [gcc, clang]
131
143
  steps:
132
144
  - name: Checkout
133
- uses: actions/checkout@v3
134
- - uses: uraimo/run-on-arch-action@v2
145
+ uses: actions/checkout@v4
146
+ - uses: uraimo/run-on-arch-action@v3
135
147
  with:
136
148
  arch: ${{matrix.arch}}
137
149
  distro: alpine_latest
@@ -151,8 +163,8 @@ jobs:
151
163
  cc: [gcc, clang]
152
164
  steps:
153
165
  - name: Checkout
154
- uses: actions/checkout@v3
155
- - uses: uraimo/run-on-arch-action@v2
166
+ uses: actions/checkout@v4
167
+ - uses: uraimo/run-on-arch-action@v3
156
168
  with:
157
169
  arch: ${{matrix.arch}}
158
170
  distro: alpine_latest
@@ -182,12 +194,11 @@ jobs:
182
194
  - { msystem: mingw32, env: mingw-w64-i686- }
183
195
  - { msystem: mingw64, env: mingw-w64-x86_64- }
184
196
  - { msystem: ucrt64, env: mingw-w64-ucrt-x86_64- }
185
- - { msystem: clang32, env: mingw-w64-clang-i686- }
186
197
  - { msystem: clang64, env: mingw-w64-clang-x86_64- }
187
198
 
188
199
  steps:
189
200
  - name: Checkout
190
- uses: actions/checkout@v3
201
+ uses: actions/checkout@v4
191
202
  - name: Setup MSYS2 ${{matrix.msystem}}
192
203
  uses: msys2/setup-msys2@v2
193
204
  with:
@@ -205,13 +216,14 @@ jobs:
205
216
  -Werror=dev
206
217
  -DBASE64_BUILD_TESTS=ON
207
218
  -DCMAKE_BUILD_TYPE=Release
208
- -DBASE64_WITH_AVX512=OFF
209
219
  - name: CMake Build
210
220
  shell: msys2 {0}
211
221
  run: cmake --build out --config Release --verbose
212
222
  - name: CTest
213
223
  shell: msys2 {0}
214
224
  run: ctest --no-tests=error --test-dir out -VV --build-config Release
225
+ env:
226
+ BASE64_TEST_SKIP_AVX512: "1"
215
227
  - name: Test demo utility with unicode filenames and file contents on Windows
216
228
  shell: msys2 {0}
217
229
  run: |
@@ -238,7 +250,7 @@ jobs:
238
250
  CC: cc.exe
239
251
  steps:
240
252
  - name: Checkout
241
- uses: actions/checkout@v3
253
+ uses: actions/checkout@v4
242
254
  - name: Setup MSYS2 ${{matrix.msystem}}
243
255
  uses: msys2/setup-msys2@v2
244
256
  with:
@@ -12,7 +12,8 @@
12
12
  ////////////////////////////////////////////////////////////////////////////////
13
13
 
14
14
  // ARM 64-Bit
15
- #if defined(__aarch64__)
15
+ #if defined(__aarch64__) \
16
+ || defined(_M_ARM64)
16
17
  #error ##arch=arm64##
17
18
 
18
19
  // ARM 32-Bit
@@ -8,13 +8,7 @@
8
8
  #include "config.h"
9
9
  #include "../../env.h"
10
10
 
11
- #ifdef __aarch64__
12
- # if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && HAVE_NEON64
13
- # define BASE64_USE_NEON64
14
- # endif
15
- #endif
16
-
17
- #ifdef BASE64_USE_NEON64
11
+ #if HAVE_NEON64
18
12
  #include <arm_neon.h>
19
13
 
20
14
  // Only enable inline assembly on supported compilers.
@@ -66,7 +60,7 @@ load_64byte_table (const uint8_t *p)
66
60
  # include "enc_loop.c"
67
61
  #endif
68
62
 
69
- #endif // BASE64_USE_NEON64
63
+ #endif // HAVE_NEON64
70
64
 
71
65
  // Stride size is so large on these NEON 64-bit functions
72
66
  // (48 bytes encode, 64 bytes decode) that we inline the
@@ -75,7 +69,7 @@ load_64byte_table (const uint8_t *p)
75
69
  void
76
70
  base64_stream_encode_neon64 BASE64_ENC_PARAMS
77
71
  {
78
- #ifdef BASE64_USE_NEON64
72
+ #if HAVE_NEON64
79
73
  #include "../generic/enc_head.c"
80
74
  enc_loop_neon64(&s, &slen, &o, &olen);
81
75
  enc_loop_generic_64(&s, &slen, &o, &olen);
@@ -88,7 +82,7 @@ base64_stream_encode_neon64 BASE64_ENC_PARAMS
88
82
  int
89
83
  base64_stream_decode_neon64 BASE64_DEC_PARAMS
90
84
  {
91
- #ifdef BASE64_USE_NEON64
85
+ #if HAVE_NEON64
92
86
  #include "../generic/dec_head.c"
93
87
  dec_loop_neon64(&s, &slen, &o, &olen);
94
88
  dec_loop_generic_32(&s, &slen, &o, &olen);
@@ -100,10 +100,10 @@ dec_loop_neon64 (const uint8_t **s, size_t *slen, uint8_t **o, size_t *olen)
100
100
 
101
101
  // Check for invalid input, any value larger than 63:
102
102
  const uint8x16_t classified
103
- = vcgtq_u8(str.val[0], vdupq_n_u8(63))
104
- | vcgtq_u8(str.val[1], vdupq_n_u8(63))
105
- | vcgtq_u8(str.val[2], vdupq_n_u8(63))
106
- | vcgtq_u8(str.val[3], vdupq_n_u8(63));
103
+ = vorrq_u8(
104
+ vorrq_u8(vcgtq_u8(str.val[0], vdupq_n_u8(63)), vcgtq_u8(str.val[1], vdupq_n_u8(63))),
105
+ vorrq_u8(vcgtq_u8(str.val[2], vdupq_n_u8(63)), vcgtq_u8(str.val[3], vdupq_n_u8(63)))
106
+ );
107
107
 
108
108
  // Check that all bits are zero:
109
109
  if (vmaxvq_u8(classified) != 0U) {
@@ -111,9 +111,9 @@ dec_loop_neon64 (const uint8_t **s, size_t *slen, uint8_t **o, size_t *olen)
111
111
  }
112
112
 
113
113
  // Compress four bytes into three:
114
- dec.val[0] = vshlq_n_u8(str.val[0], 2) | vshrq_n_u8(str.val[1], 4);
115
- dec.val[1] = vshlq_n_u8(str.val[1], 4) | vshrq_n_u8(str.val[2], 2);
116
- dec.val[2] = vshlq_n_u8(str.val[2], 6) | str.val[3];
114
+ dec.val[0] = vorrq_u8(vshlq_n_u8(str.val[0], 2), vshrq_n_u8(str.val[1], 4));
115
+ dec.val[1] = vorrq_u8(vshlq_n_u8(str.val[1], 4), vshrq_n_u8(str.val[2], 2));
116
+ dec.val[2] = vorrq_u8(vshlq_n_u8(str.val[2], 6), str.val[3]);
117
117
 
118
118
  // Interleave and store decoded result:
119
119
  vst3q_u8((uint8_t *) *o, dec);
@@ -74,7 +74,16 @@
74
74
  #define _XCR_XFEATURE_ENABLED_MASK 0
75
75
  #endif
76
76
 
77
- #define _XCR_XMM_AND_YMM_STATE_ENABLED_BY_OS 0x6
77
+ #define bit_XMM (1 << 1)
78
+ #define bit_YMM (1 << 2)
79
+ #define bit_OPMASK (1 << 5)
80
+ #define bit_ZMM (1 << 6)
81
+ #define bit_HIGH_ZMM (1 << 7)
82
+
83
+ #define _XCR_XMM_AND_YMM_STATE_ENABLED_BY_OS (bit_XMM | bit_YMM)
84
+
85
+ #define _AVX_512_ENABLED_BY_OS (bit_XMM | bit_YMM | bit_OPMASK | bit_ZMM | bit_HIGH_ZMM)
86
+
78
87
  #endif
79
88
 
80
89
  // Function declarations:
@@ -154,13 +163,13 @@ codec_choose_forced (struct codec *codec, int flags)
154
163
  static bool
155
164
  codec_choose_arm (struct codec *codec)
156
165
  {
157
- #if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && ((defined(__aarch64__) && HAVE_NEON64) || HAVE_NEON32)
166
+ #if HAVE_NEON64 || ((defined(__ARM_NEON__) || defined(__ARM_NEON)) && HAVE_NEON32)
158
167
 
159
168
  // Unfortunately there is no portable way to check for NEON
160
169
  // support at runtime from userland in the same way that x86
161
170
  // has cpuid, so just stick to the compile-time configuration:
162
171
 
163
- #if defined(__aarch64__) && HAVE_NEON64
172
+ #if HAVE_NEON64
164
173
  codec->enc = base64_stream_encode_neon64;
165
174
  codec->dec = base64_stream_decode_neon64;
166
175
  #else
@@ -210,7 +219,7 @@ codec_choose_x86 (struct codec *codec)
210
219
  xcr_mask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
211
220
  if ((xcr_mask & _XCR_XMM_AND_YMM_STATE_ENABLED_BY_OS) == _XCR_XMM_AND_YMM_STATE_ENABLED_BY_OS) { // check multiple bits at once
212
221
  #if HAVE_AVX512
213
- if (max_level >= 7) {
222
+ if (max_level >= 7 && ((xcr_mask & _AVX_512_ENABLED_BY_OS) == _AVX_512_ENABLED_BY_OS)) {
214
223
  __cpuid_count(7, 0, eax, ebx, ecx, edx);
215
224
  if ((ebx & bit_AVX512vl) && (ecx & bit_AVX512vbmi)) {
216
225
  codec->enc = base64_stream_encode_avx512;
@@ -271,10 +271,12 @@ main ()
271
271
  sizes[i].label, sizes[i].repeat, sizes[i].batch);
272
272
 
273
273
  // Loop over all codecs:
274
- for (size_t j = 0; codecs[j]; j++)
275
- if (codec_supported(1 << j))
276
- codec_bench(&b, &sizes[i], codecs[j], 1 << j);
277
- };
274
+ for (size_t j = 0; codecs[j]; j++) {
275
+ int flags = codec_supported(j);
276
+ if (flags)
277
+ codec_bench(&b, &sizes[i], codecs[j], flags);
278
+ }
279
+ }
278
280
 
279
281
  // Free memory:
280
282
  err2: free(b.enc);
@@ -15,8 +15,9 @@ for USE_ASSEMBLY in 0 1; do
15
15
  export SSE42_CFLAGS="-msse4.2 -DBASE64_SSE42_USE_ASM=${USE_ASSEMBLY}"
16
16
  export AVX_CFLAGS="-mavx -DBASE64_AVX_USE_ASM=${USE_ASSEMBLY}"
17
17
  export AVX2_CFLAGS="-mavx2 -DBASE64_AVX2_USE_ASM=${USE_ASSEMBLY}"
18
+ export AVX512_CFLAGS="-mavx512vl -mavx512vbmi"
18
19
  # Temporarily disable AVX512; it is not available in CI yet.
19
- # export AVX512_CFLAGS="-mavx512vl -mavx512vbmi"
20
+ export BASE64_TEST_SKIP_AVX512=1
20
21
  elif [ "${MACHINE}" == "aarch64" ]; then
21
22
  export NEON64_CFLAGS="-march=armv8-a"
22
23
  elif [ "${MACHINE}" == "armv7l" ]; then
@@ -7,12 +7,10 @@ if [ "${MACHINE}" == "x86_64" ]; then
7
7
  export SSE41_CFLAGS=-msse4.1
8
8
  export SSE42_CFLAGS=-msse4.2
9
9
  export AVX_CFLAGS=-mavx
10
- # no AVX2 or AVX512 on GHA macOS
11
- if [ "$(uname -s)" != "Darwin" ]; then
12
- export AVX2_CFLAGS=-mavx2
13
- # Temporarily disable AVX512; it is not available in CI yet.
14
- # export AVX512_CFLAGS="-mavx512vl -mavx512vbmi"
15
- fi
10
+ export AVX2_CFLAGS=-mavx2
11
+ export AVX512_CFLAGS="-mavx512vl -mavx512vbmi"
12
+ # Temporarily disable AVX512; it is not available in CI yet.
13
+ export BASE64_TEST_SKIP_AVX512=1
16
14
  elif [ "${MACHINE}" == "aarch64" ]; then
17
15
  export NEON64_CFLAGS="-march=armv8-a"
18
16
  elif [ "${MACHINE}" == "armv7l" ]; then
@@ -0,0 +1,40 @@
1
+ #include <stdio.h>
2
+ #include <stdlib.h>
3
+ #include <string.h>
4
+
5
+ #include "../include/libbase64.h"
6
+
7
+ static char *_codecs[] =
8
+ { "AVX2"
9
+ , "NEON32"
10
+ , "NEON64"
11
+ , "plain"
12
+ , "SSSE3"
13
+ , "SSE41"
14
+ , "SSE42"
15
+ , "AVX"
16
+ , "AVX512"
17
+ , NULL
18
+ } ;
19
+
20
+ char **codecs = _codecs;
21
+
22
+ int
23
+ codec_supported (size_t index)
24
+ {
25
+ if (index >= (sizeof(_codecs) / sizeof(_codecs[0])) - 1) {
26
+ return 0;
27
+ }
28
+ // Check if given codec is supported by trying to decode a test string:
29
+ char *a = "aGVsbG8=";
30
+ char b[10];
31
+ size_t outlen;
32
+ char envVariable[32];
33
+ sprintf(envVariable, "BASE64_TEST_SKIP_%s", _codecs[index]);
34
+ const char* envOverride = getenv(envVariable);
35
+ if ((envOverride != NULL) && (strcmp(envOverride, "1") == 0)) {
36
+ return 0;
37
+ }
38
+ int flags = 1 << index;
39
+ return (base64_decode(a, strlen(a), b, &outlen, flags) != -1) ? flags : 0;
40
+ }
@@ -0,0 +1,3 @@
1
+ extern char **codecs;
2
+
3
+ int codec_supported (size_t index);
@@ -313,14 +313,16 @@ test_invalid_dec_input (int flags)
313
313
  }
314
314
 
315
315
  static int
316
- test_one_codec (const char *codec, int flags)
316
+ test_one_codec (size_t codec_index)
317
317
  {
318
318
  bool fail = false;
319
+ const char *codec = codecs[codec_index];
319
320
 
320
321
  printf("Codec %s:\n", codec);
321
322
 
322
323
  // Skip if this codec is not supported:
323
- if (!codec_supported(flags)) {
324
+ int flags = codec_supported(codec_index);
325
+ if (flags == 0) {
324
326
  puts(" skipping");
325
327
  return false;
326
328
  }
@@ -376,12 +378,8 @@ main ()
376
378
 
377
379
  // Loop over all codecs:
378
380
  for (size_t i = 0; codecs[i]; i++) {
379
-
380
- // Flags to invoke this codec:
381
- int codec_flags = (1 << i);
382
-
383
381
  // Test this codec, merge the results:
384
- fail |= test_one_codec(codecs[i], codec_flags);
382
+ fail |= test_one_codec(i);
385
383
  }
386
384
 
387
385
  return (fail) ? 1 : 0;
@@ -3,11 +3,21 @@ requires = ["setuptools"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.cibuildwheel]
6
- free-threaded-support = true
7
- test-requires = "-r requirements-test.txt"
8
- test-command = "pytest {project}/tests"
9
- test-skip = "*-win_arm64" # silence warnings for windows ARM64
10
6
  build-verbosity = 1
7
+ enable = ["cpython-experimental-riscv64", "cpython-freethreading", "graalpy", "pypy", "pypy-eol"]
8
+ test-skip = ["gp311_242-win_amd64"] # https://github.com/oracle/graalpython/issues/490
9
+ test-requires = "-r requirements-test.txt"
10
+ test-sources = ["conftest.py", "pyproject.toml", "tests"]
11
+ test-command = "python -m pytest"
12
+ xbuild-tools = ["cmake"]
13
+
14
+ [[tool.cibuildwheel.overrides]]
15
+ select = "*-manylinux*"
16
+ environment = { AUDITWHEEL_PLAT="manylinux2014_${AUDITWHEEL_ARCH}" }
17
+
18
+ [[tool.cibuildwheel.overrides]]
19
+ select = "*-manylinux_riscv64"
20
+ environment = { AUDITWHEEL_PLAT="manylinux_2_31_${AUDITWHEEL_ARCH}" }
11
21
 
12
22
  [tool.coverage.run]
13
23
  branch = true
@@ -72,6 +72,7 @@ def get_cmake_extra_config(plat_name: str | None, build_type: str) -> tuple[bool
72
72
  log.info(" CC: %s", os.environ.get("CC", None))
73
73
  log.info(" CFLAGS: %s", os.environ.get("CFLAGS", None))
74
74
  log.info(" LDFLAGS: %s", os.environ.get("LDFLAGS", None))
75
+ log.info(" CMAKE_TOOLCHAIN_FILE: %s", os.environ.get("CMAKE_TOOLCHAIN_FILE", None))
75
76
  log.info(" sysconfig CC: %s", sysconfig.get_config_var("CC"))
76
77
  log.info(" sysconfig CCSHARED: %s", sysconfig.get_config_var("CCSHARED"))
77
78
  log.info(" sysconfig CFLAGS: %s", sysconfig.get_config_var("CFLAGS"))
@@ -81,6 +82,8 @@ def get_cmake_extra_config(plat_name: str | None, build_type: str) -> tuple[bool
81
82
 
82
83
  platform = plat_name or platform
83
84
  is_msvc = platform.startswith("win")
85
+ is_macos = platform.startswith("macosx-")
86
+ is_ios = platform.startswith("ios-")
84
87
 
85
88
  if not is_msvc:
86
89
  extra_config.append(f"-DCMAKE_BUILD_TYPE={build_type}")
@@ -97,7 +100,7 @@ def get_cmake_extra_config(plat_name: str | None, build_type: str) -> tuple[bool
97
100
  extra_config.append("-A Win32")
98
101
  if platform == "win-arm64" and machine != "arm64":
99
102
  extra_config.append("-A ARM64")
100
- elif IS_MACOS:
103
+ elif is_macos or is_ios:
101
104
  known_archs = {
102
105
  "arm64",
103
106
  "arm64e",
@@ -108,10 +111,18 @@ def get_cmake_extra_config(plat_name: str | None, build_type: str) -> tuple[bool
108
111
  "ppc",
109
112
  "ppc64",
110
113
  }
111
- if not platform.startswith("macosx-"):
112
- msg = f"Building {platform} is not supported on macOS"
114
+ if is_macos and not IS_MACOS:
115
+ msg = f"Building {platform} is only supported on macOS"
113
116
  raise ValueError(msg)
114
- _, _, platform_arch = platform.split("-")
117
+ if is_ios:
118
+ _, min_ver, platform_arch, sdk = platform.split("-")
119
+ min_ver = os.getenv("IPHONEOS_DEPLOYMENT_TARGET", min_ver)
120
+ extra_config.append("-DCMAKE_SYSTEM_NAME=iOS")
121
+ extra_config.append(f"-DCMAKE_OSX_SYSROOT={sdk}")
122
+ else:
123
+ _, min_ver, platform_arch = platform.split("-")
124
+ min_ver = os.getenv("MACOSX_DEPLOYMENT_TARGET", min_ver)
125
+ extra_config.append(f"-DCMAKE_OSX_DEPLOYMENT_TARGET={min_ver}")
115
126
  if platform_arch.startswith(("universal", "fat")):
116
127
  msg = f"multiple arch `{platform_arch}` is not supported"
117
128
  raise ValueError(msg)
@@ -153,6 +164,7 @@ def base64_build(plat_name: str | None) -> Generator[bool, None, None]:
153
164
  "-DBASE64_BUILD_TESTS:BOOL=OFF",
154
165
  "-DBASE64_BUILD_CLI:BOOL=OFF",
155
166
  "-DCMAKE_POSITION_INDEPENDENT_CODE=ON",
167
+ "-DBUILD_SHARED_LIBS:BOOL=OFF",
156
168
  ]
157
169
  if build_dir.exists():
158
170
  shutil.rmtree(build_dir)
@@ -243,6 +255,7 @@ setup(
243
255
  "Programming Language :: Python :: 3.11",
244
256
  "Programming Language :: Python :: 3.12",
245
257
  "Programming Language :: Python :: 3.13",
258
+ "Programming Language :: Python :: 3.14",
246
259
  ],
247
260
  # Supported python versions
248
261
  python_requires=">=3.8",