bcrypt 4.1.3__tar.gz → 4.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcrypt
3
- Version: 4.1.3
3
+ Version: 4.2.1
4
4
  Summary: Modern password hashing for your software and your servers
5
5
  Author-email: The Python Cryptographic Authority developers <cryptography-dev@python.org>
6
6
  License: Apache-2.0
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Requires-Python: >=3.7
21
22
  Description-Content-Type: text/x-rst
22
23
  License-File: LICENSE
@@ -44,7 +45,7 @@ Installation
44
45
 
45
46
  To install bcrypt, simply:
46
47
 
47
- .. code:: bash
48
+ .. code:: console
48
49
 
49
50
  $ pip install bcrypt
50
51
 
@@ -53,19 +54,19 @@ compiler and a Rust compiler (the minimum supported Rust version is 1.56.0).
53
54
 
54
55
  For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:
55
56
 
56
- .. code:: bash
57
+ .. code:: console
57
58
 
58
59
  $ sudo apt-get install build-essential cargo
59
60
 
60
61
  For Fedora and RHEL-derivatives, the following command will ensure that the required dependencies are installed:
61
62
 
62
- .. code:: bash
63
+ .. code:: console
63
64
 
64
65
  $ sudo yum install gcc cargo
65
66
 
66
67
  For Alpine, the following command will ensure that the required dependencies are installed:
67
68
 
68
- .. code:: bash
69
+ .. code:: console
69
70
 
70
71
  $ apk add --update musl-dev gcc cargo
71
72
 
@@ -78,6 +79,19 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
79
  Changelog
79
80
  =========
80
81
 
82
+ 4.2.1
83
+ -----
84
+
85
+ * Bump Rust dependency versions - this should resolve crashes on Python 3.13
86
+ free-threaded builds.
87
+ * We no longer build ``manylinux`` wheels for PyPy 3.9.
88
+
89
+ 4.2.0
90
+ -----
91
+
92
+ * Bump Rust dependency versions
93
+ * Removed the ``BCRYPT_ALLOW_RUST_163`` environment variable.
94
+
81
95
  4.1.3
82
96
  -----
83
97
 
@@ -17,7 +17,7 @@ Installation
17
17
 
18
18
  To install bcrypt, simply:
19
19
 
20
- .. code:: bash
20
+ .. code:: console
21
21
 
22
22
  $ pip install bcrypt
23
23
 
@@ -26,19 +26,19 @@ compiler and a Rust compiler (the minimum supported Rust version is 1.56.0).
26
26
 
27
27
  For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:
28
28
 
29
- .. code:: bash
29
+ .. code:: console
30
30
 
31
31
  $ sudo apt-get install build-essential cargo
32
32
 
33
33
  For Fedora and RHEL-derivatives, the following command will ensure that the required dependencies are installed:
34
34
 
35
- .. code:: bash
35
+ .. code:: console
36
36
 
37
37
  $ sudo yum install gcc cargo
38
38
 
39
39
  For Alpine, the following command will ensure that the required dependencies are installed:
40
40
 
41
- .. code:: bash
41
+ .. code:: console
42
42
 
43
43
  $ apk add --update musl-dev gcc cargo
44
44
 
@@ -51,6 +51,19 @@ While bcrypt remains an acceptable choice for password storage, depending on you
51
51
  Changelog
52
52
  =========
53
53
 
54
+ 4.2.1
55
+ -----
56
+
57
+ * Bump Rust dependency versions - this should resolve crashes on Python 3.13
58
+ free-threaded builds.
59
+ * We no longer build ``manylinux`` wheels for PyPy 3.9.
60
+
61
+ 4.2.0
62
+ -----
63
+
64
+ * Bump Rust dependency versions
65
+ * Removed the ``BCRYPT_ALLOW_RUST_163`` environment variable.
66
+
54
67
  4.1.3
55
68
  -----
56
69
 
@@ -1,9 +1,8 @@
1
1
  [build-system]
2
- # Must be kept in sync with `setup_requirements` in `setup.py`
3
2
  requires = [
4
3
  "setuptools>=42.0.0",
5
4
  "wheel",
6
- "setuptools-rust",
5
+ "setuptools-rust>=1.7.0",
7
6
  ]
8
7
  # Point to the setuptools' PEP517 build backend explicitly to
9
8
  # disable Pip's fallback guessing
@@ -12,7 +11,7 @@ build-backend = "setuptools.build_meta"
12
11
  [project]
13
12
  name = "bcrypt"
14
13
  # When updating this, also update lib.rs
15
- version = "4.1.3"
14
+ version = "4.2.1"
16
15
  authors = [
17
16
  {name = "The Python Cryptographic Authority developers", email = "cryptography-dev@python.org"}
18
17
  ]
@@ -31,6 +30,7 @@ classifiers = [
31
30
  "Programming Language :: Python :: 3.10",
32
31
  "Programming Language :: Python :: 3.11",
33
32
  "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
34
  ]
35
35
  requires-python = ">= 3.7"
36
36
  dynamic = ["readme"]
@@ -50,13 +50,19 @@ readme = {file = "README.rst", content-type = "text/x-rst"}
50
50
  tests = ["pytest>=3.2.1,!=3.3.0"]
51
51
  typecheck = ["mypy"]
52
52
 
53
+ [[tool.setuptools-rust.ext-modules]]
54
+ target = "bcrypt._bcrypt"
55
+ path = "src/_bcrypt/Cargo.toml"
56
+ py-limited-api = "auto"
57
+ rust-version = ">=1.64.0"
53
58
 
54
59
  [tool.ruff]
55
- ignore = ['N818']
56
- select = ['E', 'F', 'I', 'N', 'W', 'UP', 'RUF']
57
60
  line-length = 79
58
61
 
59
- [tool.ruff.isort]
62
+ lint.ignore = ['N818']
63
+ lint.select = ['E', 'F', 'I', 'N', 'W', 'UP', 'RUF']
64
+
65
+ [tool.ruff.lint.isort]
60
66
  known-first-party = ["bcrypt", "tests"]
61
67
 
62
68
  [tool.mypy]
@@ -4,9 +4,9 @@ version = 3
4
4
 
5
5
  [[package]]
6
6
  name = "autocfg"
7
- version = "1.3.0"
7
+ version = "1.4.0"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
9
+ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
10
10
 
11
11
  [[package]]
12
12
  name = "base64"
@@ -16,9 +16,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
16
16
 
17
17
  [[package]]
18
18
  name = "bcrypt"
19
- version = "0.15.1"
19
+ version = "0.16.0"
20
20
  source = "registry+https://github.com/rust-lang/crates.io-index"
21
- checksum = "e65938ed058ef47d92cf8b346cc76ef48984572ade631927e9937b5ffc7662c7"
21
+ checksum = "2b1866ecef4f2d06a0bb77880015fdf2b89e25a1c2e5addacb87e459c86dc67e"
22
22
  dependencies = [
23
23
  "base64",
24
24
  "blowfish",
@@ -50,12 +50,6 @@ dependencies = [
50
50
  "subtle",
51
51
  ]
52
52
 
53
- [[package]]
54
- name = "bitflags"
55
- version = "2.5.0"
56
- source = "registry+https://github.com/rust-lang/crates.io-index"
57
- checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
58
-
59
53
  [[package]]
60
54
  name = "block-buffer"
61
55
  version = "0.10.4"
@@ -99,9 +93,9 @@ dependencies = [
99
93
 
100
94
  [[package]]
101
95
  name = "cpufeatures"
102
- version = "0.2.12"
96
+ version = "0.2.15"
103
97
  source = "registry+https://github.com/rust-lang/crates.io-index"
104
- checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
98
+ checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6"
105
99
  dependencies = [
106
100
  "libc",
107
101
  ]
@@ -139,9 +133,9 @@ dependencies = [
139
133
 
140
134
  [[package]]
141
135
  name = "getrandom"
142
- version = "0.2.14"
136
+ version = "0.2.15"
143
137
  source = "registry+https://github.com/rust-lang/crates.io-index"
144
- checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c"
138
+ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
145
139
  dependencies = [
146
140
  "cfg-if",
147
141
  "libc",
@@ -150,9 +144,9 @@ dependencies = [
150
144
 
151
145
  [[package]]
152
146
  name = "heck"
153
- version = "0.4.1"
147
+ version = "0.5.0"
154
148
  source = "registry+https://github.com/rust-lang/crates.io-index"
155
- checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
149
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
156
150
 
157
151
  [[package]]
158
152
  name = "indoc"
@@ -171,19 +165,9 @@ dependencies = [
171
165
 
172
166
  [[package]]
173
167
  name = "libc"
174
- version = "0.2.154"
175
- source = "registry+https://github.com/rust-lang/crates.io-index"
176
- checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"
177
-
178
- [[package]]
179
- name = "lock_api"
180
- version = "0.4.12"
168
+ version = "0.2.164"
181
169
  source = "registry+https://github.com/rust-lang/crates.io-index"
182
- checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
183
- dependencies = [
184
- "autocfg",
185
- "scopeguard",
186
- ]
170
+ checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f"
187
171
 
188
172
  [[package]]
189
173
  name = "memoffset"
@@ -196,32 +180,9 @@ dependencies = [
196
180
 
197
181
  [[package]]
198
182
  name = "once_cell"
199
- version = "1.19.0"
200
- source = "registry+https://github.com/rust-lang/crates.io-index"
201
- checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
202
-
203
- [[package]]
204
- name = "parking_lot"
205
- version = "0.12.2"
206
- source = "registry+https://github.com/rust-lang/crates.io-index"
207
- checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb"
208
- dependencies = [
209
- "lock_api",
210
- "parking_lot_core",
211
- ]
212
-
213
- [[package]]
214
- name = "parking_lot_core"
215
- version = "0.9.10"
183
+ version = "1.20.2"
216
184
  source = "registry+https://github.com/rust-lang/crates.io-index"
217
- checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
218
- dependencies = [
219
- "cfg-if",
220
- "libc",
221
- "redox_syscall",
222
- "smallvec",
223
- "windows-targets",
224
- ]
185
+ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
225
186
 
226
187
  [[package]]
227
188
  name = "pbkdf2"
@@ -234,30 +195,30 @@ dependencies = [
234
195
 
235
196
  [[package]]
236
197
  name = "portable-atomic"
237
- version = "1.6.0"
198
+ version = "1.9.0"
238
199
  source = "registry+https://github.com/rust-lang/crates.io-index"
239
- checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
200
+ checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2"
240
201
 
241
202
  [[package]]
242
203
  name = "proc-macro2"
243
- version = "1.0.81"
204
+ version = "1.0.89"
244
205
  source = "registry+https://github.com/rust-lang/crates.io-index"
245
- checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
206
+ checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
246
207
  dependencies = [
247
208
  "unicode-ident",
248
209
  ]
249
210
 
250
211
  [[package]]
251
212
  name = "pyo3"
252
- version = "0.21.2"
213
+ version = "0.23.1"
253
214
  source = "registry+https://github.com/rust-lang/crates.io-index"
254
- checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8"
215
+ checksum = "7ebb0c0cc0de9678e53be9ccf8a2ab53045e6e3a8be03393ceccc5e7396ccb40"
255
216
  dependencies = [
256
217
  "cfg-if",
257
218
  "indoc",
258
219
  "libc",
259
220
  "memoffset",
260
- "parking_lot",
221
+ "once_cell",
261
222
  "portable-atomic",
262
223
  "pyo3-build-config",
263
224
  "pyo3-ffi",
@@ -267,9 +228,9 @@ dependencies = [
267
228
 
268
229
  [[package]]
269
230
  name = "pyo3-build-config"
270
- version = "0.21.2"
231
+ version = "0.23.1"
271
232
  source = "registry+https://github.com/rust-lang/crates.io-index"
272
- checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50"
233
+ checksum = "80e3ce69c4ec34476534b490e412b871ba03a82e35604c3dfb95fcb6bfb60c09"
273
234
  dependencies = [
274
235
  "once_cell",
275
236
  "target-lexicon",
@@ -277,9 +238,9 @@ dependencies = [
277
238
 
278
239
  [[package]]
279
240
  name = "pyo3-ffi"
280
- version = "0.21.2"
241
+ version = "0.23.1"
281
242
  source = "registry+https://github.com/rust-lang/crates.io-index"
282
- checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403"
243
+ checksum = "3b09f311c76b36dfd6dd6f7fa6f9f18e7e46a1c937110d283e80b12ba2468a75"
283
244
  dependencies = [
284
245
  "libc",
285
246
  "pyo3-build-config",
@@ -287,9 +248,9 @@ dependencies = [
287
248
 
288
249
  [[package]]
289
250
  name = "pyo3-macros"
290
- version = "0.21.2"
251
+ version = "0.23.1"
291
252
  source = "registry+https://github.com/rust-lang/crates.io-index"
292
- checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c"
253
+ checksum = "fd4f74086536d1e1deaff99ec0387481fb3325c82e4e48be0e75ab3d3fcb487a"
293
254
  dependencies = [
294
255
  "proc-macro2",
295
256
  "pyo3-macros-backend",
@@ -299,9 +260,9 @@ dependencies = [
299
260
 
300
261
  [[package]]
301
262
  name = "pyo3-macros-backend"
302
- version = "0.21.2"
263
+ version = "0.23.1"
303
264
  source = "registry+https://github.com/rust-lang/crates.io-index"
304
- checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c"
265
+ checksum = "9e77dfeb76b32bbf069144a5ea0a36176ab59c8db9ce28732d0f06f096bbfbc8"
305
266
  dependencies = [
306
267
  "heck",
307
268
  "proc-macro2",
@@ -312,28 +273,13 @@ dependencies = [
312
273
 
313
274
  [[package]]
314
275
  name = "quote"
315
- version = "1.0.36"
276
+ version = "1.0.37"
316
277
  source = "registry+https://github.com/rust-lang/crates.io-index"
317
- checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
278
+ checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
318
279
  dependencies = [
319
280
  "proc-macro2",
320
281
  ]
321
282
 
322
- [[package]]
323
- name = "redox_syscall"
324
- version = "0.5.1"
325
- source = "registry+https://github.com/rust-lang/crates.io-index"
326
- checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
327
- dependencies = [
328
- "bitflags",
329
- ]
330
-
331
- [[package]]
332
- name = "scopeguard"
333
- version = "1.2.0"
334
- source = "registry+https://github.com/rust-lang/crates.io-index"
335
- checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
336
-
337
283
  [[package]]
338
284
  name = "sha2"
339
285
  version = "0.10.8"
@@ -345,23 +291,17 @@ dependencies = [
345
291
  "digest",
346
292
  ]
347
293
 
348
- [[package]]
349
- name = "smallvec"
350
- version = "1.13.2"
351
- source = "registry+https://github.com/rust-lang/crates.io-index"
352
- checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
353
-
354
294
  [[package]]
355
295
  name = "subtle"
356
- version = "2.5.0"
296
+ version = "2.6.1"
357
297
  source = "registry+https://github.com/rust-lang/crates.io-index"
358
- checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
298
+ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
359
299
 
360
300
  [[package]]
361
301
  name = "syn"
362
- version = "2.0.60"
302
+ version = "2.0.87"
363
303
  source = "registry+https://github.com/rust-lang/crates.io-index"
364
- checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
304
+ checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
365
305
  dependencies = [
366
306
  "proc-macro2",
367
307
  "quote",
@@ -370,9 +310,9 @@ dependencies = [
370
310
 
371
311
  [[package]]
372
312
  name = "target-lexicon"
373
- version = "0.12.14"
313
+ version = "0.12.16"
374
314
  source = "registry+https://github.com/rust-lang/crates.io-index"
375
- checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
315
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
376
316
 
377
317
  [[package]]
378
318
  name = "typenum"
@@ -382,9 +322,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
382
322
 
383
323
  [[package]]
384
324
  name = "unicode-ident"
385
- version = "1.0.12"
325
+ version = "1.0.13"
386
326
  source = "registry+https://github.com/rust-lang/crates.io-index"
387
- checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
327
+ checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
388
328
 
389
329
  [[package]]
390
330
  name = "unindent"
@@ -394,9 +334,9 @@ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
394
334
 
395
335
  [[package]]
396
336
  name = "version_check"
397
- version = "0.9.4"
337
+ version = "0.9.5"
398
338
  source = "registry+https://github.com/rust-lang/crates.io-index"
399
- checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
339
+ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
400
340
 
401
341
  [[package]]
402
342
  name = "wasi"
@@ -404,72 +344,8 @@ version = "0.11.0+wasi-snapshot-preview1"
404
344
  source = "registry+https://github.com/rust-lang/crates.io-index"
405
345
  checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
406
346
 
407
- [[package]]
408
- name = "windows-targets"
409
- version = "0.52.5"
410
- source = "registry+https://github.com/rust-lang/crates.io-index"
411
- checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
412
- dependencies = [
413
- "windows_aarch64_gnullvm",
414
- "windows_aarch64_msvc",
415
- "windows_i686_gnu",
416
- "windows_i686_gnullvm",
417
- "windows_i686_msvc",
418
- "windows_x86_64_gnu",
419
- "windows_x86_64_gnullvm",
420
- "windows_x86_64_msvc",
421
- ]
422
-
423
- [[package]]
424
- name = "windows_aarch64_gnullvm"
425
- version = "0.52.5"
426
- source = "registry+https://github.com/rust-lang/crates.io-index"
427
- checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
428
-
429
- [[package]]
430
- name = "windows_aarch64_msvc"
431
- version = "0.52.5"
432
- source = "registry+https://github.com/rust-lang/crates.io-index"
433
- checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
434
-
435
- [[package]]
436
- name = "windows_i686_gnu"
437
- version = "0.52.5"
438
- source = "registry+https://github.com/rust-lang/crates.io-index"
439
- checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
440
-
441
- [[package]]
442
- name = "windows_i686_gnullvm"
443
- version = "0.52.5"
444
- source = "registry+https://github.com/rust-lang/crates.io-index"
445
- checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
446
-
447
- [[package]]
448
- name = "windows_i686_msvc"
449
- version = "0.52.5"
450
- source = "registry+https://github.com/rust-lang/crates.io-index"
451
- checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
452
-
453
- [[package]]
454
- name = "windows_x86_64_gnu"
455
- version = "0.52.5"
456
- source = "registry+https://github.com/rust-lang/crates.io-index"
457
- checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
458
-
459
- [[package]]
460
- name = "windows_x86_64_gnullvm"
461
- version = "0.52.5"
462
- source = "registry+https://github.com/rust-lang/crates.io-index"
463
- checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
464
-
465
- [[package]]
466
- name = "windows_x86_64_msvc"
467
- version = "0.52.5"
468
- source = "registry+https://github.com/rust-lang/crates.io-index"
469
- checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
470
-
471
347
  [[package]]
472
348
  name = "zeroize"
473
- version = "1.7.0"
349
+ version = "1.8.1"
474
350
  source = "registry+https://github.com/rust-lang/crates.io-index"
475
- checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
351
+ checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
@@ -6,11 +6,11 @@ edition = "2018"
6
6
  publish = false
7
7
 
8
8
  [dependencies]
9
- pyo3 = { version = "0.21", features = ["abi3"] }
10
- bcrypt = "0.15"
9
+ pyo3 = { version = "0.23", features = ["abi3"] }
10
+ bcrypt = "0.16"
11
11
  bcrypt-pbkdf = "0.10.0"
12
12
  base64 = "0.22.1"
13
- subtle = "2.5"
13
+ subtle = "2.6"
14
14
  getrandom = "0.2"
15
15
 
16
16
  [features]
@@ -13,9 +13,10 @@
13
13
  #![deny(rust_2018_idioms)]
14
14
 
15
15
  use base64::Engine;
16
- use pyo3::prelude::PyBytesMethods;
16
+ use pyo3::types::PyBytesMethods;
17
17
  use pyo3::PyTypeInfo;
18
18
  use std::convert::TryInto;
19
+ use std::ffi::CString;
19
20
  use std::io::Write;
20
21
  use subtle::ConstantTimeEq;
21
22
 
@@ -24,7 +25,8 @@ pub const BASE64_ENGINE: base64::engine::GeneralPurpose = base64::engine::Genera
24
25
  base64::engine::general_purpose::NO_PAD,
25
26
  );
26
27
 
27
- #[pyo3::prelude::pyfunction]
28
+ #[pyo3::pyfunction]
29
+ #[pyo3(signature = (rounds=None, prefix=None))]
28
30
  fn gensalt<'p>(
29
31
  py: pyo3::Python<'p>,
30
32
  rounds: Option<u16>,
@@ -48,7 +50,7 @@ fn gensalt<'p>(
48
50
 
49
51
  let encoded_salt = BASE64_ENGINE.encode(salt);
50
52
 
51
- pyo3::types::PyBytes::new_bound_with(
53
+ pyo3::types::PyBytes::new_with(
52
54
  py,
53
55
  1 + prefix.len() + 1 + 2 + 1 + encoded_salt.len(),
54
56
  |mut b| {
@@ -64,7 +66,7 @@ fn gensalt<'p>(
64
66
  )
65
67
  }
66
68
 
67
- #[pyo3::prelude::pyfunction]
69
+ #[pyo3::pyfunction]
68
70
  fn hashpw<'p>(
69
71
  py: pyo3::Python<'p>,
70
72
  password: &[u8],
@@ -113,13 +115,13 @@ fn hashpw<'p>(
113
115
  let hashed = py
114
116
  .allow_threads(|| bcrypt::hash_with_salt(password, cost, raw_salt))
115
117
  .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
116
- Ok(pyo3::types::PyBytes::new_bound(
118
+ Ok(pyo3::types::PyBytes::new(
117
119
  py,
118
120
  hashed.format_for_version(version).as_bytes(),
119
121
  ))
120
122
  }
121
123
 
122
- #[pyo3::prelude::pyfunction]
124
+ #[pyo3::pyfunction]
123
125
  fn checkpw(py: pyo3::Python<'_>, password: &[u8], hashed_password: &[u8]) -> pyo3::PyResult<bool> {
124
126
  Ok(hashpw(py, password, hashed_password)?
125
127
  .as_bytes()
@@ -127,17 +129,16 @@ fn checkpw(py: pyo3::Python<'_>, password: &[u8], hashed_password: &[u8]) -> pyo
127
129
  .into())
128
130
  }
129
131
 
130
- #[pyo3::prelude::pyfunction]
132
+ #[pyo3::pyfunction]
133
+ #[pyo3(signature = (password, salt, desired_key_bytes, rounds, ignore_few_rounds=false))]
131
134
  fn kdf<'p>(
132
135
  py: pyo3::Python<'p>,
133
136
  password: &[u8],
134
137
  salt: &[u8],
135
138
  desired_key_bytes: usize,
136
139
  rounds: u32,
137
- ignore_few_rounds: Option<bool>,
140
+ ignore_few_rounds: bool,
138
141
  ) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
139
- let ignore_few_rounds = ignore_few_rounds.unwrap_or(false);
140
-
141
142
  if password.is_empty() || salt.is_empty() {
142
143
  return Err(pyo3::exceptions::PyValueError::new_err(
143
144
  "password and salt must not be empty",
@@ -160,15 +161,15 @@ fn kdf<'p>(
160
161
  // They probably think bcrypt.kdf()'s rounds parameter is logarithmic,
161
162
  // expecting this value to be slow enough (it probably would be if this
162
163
  // were bcrypt). Emit a warning.
163
- pyo3::PyErr::warn_bound(
164
+ pyo3::PyErr::warn(
164
165
  py,
165
- &pyo3::exceptions::PyUserWarning::type_object_bound(py),
166
- &format!("Warning: bcrypt.kdf() called with only {rounds} round(s). This few is not secure: the parameter is linear, like PBKDF2."),
166
+ &pyo3::exceptions::PyUserWarning::type_object(py),
167
+ &CString::new(format!("Warning: bcrypt.kdf() called with only {rounds} round(s). This few is not secure: the parameter is linear, like PBKDF2.")).unwrap(),
167
168
  3
168
169
  )?;
169
170
  }
170
171
 
171
- pyo3::types::PyBytes::new_bound_with(py, desired_key_bytes, |output| {
172
+ pyo3::types::PyBytes::new_with(py, desired_key_bytes, |output| {
172
173
  py.allow_threads(|| {
173
174
  bcrypt_pbkdf::bcrypt_pbkdf(password, salt, rounds, output).unwrap();
174
175
  });
@@ -176,34 +177,35 @@ fn kdf<'p>(
176
177
  })
177
178
  }
178
179
 
179
- #[pyo3::prelude::pymodule]
180
- fn _bcrypt(
181
- _py: pyo3::Python<'_>,
182
- m: &pyo3::Bound<'_, pyo3::types::PyModule>,
183
- ) -> pyo3::PyResult<()> {
184
- m.add_function(pyo3::wrap_pyfunction!(gensalt, m)?)?;
185
- m.add_function(pyo3::wrap_pyfunction!(hashpw, m)?)?;
186
- m.add_function(pyo3::wrap_pyfunction!(checkpw, m)?)?;
187
- m.add_function(pyo3::wrap_pyfunction!(kdf, m)?)?;
188
-
189
- m.add("__title__", "bcrypt")?;
190
- m.add(
191
- "__summary__",
192
- "Modern(-ish) password hashing for your software and your servers",
193
- )?;
194
- m.add("__uri__", "https://github.com/pyca/bcrypt/")?;
195
-
196
- // When updating this, also update pyproject.toml
197
- // This isn't named __version__ because passlib treats the existence of
198
- // that attribute as proof that we're a different module
199
- m.add("__version_ex__", "4.1.3")?;
200
-
201
- let author = "The Python Cryptographic Authority developers";
202
- m.add("__author__", author)?;
203
- m.add("__email__", "cryptography-dev@python.org")?;
204
-
205
- m.add("__license__", "Apache License, Version 2.0")?;
206
- m.add("__copyright__", format!("Copyright 2013-2024 {author}"))?;
207
-
208
- Ok(())
180
+ #[pyo3::pymodule]
181
+ mod _bcrypt {
182
+ use pyo3::types::PyModuleMethods;
183
+
184
+ #[pymodule_export]
185
+ use super::{checkpw, gensalt, hashpw, kdf};
186
+
187
+ // Not yet possible to add constants declaratively.
188
+ #[pymodule_init]
189
+ fn init(m: &pyo3::Bound<'_, pyo3::types::PyModule>) -> pyo3::PyResult<()> {
190
+ m.add("__title__", "bcrypt")?;
191
+ m.add(
192
+ "__summary__",
193
+ "Modern(-ish) password hashing for your software and your servers",
194
+ )?;
195
+ m.add("__uri__", "https://github.com/pyca/bcrypt/")?;
196
+
197
+ // When updating this, also update pyproject.toml
198
+ // This isn't named __version__ because passlib treats the existence of
199
+ // that attribute as proof that we're a different module
200
+ m.add("__version_ex__", "4.2.1")?;
201
+
202
+ let author = "The Python Cryptographic Authority developers";
203
+ m.add("__author__", author)?;
204
+ m.add("__email__", "cryptography-dev@python.org")?;
205
+
206
+ m.add("__license__", "Apache License, Version 2.0")?;
207
+ m.add("__copyright__", format!("Copyright 2013-2024 {author}"))?;
208
+
209
+ Ok(())
210
+ }
209
211
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcrypt
3
- Version: 4.1.3
3
+ Version: 4.2.1
4
4
  Summary: Modern password hashing for your software and your servers
5
5
  Author-email: The Python Cryptographic Authority developers <cryptography-dev@python.org>
6
6
  License: Apache-2.0
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Requires-Python: >=3.7
21
22
  Description-Content-Type: text/x-rst
22
23
  License-File: LICENSE
@@ -44,7 +45,7 @@ Installation
44
45
 
45
46
  To install bcrypt, simply:
46
47
 
47
- .. code:: bash
48
+ .. code:: console
48
49
 
49
50
  $ pip install bcrypt
50
51
 
@@ -53,19 +54,19 @@ compiler and a Rust compiler (the minimum supported Rust version is 1.56.0).
53
54
 
54
55
  For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:
55
56
 
56
- .. code:: bash
57
+ .. code:: console
57
58
 
58
59
  $ sudo apt-get install build-essential cargo
59
60
 
60
61
  For Fedora and RHEL-derivatives, the following command will ensure that the required dependencies are installed:
61
62
 
62
- .. code:: bash
63
+ .. code:: console
63
64
 
64
65
  $ sudo yum install gcc cargo
65
66
 
66
67
  For Alpine, the following command will ensure that the required dependencies are installed:
67
68
 
68
- .. code:: bash
69
+ .. code:: console
69
70
 
70
71
  $ apk add --update musl-dev gcc cargo
71
72
 
@@ -78,6 +79,19 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
79
  Changelog
79
80
  =========
80
81
 
82
+ 4.2.1
83
+ -----
84
+
85
+ * Bump Rust dependency versions - this should resolve crashes on Python 3.13
86
+ free-threaded builds.
87
+ * We no longer build ``manylinux`` wheels for PyPy 3.9.
88
+
89
+ 4.2.0
90
+ -----
91
+
92
+ * Bump Rust dependency versions
93
+ * Removed the ``BCRYPT_ALLOW_RUST_163`` environment variable.
94
+
81
95
  4.1.3
82
96
  -----
83
97
 
@@ -3,7 +3,6 @@ LICENSE
3
3
  MANIFEST.in
4
4
  README.rst
5
5
  pyproject.toml
6
- setup.py
7
6
  tox.ini
8
7
  src/_bcrypt/Cargo.lock
9
8
  src/_bcrypt/Cargo.toml
@@ -17,7 +17,7 @@ commands =
17
17
  deps =
18
18
  ruff
19
19
  commands =
20
- ruff .
20
+ ruff check .
21
21
  ruff format --check .
22
22
 
23
23
  [testenv:mypy]
@@ -35,7 +35,7 @@ deps =
35
35
  readme_renderer
36
36
  commands =
37
37
  check-manifest
38
- python setup.py check --metadata --restructuredtext --strict
38
+ python3 -m readme_renderer README.rst -o /dev/null
39
39
 
40
40
 
41
41
  [check-manifest]
bcrypt-4.1.3/setup.py DELETED
@@ -1,101 +0,0 @@
1
- import os
2
- import platform
3
- import re
4
- import shutil
5
- import subprocess
6
- import sys
7
-
8
- from setuptools import setup
9
-
10
- try:
11
- from setuptools_rust import RustExtension
12
- except ImportError:
13
- print(
14
- """
15
- =============================DEBUG ASSISTANCE==========================
16
- If you are seeing an error here please try the following to
17
- successfully install bcrypt:
18
-
19
- Upgrade to the latest pip and try again. This will fix errors for most
20
- users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
21
- =============================DEBUG ASSISTANCE==========================
22
- """
23
- )
24
- raise
25
-
26
- if platform.python_implementation() == "PyPy":
27
- if sys.pypy_version_info < (2, 6):
28
- raise RuntimeError(
29
- "bcrypt is not compatible with PyPy < 2.6. Please upgrade PyPy to "
30
- "use this library."
31
- )
32
-
33
-
34
- try:
35
- setup(
36
- rust_extensions=[
37
- RustExtension(
38
- "bcrypt._bcrypt",
39
- "src/_bcrypt/Cargo.toml",
40
- py_limited_api="auto",
41
- rust_version=(
42
- ">=1.64.0"
43
- if os.environ.get("BCRYPT_ALLOW_RUST_163", "0") != "0"
44
- else ">=1.63.0"
45
- ),
46
- ),
47
- ],
48
- )
49
- except:
50
- # Note: This is a bare exception that re-raises so that we don't interfere
51
- # with anything the installation machinery might want to do. Because we
52
- # print this for any exception this msg can appear (e.g. in verbose logs)
53
- # even if there's no failure. For example, SetupRequirementsError is raised
54
- # during PEP517 building and prints this text. setuptools raises SystemExit
55
- # when compilation fails right now, but it's possible this isn't stable
56
- # or a public API commitment so we'll remain ultra conservative.
57
-
58
- import pkg_resources
59
-
60
- print(
61
- """
62
- =============================DEBUG ASSISTANCE=============================
63
- If you are seeing a compilation error please try the following steps to
64
- successfully install bcrypt:
65
- 1) Upgrade to the latest pip and try again. This will fix errors for most
66
- users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
67
- 2) Ensure you have a recent Rust toolchain installed. bcrypt requires
68
- rustc >= 1.64.0. (1.63 may be used by setting the BCRYPT_ALLOW_RUST_163
69
- environment variable)
70
- """
71
- )
72
- print(f" Python: {'.'.join(str(v) for v in sys.version_info[:3])}")
73
- print(f" platform: {platform.platform()}")
74
- for dist in ["pip", "setuptools", "setuptools_rust"]:
75
- try:
76
- version = pkg_resources.get_distribution(dist).version
77
- except pkg_resources.DistributionNotFound:
78
- version = "n/a"
79
- print(f" {dist}: {version}")
80
- version = "n/a"
81
- if shutil.which("rustc") is not None:
82
- try:
83
- # If for any reason `rustc --version` fails, silently ignore it
84
- rustc_output = subprocess.run(
85
- ["rustc", "--version"],
86
- capture_output=True,
87
- timeout=0.5,
88
- encoding="utf8",
89
- check=True,
90
- ).stdout
91
- version = re.sub("^rustc ", "", rustc_output.strip())
92
- except subprocess.SubprocessError:
93
- pass
94
- print(f" rustc: {version}")
95
-
96
- print(
97
- """\
98
- =============================DEBUG ASSISTANCE=============================
99
- """
100
- )
101
- raise
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes