python-nss-ng 1.2.0__tar.gz → 1.2.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 (132) hide show
  1. python_nss_ng-1.2.2/.git_archival.txt +4 -0
  2. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/PKG-INFO +1 -1
  3. python_nss_ng-1.2.2/_version.txt +1 -0
  4. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/pyproject.toml +0 -6
  5. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/__init__.py +2 -1
  6. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/nss_context.py +2 -0
  7. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/secure_logging.py +1 -6
  8. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/setup_certs.py +1 -1
  9. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_client_server.py +5 -3
  10. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/uv.lock +0 -4
  11. python_nss_ng-1.2.0/.git_archival.txt +0 -4
  12. python_nss_ng-1.2.0/_version.txt +0 -1
  13. python_nss_ng-1.2.0/mutants/pyproject.toml +0 -216
  14. python_nss_ng-1.2.0/mutants/src/deprecations.py +0 -539
  15. python_nss_ng-1.2.0/mutants/src/deprecations.py.meta +0 -26
  16. python_nss_ng-1.2.0/mutants/src/nss_context.py +0 -828
  17. python_nss_ng-1.2.0/mutants/src/nss_context.py.meta +0 -39
  18. python_nss_ng-1.2.0/mutants/src/secure_logging.py +0 -5602
  19. python_nss_ng-1.2.0/mutants/src/secure_logging.py.meta +0 -201
  20. python_nss_ng-1.2.0/mutants/test/conftest.py +0 -409
  21. python_nss_ng-1.2.0/mutants/test/exceptions.py +0 -69
  22. python_nss_ng-1.2.0/mutants/test/run_tests +0 -78
  23. python_nss_ng-1.2.0/mutants/test/setup_certs.py +0 -623
  24. python_nss_ng-1.2.0/mutants/test/test_cert_components.py +0 -330
  25. python_nss_ng-1.2.0/mutants/test/test_cert_request.py +0 -202
  26. python_nss_ng-1.2.0/mutants/test/test_certificate_advanced.py +0 -563
  27. python_nss_ng-1.2.0/mutants/test/test_cipher.py +0 -175
  28. python_nss_ng-1.2.0/mutants/test/test_client_server.py +0 -427
  29. python_nss_ng-1.2.0/mutants/test/test_deprecations.py +0 -207
  30. python_nss_ng-1.2.0/mutants/test/test_digest.py +0 -115
  31. python_nss_ng-1.2.0/mutants/test/test_documentation_accuracy.py +0 -432
  32. python_nss_ng-1.2.0/mutants/test/test_error_messages.py +0 -390
  33. python_nss_ng-1.2.0/mutants/test/test_examples.py +0 -471
  34. python_nss_ng-1.2.0/mutants/test/test_integration.py +0 -574
  35. python_nss_ng-1.2.0/mutants/test/test_misc.py +0 -48
  36. python_nss_ng-1.2.0/mutants/test/test_nss_context.py +0 -558
  37. python_nss_ng-1.2.0/mutants/test/test_ocsp.py +0 -378
  38. python_nss_ng-1.2.0/mutants/test/test_performance.py +0 -469
  39. python_nss_ng-1.2.0/mutants/test/test_pkcs12.py +0 -323
  40. python_nss_ng-1.2.0/mutants/test/test_platform_specific.py +0 -450
  41. python_nss_ng-1.2.0/mutants/test/test_property_based.py +0 -385
  42. python_nss_ng-1.2.0/mutants/test/test_secure_logging.py +0 -314
  43. python_nss_ng-1.2.0/mutants/test/test_security.py +0 -474
  44. python_nss_ng-1.2.0/mutants/test/test_thread_safety.py +0 -551
  45. python_nss_ng-1.2.0/mutants/test/test_type_hints.py +0 -328
  46. python_nss_ng-1.2.0/mutants/test/test_util.py +0 -365
  47. python_nss_ng-1.2.0/mutants/test/util.py +0 -144
  48. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/.clangd +0 -0
  49. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/CONTRIBUTING.md +0 -0
  50. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/LICENSE +0 -0
  51. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/LICENSE.gpl +0 -0
  52. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/LICENSE.lgpl +0 -0
  53. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/LICENSE.mpl +0 -0
  54. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/LICENSES/Apache-2.0.txt +0 -0
  55. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/LICENSES/MPL-2.0.txt +0 -0
  56. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/MANIFEST.in +0 -0
  57. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/Makefile +0 -0
  58. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/QUICKSTART.md +0 -0
  59. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/README.md +0 -0
  60. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/REUSE.toml +0 -0
  61. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/SECURITY.md +0 -0
  62. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/ChangeLog +0 -0
  63. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/MAKEFILE_MIGRATION.md +0 -0
  64. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/MANYLINUX_CONFIG.md +0 -0
  65. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/MIGRATION.md +0 -0
  66. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/MUTATION_TESTING.md +0 -0
  67. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/TESTING.md +0 -0
  68. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/cert_dump.py +0 -0
  69. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/cert_trust.py +0 -0
  70. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/httplib_example.py +0 -0
  71. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/pbkdf2_example.py +0 -0
  72. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/ssl_cipher_info.py +0 -0
  73. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/ssl_example.py +0 -0
  74. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/ssl_version_range.py +0 -0
  75. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/verify_cert.py +0 -0
  76. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/examples/verify_server.py +0 -0
  77. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/doc/get_api +0 -0
  78. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/meson.build +0 -0
  79. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/pyrightconfig.json +0 -0
  80. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/scripts/README.md +0 -0
  81. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/scripts/meson-version.py +0 -0
  82. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/scripts/run-all-tests.sh +0 -0
  83. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/NSPRerrs.h +0 -0
  84. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/SECerrs.h +0 -0
  85. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/SSLerrs.h +0 -0
  86. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/deprecations.py +0 -0
  87. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/io.pyi +0 -0
  88. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/nss.pyi +0 -0
  89. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_nspr_common.h +0 -0
  90. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_nspr_error.c +0 -0
  91. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_nspr_error.h +0 -0
  92. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_nspr_io.c +0 -0
  93. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_nspr_io.h +0 -0
  94. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_nss.c +0 -0
  95. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_nss.h +0 -0
  96. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_shared_doc.h +0 -0
  97. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_ssl.c +0 -0
  98. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_ssl.h +0 -0
  99. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/py_traceback.h +0 -0
  100. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/src/ssl.pyi +0 -0
  101. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/conftest.py +0 -0
  102. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/exceptions.py +0 -0
  103. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/run_tests +0 -0
  104. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_cert_components.py +0 -0
  105. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_cert_request.py +0 -0
  106. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_certificate_advanced.py +0 -0
  107. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_cipher.py +0 -0
  108. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_deprecations.py +0 -0
  109. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_digest.py +0 -0
  110. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_documentation_accuracy.py +0 -0
  111. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_examples.py +0 -0
  112. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_misc.py +0 -0
  113. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_performance.py +0 -0
  114. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_pkcs12.py +0 -0
  115. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_platform_specific.py +0 -0
  116. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_property_based.py +0 -0
  117. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_secure_logging.py +0 -0
  118. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_security.py +0 -0
  119. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_thread_safety.py +0 -0
  120. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_type_hints.py +0 -0
  121. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_util.py +0 -0
  122. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_zzz_error_messages.py +0 -0
  123. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_zzz_integration.py +0 -0
  124. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_zzz_nonexistent_certs.py +0 -0
  125. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_zzz_nss_context.py +0 -0
  126. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/test_zzz_ocsp.py +0 -0
  127. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/test/util.py +0 -0
  128. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/typings/nss/__init__.pyi +0 -0
  129. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/typings/nss/error.pyi +0 -0
  130. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/typings/nss/io.pyi +0 -0
  131. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/typings/nss/nss.pyi +0 -0
  132. {python_nss_ng-1.2.0 → python_nss_ng-1.2.2}/typings/nss/ssl.pyi +0 -0
@@ -0,0 +1,4 @@
1
+ node: 4d19efef4853c086fe11b35c259d6c27b2e02655
2
+ node-date: 2026-07-22T14:08:02+01:00
3
+ describe-name: v1.2.2
4
+ ref-names: grafted, HEAD, tag: v1.2.2, origin/main, origin/HEAD
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-nss-ng
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Python bindings for Network Security Services (NSS) and Netscape Portable Runtime (NSPR)
5
5
  Keywords: nss,nspr,cryptography,ssl,tls,pki,x509,security
6
6
  Author-Email: John Dennis <jdennis@redhat.com>, Matthew Watkins <mwatkins@linuxfoundation.org>
@@ -0,0 +1 @@
1
+ 1.2.2
@@ -319,9 +319,3 @@ before-all = "yum install -y nss-devel nspr-devel pkg-config || apt-get update &
319
319
 
320
320
  [tool.cibuildwheel.macos]
321
321
  before-all = "brew install nss nspr pkg-config"
322
-
323
- [tool.uv]
324
- # Supply-chain cooldown: do not resolve anything published in the last
325
- # 7 days (rolling window; uv records it as a relative span in uv.lock).
326
- # Requires uv >= 0.9.17 for the relative-duration ("7 days") form.
327
- exclude-newer = "7 days"
@@ -4,6 +4,8 @@
4
4
  # SPDX-License-Identifier: MPL-2.0
5
5
  # SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
6
6
 
7
+ # aislop-ignore-file ai-slop/unused-import -- "import" lines flagged here are RST code examples inside a documentation string, not real imports (ruff F401 validates the real ones)
8
+
7
9
  import sys
8
10
  from importlib.metadata import PackageNotFoundError
9
11
  from importlib.metadata import version as _pkg_version
@@ -154,7 +156,6 @@ Things All NSS programs must do
154
156
 
155
157
  - Import the NSS/NSPR modules::
156
158
 
157
- from nss.error import NSPRError
158
159
  import nss.io as io
159
160
  import nss.nss as nss
160
161
  import nss.ssl as ssl
@@ -29,6 +29,8 @@ import logging
29
29
  from collections.abc import Callable, Generator
30
30
  from typing import Any
31
31
 
32
+ # aislop-ignore-file ai-slop/hallucinated-import -- "nss" is this package's own compiled C-extension module (built from py_nss.c)
33
+
32
34
  logger = logging.getLogger(__name__)
33
35
 
34
36
 
@@ -127,7 +127,6 @@ def check_message_safety(message: str) -> LogSensitivity:
127
127
  """
128
128
  message_lower = message.lower()
129
129
 
130
- # Check for forbidden patterns
131
130
  for pattern in FORBIDDEN_LOG_PATTERNS:
132
131
  if pattern in message_lower:
133
132
  return LogSensitivity.SENSITIVE
@@ -272,7 +271,6 @@ def log_exception_safely(
272
271
  # Log only the exception type and context
273
272
  msg = f"{context}: {exc_type} occurred (details redacted for security)"
274
273
  elif sensitivity == LogSensitivity.REDACTED:
275
- # Log with redaction
276
274
  msg = f"{context}: {exc_type}: {redact_message(exc_message)}"
277
275
  else:
278
276
  # Safe to log
@@ -329,23 +327,20 @@ class SecureExceptionHandler:
329
327
 
330
328
  def __exit__(self, exc_type, exc_val, exc_tb):
331
329
  if exc_type is not None:
332
- # Log the exception securely
330
+
333
331
  def logger_fn(msg: str) -> None:
334
332
  self.logger.log(self.log_level, msg)
335
333
 
336
334
  log_exception_safely(logger_fn, exc_val, self.context)
337
335
 
338
- # Return False to re-raise, True to suppress
339
336
  return not self.reraise
340
337
  return None
341
338
 
342
339
 
343
340
  # Example usage patterns
344
341
  if __name__ == "__main__":
345
- # Configure logging
346
342
  logging.basicConfig(level=logging.DEBUG)
347
343
 
348
- # Create secure logger
349
344
  logger = get_secure_logger(__name__)
350
345
 
351
346
  # Safe logging
@@ -667,7 +667,7 @@ def setup_certs(args):
667
667
  logging.info('Certificate nickname "%s"\n%s', nickname, format_cert(options, nickname))
668
668
 
669
669
  logging.info("---------- Summary ----------")
670
- logging.info('NSS database name="%s", password="%s"', options.db_name, options.db_passwd)
670
+ logging.info('NSS database name="%s", password="[REDACTED]"', options.db_name)
671
671
  logging.info("system FIPS mode=%s", get_system_fips_enabled())
672
672
  logging.info("DB FIPS mode=%s", get_db_fips_enabled(options.db_name))
673
673
  logging.info('CA nickname="%s", CA subject="%s"', options.ca_nickname, options.ca_subject)
@@ -272,7 +272,7 @@ def get_free_port():
272
272
  happens quickly enough that this is rarely an issue in practice.
273
273
  """
274
274
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
275
- s.bind(("", 0))
275
+ s.bind(("127.0.0.1", 0))
276
276
  s.listen(1)
277
277
  port = s.getsockname()[1]
278
278
  return port
@@ -283,8 +283,10 @@ def server(test_port):
283
283
  print("starting server:")
284
284
 
285
285
  # Initialize
286
- # Setup an IP Address to listen on any of our interfaces
287
- net_addr = io.NetworkAddress(io.PR_IpAddrAny, test_port)
286
+ # Setup an IP Address to listen on the loopback interface only.
287
+ # The tests are entirely local (the client connects via localhost),
288
+ # so there is no need to listen on all interfaces.
289
+ net_addr = io.NetworkAddress(io.PR_IpAddrLoopback, test_port)
288
290
 
289
291
  if use_ssl:
290
292
  if info:
@@ -9,10 +9,6 @@ resolution-markers = [
9
9
  "python_full_version < '3.12'",
10
10
  ]
11
11
 
12
- [options]
13
- exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values.
14
- exclude-newer-span = "P7D"
15
-
16
12
  [[package]]
17
13
  name = "ast-serialize"
18
14
  version = "0.3.0"
@@ -1,4 +0,0 @@
1
- node: e6e197516189faac861f191a6a48f0e1d993ef3d
2
- node-date: 2026-06-12T13:13:22-06:00
3
- describe-name: v1.2.0
4
- ref-names: grafted, HEAD, tag: v1.2.0, origin/main, origin/HEAD
@@ -1 +0,0 @@
1
- 1.2.0
@@ -1,216 +0,0 @@
1
- # SPDX-License-Identifier: MPL-2.0
2
- # SPDX-FileCopyrightText: 2025 The Linux Foundation
3
-
4
- [build-system]
5
- requires = [
6
- "meson-python>=0.18.0",
7
- "meson>=1.10.0",
8
- "ninja",
9
- ]
10
- build-backend = "mesonpy"
11
-
12
- [project]
13
- name = "python-nss-ng"
14
- version = "1.0.1"
15
- description = "Python bindings for Network Security Services (NSS) and Netscape Portable Runtime (NSPR)"
16
- readme = "README.md"
17
- license = "MPL-2.0 OR GPL-2.0-or-later OR LGPL-2.0-or-later"
18
- license-files = ["LICENSE", "LICENSES/MPL-2.0.txt"]
19
- requires-python = ">=3.10"
20
- authors = [
21
- {name = "John Dennis", email = "jdennis@redhat.com"},
22
- {name = "Matthew Watkins", email = "mwatkins@linuxfoundation.org"},
23
- ]
24
- maintainers = [
25
- {name = "Matthew Watkins", email = "mwatkins@linuxfoundation.org"},
26
- ]
27
- keywords = [
28
- "nss",
29
- "nspr",
30
- "cryptography",
31
- "ssl",
32
- "tls",
33
- "pki",
34
- "x509",
35
- "security",
36
- ]
37
- classifiers = [
38
- "Development Status :: 5 - Production/Stable",
39
- "Intended Audience :: Developers",
40
-
41
- "Operating System :: POSIX",
42
- "Operating System :: POSIX :: Linux",
43
- "Operating System :: MacOS",
44
- "Programming Language :: C",
45
- "Programming Language :: Python :: 3",
46
- "Programming Language :: Python :: 3.10",
47
- "Programming Language :: Python :: 3.11",
48
- "Programming Language :: Python :: 3.12",
49
- "Programming Language :: Python :: 3.13",
50
- "Programming Language :: Python :: 3.14",
51
- "Programming Language :: Python :: Implementation :: CPython",
52
- "Topic :: Security",
53
- "Topic :: Security :: Cryptography",
54
- "Topic :: Software Development :: Libraries :: Python Modules",
55
- ]
56
-
57
- [project.optional-dependencies]
58
- test = [
59
- "pytest>=9.0.2",
60
- "pytest-cov>=7.0.0",
61
- "coverage[toml]>=7.13.1",
62
- "pytest-xdist>=3.8.0",
63
- "mypy>=1.0.0",
64
- "hypothesis>=6.0.0",
65
- "mutmut>=2.4.0",
66
- "meson>=1.10.0",
67
- "meson-python>=0.18.0",
68
- "ninja",
69
- ]
70
- dev = [
71
- "pytest>=9.0.2",
72
- "pytest-cov>=7.0.0",
73
- "coverage[toml]>=7.13.1",
74
- "pytest-xdist>=3.8.0",
75
- "mypy>=1.0.0",
76
- "hypothesis>=6.0.0",
77
- "mutmut>=2.4.0",
78
- "ruff>=0.14.10",
79
- "build>=1.3.0",
80
- "meson>=1.10.0",
81
- "meson-python>=0.18.0",
82
- "ninja",
83
- ]
84
-
85
- [project.urls]
86
- Homepage = "http://www.mozilla.org/projects/security/pki/python-nss-ng"
87
- Documentation = "http://www.mozilla.org/projects/security/pki/python-nss-ng"
88
- Repository = "https://github.com/lfreleng-actions/python-nss-ng"
89
- Issues = "https://github.com/lfreleng-actions/python-nss-ng/issues"
90
-
91
- [tool.meson-python.args]
92
- # Meson build arguments can be specified here if needed
93
- # For example, to enable debug builds:
94
- # setup = ['-Dbuildtype=debug']
95
-
96
- [tool.pytest.ini_options]
97
- testpaths = ["test"]
98
- python_files = ["test_*.py"]
99
- python_classes = ["Test*"]
100
- python_functions = ["test_*"]
101
- # Note: Use -n0 for serial execution for 100% reliability
102
- # Parallel execution (-n=auto) may have intermittent failures in PKCS12 tests
103
- addopts = [
104
- "-v",
105
- "--strict-markers",
106
- "--tb=short",
107
- "--cov=nss",
108
- "--cov-report=xml",
109
- "--cov-report=html",
110
- ]
111
- markers = [
112
- "nss_init: mark test as requiring NSS initialization",
113
- "requires_db: mark test as requiring NSS database",
114
- "slow: mark test as slow running",
115
- "allow_insecure: mark test as allowing insecure/legacy configurations",
116
- ]
117
-
118
- [tool.coverage.run]
119
- source = ["nss"]
120
- branch = true
121
- data_file = ".coverage"
122
- omit = [
123
- "*/test/*",
124
- "*/tests/*",
125
- "*/_version.py",
126
- ]
127
-
128
- [tool.coverage.xml]
129
- output = "coverage.xml"
130
-
131
- [tool.coverage.report]
132
- exclude_lines = [
133
- "pragma: no cover",
134
- "def __repr__",
135
- "raise AssertionError",
136
- "raise NotImplementedError",
137
- "if __name__ == .__main__.:",
138
- "if TYPE_CHECKING:",
139
- ]
140
-
141
- [tool.ruff]
142
- line-length = 100
143
- target-version = "py39"
144
- exclude = [
145
- ".git",
146
- "__pycache__",
147
- "build",
148
- "dist",
149
- ".eggs",
150
- "*.egg-info",
151
- ".pytest_cache",
152
- ]
153
-
154
- [tool.ruff.lint]
155
- select = [
156
- "E", # pycodestyle errors
157
- "W", # pycodestyle warnings
158
- "F", # pyflakes
159
- "I", # isort
160
- "B", # flake8-bugbear
161
- "C4", # flake8-comprehensions
162
- "UP", # pyupgrade
163
- "S", # flake8-bandit (security)
164
- "T20", # flake8-print
165
- "PT", # flake8-pytest-style
166
- "RET", # flake8-return
167
- "SIM", # flake8-simplify
168
- "TCH", # flake8-type-checking
169
- "RUF", # Ruff-specific rules
170
- ]
171
- ignore = [
172
- "E501", # line too long, handled by formatter
173
- "B008", # do not perform function calls in argument defaults
174
- "C901", # too complex
175
- "S101", # assert detected (allow in tests)
176
- "T201", # print found (intentional in examples)
177
- "UP006", # Use `X` instead of `typing.X` for type annotations (Python 3.9 compat)
178
- "UP007", # Use `X | Y` for union types (Python 3.9 compat)
179
- "UP035", # Import from `typing` is deprecated (Python 3.9 compat)
180
- ]
181
-
182
- [tool.ruff.lint.per-file-ignores]
183
- "test_*.py" = ["E402", "S101", "S105", "S106"] # Allow asserts and hardcoded passwords in tests
184
- "doc/examples/*.py" = ["T201", "S105", "S106"] # Allow prints and test passwords in examples
185
- "test/setup_certs.py" = ["S603", "S607"] # Allow subprocess calls in cert setup
186
-
187
- [tool.ruff.lint.isort]
188
- known-first-party = ["nss"]
189
-
190
- [tool.mypy]
191
- python_version = "3.9"
192
- warn_unused_ignores = true
193
- disallow_any_generics = true
194
- disallow_incomplete_defs = true
195
- no_implicit_optional = true
196
- strict_equality = true
197
- warn_redundant_casts = true
198
- warn_return_any = true
199
- check_untyped_defs = true
200
-
201
- [tool.mutmut]
202
- paths_to_mutate = ["src/deprecations.py", "src/secure_logging.py", "src/nss_context.py"]
203
- backup = false
204
- runner = "python -m pytest -x -q"
205
- tests_dir = "test/"
206
- dict_synonyms = ["Struct", "Named"]
207
-
208
- [tool.cibuildwheel]
209
- skip = ["pp*", "*-musllinux*"]
210
- build-verbosity = 1
211
-
212
- [tool.cibuildwheel.linux]
213
- before-all = "yum install -y nss-devel nspr-devel pkg-config || apt-get update && apt-get install -y libnss3-dev libnspr4-dev pkg-config"
214
-
215
- [tool.cibuildwheel.macos]
216
- before-all = "brew install nss nspr pkg-config"