python-nss-ng 1.2.2__tar.gz → 1.3.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.
- python_nss_ng-1.3.0/.aislop/config.yml +20 -0
- python_nss_ng-1.3.0/.git_archival.txt +4 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/PKG-INFO +1 -1
- python_nss_ng-1.3.0/_version.txt +1 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_nspr_error.h +2 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_nspr_io.c +4 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_nspr_io.h +3 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_nss.c +4 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_nss.h +2 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_ssl.c +4 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_ssl.h +2 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_documentation_accuracy.py +4 -12
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_performance.py +21 -14
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_platform_specific.py +3 -3
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_type_hints.py +7 -5
- python_nss_ng-1.2.2/.git_archival.txt +0 -4
- python_nss_ng-1.2.2/_version.txt +0 -1
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/.clangd +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/CONTRIBUTING.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/LICENSE +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/LICENSE.gpl +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/LICENSE.lgpl +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/LICENSE.mpl +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/LICENSES/Apache-2.0.txt +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/LICENSES/MPL-2.0.txt +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/MANIFEST.in +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/Makefile +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/QUICKSTART.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/README.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/REUSE.toml +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/SECURITY.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/ChangeLog +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/MAKEFILE_MIGRATION.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/MANYLINUX_CONFIG.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/MIGRATION.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/MUTATION_TESTING.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/TESTING.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/cert_dump.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/cert_trust.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/httplib_example.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/pbkdf2_example.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/ssl_cipher_info.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/ssl_example.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/ssl_version_range.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/verify_cert.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/examples/verify_server.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/doc/get_api +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/meson.build +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/pyproject.toml +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/pyrightconfig.json +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/scripts/README.md +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/scripts/meson-version.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/scripts/run-all-tests.sh +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/NSPRerrs.h +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/SECerrs.h +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/SSLerrs.h +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/__init__.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/deprecations.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/io.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/nss.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/nss_context.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_nspr_common.h +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_nspr_error.c +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_shared_doc.h +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/py_traceback.h +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/secure_logging.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/src/ssl.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/conftest.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/exceptions.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/run_tests +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/setup_certs.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_cert_components.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_cert_request.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_certificate_advanced.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_cipher.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_client_server.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_deprecations.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_digest.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_examples.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_misc.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_pkcs12.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_property_based.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_secure_logging.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_security.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_thread_safety.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_util.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_zzz_error_messages.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_zzz_integration.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_zzz_nonexistent_certs.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_zzz_nss_context.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/test_zzz_ocsp.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/test/util.py +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/typings/nss/__init__.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/typings/nss/error.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/typings/nss/io.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/typings/nss/nss.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/typings/nss/ssl.pyi +0 -0
- {python_nss_ng-1.2.2 → python_nss_ng-1.3.0}/uv.lock +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
|
3
|
+
|
|
4
|
+
# aislop quality gate configuration.
|
|
5
|
+
#
|
|
6
|
+
# The repository scans clean, so hold `aislop ci` at the strictest
|
|
7
|
+
# score the tool offers rather than the default 70.
|
|
8
|
+
#
|
|
9
|
+
# Note the limit of a score gate: aislop normalises the score by file
|
|
10
|
+
# count and rounds it, so a single low-weight finding (a stray
|
|
11
|
+
# python-formatting warning, say) still rounds to 100 and passes.
|
|
12
|
+
# Failing on any finding at all needs a step that gates on the
|
|
13
|
+
# diagnostic count in `aislop scan --json`, not on the score.
|
|
14
|
+
#
|
|
15
|
+
# The C sources under src/ come from upstream python-nss; they carry
|
|
16
|
+
# narrow, per-rule `aislop-ignore-file` directives in place of a blanket
|
|
17
|
+
# exclusion, so every other rule (including the security engine) still
|
|
18
|
+
# runs against them.
|
|
19
|
+
ci:
|
|
20
|
+
failBelow: 100
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-nss-ng
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
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.3.0
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// aislop-ignore-file ai-slop/todo-stub -- maintainer notes carried from upstream python-nss
|
|
9
|
+
// aislop-ignore-file ai-slop/unreachable-code -- goto targets and the break after return in switch cases
|
|
10
|
+
// aislop-ignore-file complexity/file-too-large -- upstream extension module is a single translation unit
|
|
11
|
+
|
|
8
12
|
// FIXME: add detail to each set_nspr_error()
|
|
9
13
|
// FIXME: should nspr exception be derived from IOError? Note our detail is IOError's filename
|
|
10
14
|
// FIXME: add factory functions for TCPSocket, UDPSocket
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// aislop-ignore-file ai-slop/todo-stub -- maintainer notes carried from upstream python-nss
|
|
9
|
+
// aislop-ignore-file ai-slop/trivial-comment -- upstream decorative section banners
|
|
10
|
+
|
|
8
11
|
#ifndef NSS_IO_MODULE_H
|
|
9
12
|
#define NSS_IO_MODULE_H
|
|
10
13
|
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// aislop-ignore-file ai-slop/todo-stub -- maintainer notes carried from upstream python-nss
|
|
9
|
+
// aislop-ignore-file ai-slop/unreachable-code -- goto targets and the break after return in switch cases
|
|
10
|
+
// aislop-ignore-file complexity/file-too-large -- upstream extension module is a single translation unit
|
|
11
|
+
|
|
8
12
|
#if 0
|
|
9
13
|
|
|
10
14
|
//Template for new classes
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// aislop-ignore-file ai-slop/todo-stub -- maintainer notes carried from upstream python-nss
|
|
9
|
+
|
|
8
10
|
// FIXME: some of these class types have items in them with arenas, but we can't hold a reference
|
|
9
11
|
// to an arena, so check to make sure we copy the items out and don't store the
|
|
10
12
|
// the item with the arena in it.
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// aislop-ignore-file ai-slop/todo-stub -- maintainer notes carried from upstream python-nss
|
|
9
|
+
// aislop-ignore-file ai-slop/unreachable-code -- goto targets and the break after return in switch cases
|
|
10
|
+
// aislop-ignore-file complexity/file-too-large -- upstream extension module is a single translation unit
|
|
11
|
+
|
|
8
12
|
// FIXME: sometimes in the API dist_name is used and sometimes ca_name, make consistent.
|
|
9
13
|
// FIXME: PyIntObjects represent their value as a long, but in many places we declared their C representation as
|
|
10
14
|
// as int, we should change it to long, and at the same time match the parameters used in the NSPR/NSS API
|
|
@@ -335,19 +335,11 @@ class TestDocumentationCompleteness:
|
|
|
335
335
|
if not doc_dir.exists():
|
|
336
336
|
pytest.skip("doc directory not found")
|
|
337
337
|
|
|
338
|
-
|
|
339
|
-
md_files = list(doc_dir.glob("*.md"))
|
|
340
|
-
filenames = [f.name.lower() for f in md_files]
|
|
341
|
-
|
|
342
|
-
# Should have some testing documentation
|
|
343
|
-
has_test_docs = any("test" in name for name in filenames)
|
|
338
|
+
filenames = sorted(path.name.lower() for path in doc_dir.glob("*.md"))
|
|
344
339
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
else:
|
|
349
|
-
# Just document that test docs are recommended
|
|
350
|
-
pass
|
|
340
|
+
assert any("test" in name for name in filenames), (
|
|
341
|
+
f"doc/ should document the test suite, found: {filenames}"
|
|
342
|
+
)
|
|
351
343
|
|
|
352
344
|
def test_api_reference_or_stubs_exist(self):
|
|
353
345
|
"""Test that API reference or type stubs exist."""
|
|
@@ -180,6 +180,7 @@ class TestMemoryUsage:
|
|
|
180
180
|
|
|
181
181
|
# Force garbage collection
|
|
182
182
|
gc.collect()
|
|
183
|
+
baseline_blocks = sys.getallocatedblocks()
|
|
183
184
|
|
|
184
185
|
# Perform many digest operations
|
|
185
186
|
for _ in range(iterations):
|
|
@@ -189,8 +190,11 @@ class TestMemoryUsage:
|
|
|
189
190
|
# Force garbage collection
|
|
190
191
|
gc.collect()
|
|
191
192
|
|
|
192
|
-
#
|
|
193
|
-
|
|
193
|
+
# sha256_digest returns bytes, which the cyclic GC does not track, so
|
|
194
|
+
# count CPython allocator blocks instead: a retained result costs one
|
|
195
|
+
# block per iteration. Native NSS allocations stay invisible here.
|
|
196
|
+
growth = sys.getallocatedblocks() - baseline_blocks
|
|
197
|
+
assert growth < iterations // 10, f"Digest operations leaked {growth} blocks"
|
|
194
198
|
|
|
195
199
|
@pytest.mark.slow
|
|
196
200
|
def test_certificate_reference_memory(self, nss_db_context):
|
|
@@ -199,6 +203,7 @@ class TestMemoryUsage:
|
|
|
199
203
|
|
|
200
204
|
# Force garbage collection
|
|
201
205
|
gc.collect()
|
|
206
|
+
baseline_blocks = sys.getallocatedblocks()
|
|
202
207
|
|
|
203
208
|
for _ in range(iterations):
|
|
204
209
|
try:
|
|
@@ -213,8 +218,10 @@ class TestMemoryUsage:
|
|
|
213
218
|
# Force garbage collection
|
|
214
219
|
gc.collect()
|
|
215
220
|
|
|
216
|
-
#
|
|
217
|
-
|
|
221
|
+
# CertificateType carries no Py_TPFLAGS_HAVE_GC, so a retained wrapper
|
|
222
|
+
# never reaches gc.get_objects(); it does cost an allocator block.
|
|
223
|
+
growth = sys.getallocatedblocks() - baseline_blocks
|
|
224
|
+
assert growth < iterations // 10, f"Certificate lookups leaked {growth} blocks"
|
|
218
225
|
|
|
219
226
|
@pytest.mark.slow
|
|
220
227
|
def test_digest_context_memory(self, nss_db_context):
|
|
@@ -223,6 +230,7 @@ class TestMemoryUsage:
|
|
|
223
230
|
|
|
224
231
|
# Force garbage collection
|
|
225
232
|
gc.collect()
|
|
233
|
+
baseline_blocks = sys.getallocatedblocks()
|
|
226
234
|
|
|
227
235
|
for _ in range(iterations):
|
|
228
236
|
context = nss.create_digest_context(nss.SEC_OID_SHA256)
|
|
@@ -235,8 +243,10 @@ class TestMemoryUsage:
|
|
|
235
243
|
# Force garbage collection
|
|
236
244
|
gc.collect()
|
|
237
245
|
|
|
238
|
-
#
|
|
239
|
-
|
|
246
|
+
# PK11ContextType is likewise untracked by the cyclic GC; the allocator
|
|
247
|
+
# block count still rises by one per retained context.
|
|
248
|
+
growth = sys.getallocatedblocks() - baseline_blocks
|
|
249
|
+
assert growth < iterations // 10, f"Digest contexts leaked {growth} blocks"
|
|
240
250
|
|
|
241
251
|
|
|
242
252
|
class TestStressConditions:
|
|
@@ -268,18 +278,17 @@ class TestStressConditions:
|
|
|
268
278
|
def test_rapid_context_creation_destruction(self, nss_db_context):
|
|
269
279
|
"""Test rapid creation and destruction of contexts."""
|
|
270
280
|
iterations = 500
|
|
281
|
+
expected = nss.sha256_digest(b"test")
|
|
271
282
|
|
|
272
283
|
for _ in range(iterations):
|
|
273
284
|
context = nss.create_digest_context(nss.SEC_OID_SHA256)
|
|
274
285
|
context.digest_begin()
|
|
275
286
|
context.digest_op(b"test")
|
|
276
287
|
digest = context.digest_final()
|
|
277
|
-
|
|
288
|
+
# Rapid churn must not carry state between contexts
|
|
289
|
+
assert digest == expected
|
|
278
290
|
# Context destroyed immediately
|
|
279
291
|
|
|
280
|
-
# Should handle rapid churn
|
|
281
|
-
assert True
|
|
282
|
-
|
|
283
292
|
@pytest.mark.slow
|
|
284
293
|
def test_large_data_chunks(self, nss_db_context):
|
|
285
294
|
"""Test processing very large data."""
|
|
@@ -296,13 +305,11 @@ class TestStressConditions:
|
|
|
296
305
|
"""Test many small operations in sequence."""
|
|
297
306
|
iterations = 5000
|
|
298
307
|
test_data = b"small"
|
|
308
|
+
expected = nss.sha256_digest(test_data)
|
|
299
309
|
|
|
300
310
|
for _ in range(iterations):
|
|
301
311
|
digest = nss.sha256_digest(test_data)
|
|
302
|
-
assert digest
|
|
303
|
-
|
|
304
|
-
# Should handle many small operations
|
|
305
|
-
assert True
|
|
312
|
+
assert digest == expected
|
|
306
313
|
|
|
307
314
|
|
|
308
315
|
class TestConcurrentPerformance:
|
|
@@ -12,6 +12,7 @@ import os
|
|
|
12
12
|
import platform
|
|
13
13
|
import subprocess
|
|
14
14
|
import sys
|
|
15
|
+
import sysconfig
|
|
15
16
|
import tempfile
|
|
16
17
|
|
|
17
18
|
import pytest
|
|
@@ -439,9 +440,8 @@ class TestCrossPlatformCompatibility:
|
|
|
439
440
|
# Windows: .exe
|
|
440
441
|
if sys.platform.startswith("win"):
|
|
441
442
|
pytest.skip("Windows not supported")
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
assert True
|
|
443
|
+
|
|
444
|
+
assert sysconfig.get_config_var("EXE") == ""
|
|
445
445
|
|
|
446
446
|
|
|
447
447
|
if __name__ == "__main__":
|
|
@@ -52,12 +52,13 @@ class TestTypeHints:
|
|
|
52
52
|
def test_mypy_available(self):
|
|
53
53
|
"""Test if mypy is available for type checking."""
|
|
54
54
|
try:
|
|
55
|
-
import mypy
|
|
56
|
-
|
|
57
|
-
assert True # mypy is available
|
|
55
|
+
import mypy.api
|
|
58
56
|
except ImportError:
|
|
59
57
|
pytest.skip("mypy not installed - install with: pip install mypy")
|
|
60
58
|
|
|
59
|
+
# The stub validation below drives mypy through this entry point
|
|
60
|
+
assert callable(mypy.api.run)
|
|
61
|
+
|
|
61
62
|
@pytest.mark.skipif(sys.version_info < (3, 8), reason="Type hints require Python 3.8+")
|
|
62
63
|
def test_mypy_validates_stubs(self, stub_files):
|
|
63
64
|
"""Test that mypy validates stub files without errors."""
|
|
@@ -156,11 +157,12 @@ class TestPythonModuleHints:
|
|
|
156
157
|
|
|
157
158
|
try:
|
|
158
159
|
import nss_context
|
|
159
|
-
|
|
160
|
-
assert True
|
|
161
160
|
except ImportError:
|
|
162
161
|
pytest.fail("nss_context module not found")
|
|
163
162
|
|
|
163
|
+
assert hasattr(nss_context, "NSSContext")
|
|
164
|
+
assert hasattr(nss_context, "nss_context")
|
|
165
|
+
|
|
164
166
|
def test_deprecations_has_hints(self):
|
|
165
167
|
"""Test that deprecations.py has type hints."""
|
|
166
168
|
sys.path.insert(0, "src")
|
python_nss_ng-1.2.2/_version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.2.2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|