bcrypt 4.1.3__tar.gz → 4.2.0__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.0
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
@@ -78,6 +78,12 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
78
  Changelog
79
79
  =========
80
80
 
81
+ 4.2.0
82
+ -----
83
+
84
+ * Bump Rust dependency versions
85
+ * Removed the ``BCRYPT_ALLOW_RUST_163`` environment variable.
86
+
81
87
  4.1.3
82
88
  -----
83
89
 
@@ -51,6 +51,12 @@ While bcrypt remains an acceptable choice for password storage, depending on you
51
51
  Changelog
52
52
  =========
53
53
 
54
+ 4.2.0
55
+ -----
56
+
57
+ * Bump Rust dependency versions
58
+ * Removed the ``BCRYPT_ALLOW_RUST_163`` environment variable.
59
+
54
60
  4.1.3
55
61
  -----
56
62
 
@@ -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.0"
16
15
  authors = [
17
16
  {name = "The Python Cryptographic Authority developers", email = "cryptography-dev@python.org"}
18
17
  ]
@@ -50,13 +49,19 @@ readme = {file = "README.rst", content-type = "text/x-rst"}
50
49
  tests = ["pytest>=3.2.1,!=3.3.0"]
51
50
  typecheck = ["mypy"]
52
51
 
52
+ [[tool.setuptools-rust.ext-modules]]
53
+ target = "bcrypt._bcrypt"
54
+ path = "src/_bcrypt/Cargo.toml"
55
+ py-limited-api = "auto"
56
+ rust-version = ">=1.64.0"
53
57
 
54
58
  [tool.ruff]
55
- ignore = ['N818']
56
- select = ['E', 'F', 'I', 'N', 'W', 'UP', 'RUF']
57
59
  line-length = 79
58
60
 
59
- [tool.ruff.isort]
61
+ lint.ignore = ['N818']
62
+ lint.select = ['E', 'F', 'I', 'N', 'W', 'UP', 'RUF']
63
+
64
+ [tool.ruff.lint.isort]
60
65
  known-first-party = ["bcrypt", "tests"]
61
66
 
62
67
  [tool.mypy]
@@ -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"
@@ -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"
168
+ version = "0.2.155"
175
169
  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"
181
- source = "registry+https://github.com/rust-lang/crates.io-index"
182
- checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
183
- dependencies = [
184
- "autocfg",
185
- "scopeguard",
186
- ]
170
+ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
187
171
 
188
172
  [[package]]
189
173
  name = "memoffset"
@@ -200,29 +184,6 @@ version = "1.19.0"
200
184
  source = "registry+https://github.com/rust-lang/crates.io-index"
201
185
  checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
202
186
 
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"
216
- 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
- ]
225
-
226
187
  [[package]]
227
188
  name = "pbkdf2"
228
189
  version = "0.12.2"
@@ -234,30 +195,30 @@ dependencies = [
234
195
 
235
196
  [[package]]
236
197
  name = "portable-atomic"
237
- version = "1.6.0"
198
+ version = "1.7.0"
238
199
  source = "registry+https://github.com/rust-lang/crates.io-index"
239
- checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
200
+ checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
240
201
 
241
202
  [[package]]
242
203
  name = "proc-macro2"
243
- version = "1.0.81"
204
+ version = "1.0.86"
244
205
  source = "registry+https://github.com/rust-lang/crates.io-index"
245
- checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
206
+ checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
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.22.2"
253
214
  source = "registry+https://github.com/rust-lang/crates.io-index"
254
- checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8"
215
+ checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433"
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.22.2"
271
232
  source = "registry+https://github.com/rust-lang/crates.io-index"
272
- checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50"
233
+ checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8"
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.22.2"
281
242
  source = "registry+https://github.com/rust-lang/crates.io-index"
282
- checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403"
243
+ checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6"
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.22.2"
291
252
  source = "registry+https://github.com/rust-lang/crates.io-index"
292
- checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c"
253
+ checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206"
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.22.2"
303
264
  source = "registry+https://github.com/rust-lang/crates.io-index"
304
- checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c"
265
+ checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372"
305
266
  dependencies = [
306
267
  "heck",
307
268
  "proc-macro2",
@@ -319,21 +280,6 @@ 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.72"
363
303
  source = "registry+https://github.com/rust-lang/crates.io-index"
364
- checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
304
+ checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
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.15"
374
314
  source = "registry+https://github.com/rust-lang/crates.io-index"
375
- checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
315
+ checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"
376
316
 
377
317
  [[package]]
378
318
  name = "typenum"
@@ -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"] }
9
+ pyo3 = { version = "0.22", features = ["abi3"] }
10
10
  bcrypt = "0.15"
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,7 +13,7 @@
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
19
  use std::io::Write;
@@ -24,7 +24,8 @@ pub const BASE64_ENGINE: base64::engine::GeneralPurpose = base64::engine::Genera
24
24
  base64::engine::general_purpose::NO_PAD,
25
25
  );
26
26
 
27
- #[pyo3::prelude::pyfunction]
27
+ #[pyo3::pyfunction]
28
+ #[pyo3(signature = (rounds=None, prefix=None))]
28
29
  fn gensalt<'p>(
29
30
  py: pyo3::Python<'p>,
30
31
  rounds: Option<u16>,
@@ -64,7 +65,7 @@ fn gensalt<'p>(
64
65
  )
65
66
  }
66
67
 
67
- #[pyo3::prelude::pyfunction]
68
+ #[pyo3::pyfunction]
68
69
  fn hashpw<'p>(
69
70
  py: pyo3::Python<'p>,
70
71
  password: &[u8],
@@ -119,7 +120,7 @@ fn hashpw<'p>(
119
120
  ))
120
121
  }
121
122
 
122
- #[pyo3::prelude::pyfunction]
123
+ #[pyo3::pyfunction]
123
124
  fn checkpw(py: pyo3::Python<'_>, password: &[u8], hashed_password: &[u8]) -> pyo3::PyResult<bool> {
124
125
  Ok(hashpw(py, password, hashed_password)?
125
126
  .as_bytes()
@@ -127,17 +128,16 @@ fn checkpw(py: pyo3::Python<'_>, password: &[u8], hashed_password: &[u8]) -> pyo
127
128
  .into())
128
129
  }
129
130
 
130
- #[pyo3::prelude::pyfunction]
131
+ #[pyo3::pyfunction]
132
+ #[pyo3(signature = (password, salt, desired_key_bytes, rounds, ignore_few_rounds=false))]
131
133
  fn kdf<'p>(
132
134
  py: pyo3::Python<'p>,
133
135
  password: &[u8],
134
136
  salt: &[u8],
135
137
  desired_key_bytes: usize,
136
138
  rounds: u32,
137
- ignore_few_rounds: Option<bool>,
139
+ ignore_few_rounds: bool,
138
140
  ) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
139
- let ignore_few_rounds = ignore_few_rounds.unwrap_or(false);
140
-
141
141
  if password.is_empty() || salt.is_empty() {
142
142
  return Err(pyo3::exceptions::PyValueError::new_err(
143
143
  "password and salt must not be empty",
@@ -176,34 +176,35 @@ fn kdf<'p>(
176
176
  })
177
177
  }
178
178
 
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(())
179
+ #[pyo3::pymodule]
180
+ mod _bcrypt {
181
+ use pyo3::types::PyModuleMethods;
182
+
183
+ #[pymodule_export]
184
+ use super::{checkpw, gensalt, hashpw, kdf};
185
+
186
+ // Not yet possible to add constants declaratively.
187
+ #[pymodule_init]
188
+ fn init(m: &pyo3::Bound<'_, pyo3::types::PyModule>) -> pyo3::PyResult<()> {
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.2.0")?;
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(())
209
+ }
209
210
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcrypt
3
- Version: 4.1.3
3
+ Version: 4.2.0
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
@@ -78,6 +78,12 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
78
  Changelog
79
79
  =========
80
80
 
81
+ 4.2.0
82
+ -----
83
+
84
+ * Bump Rust dependency versions
85
+ * Removed the ``BCRYPT_ALLOW_RUST_163`` environment variable.
86
+
81
87
  4.1.3
82
88
  -----
83
89
 
@@ -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