Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/update-doc-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ jobs:
# Merge all artifacts
jq -s "add" --sort-keys crates/doc/generated/*.json > crates/doc/generated/merged.json

# Format merged json for the phf macro
jq -r 'to_entries[] | " \(.key | @json) => \(.value | @json),"' crates/doc/generated/merged.json > crates/doc/generated/raw_entries.txt
# Format merged json as a sorted const slice
jq -r 'to_entries[] | " (\(.key | @json), \(.value | @json)),"' crates/doc/generated/merged.json > crates/doc/generated/raw_entries.txt

OUTPUT_FILE='crates/doc/src/data.inc.rs'

Expand All @@ -93,9 +93,10 @@ jobs:
echo "// CPython version: ${PYTHON_VERSION}"
echo '// spell-checker: disable'
echo ''
echo "pub static DB: phf::Map<&'static str, &'static str> = phf::phf_map! {"
echo '#[rustfmt::skip]'
echo 'pub const DB: &[(&str, &str)] = &['
cat crates/doc/generated/raw_entries.txt
echo '};'
echo '];'
} > "$OUTPUT_FILE"

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand Down
4 changes: 1 addition & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,6 @@ def test_basic(self):


class BasicUnicodeTest(unittest.TestCase, MixInCheckStateHandling):
@unittest.expectedFailure # TODO: RUSTPYTHON; charmap_encode rejects a None mapping
def test_basics(self):
s = "abc123" # all codecs should be able to encode these
for encoding in all_unicode_encodings:
Expand Down Expand Up @@ -2307,7 +2306,6 @@ def test_encoding_map_type_initialized(self):
table_type = type(cp1140.encoding_table)
self.assertEqual(table_type, table_type)

@unittest.expectedFailure # TODO: RUSTPYTHON; charmap_encode rejects a None mapping
def test_decoder_state(self):
# Check that getstate() and setstate() handle the state properly
u = "abc123"
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_doctest/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,12 +742,12 @@ def non_Python_modules(): r"""

>>> import builtins
>>> tests = doctest.DocTestFinder().find(builtins)
>>> 750 < len(tests) < 800 # approximate number of objects with docstrings # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
>>> 750 < len(tests) < 800 # approximate number of objects with docstrings
True
>>> real_tests = [t for t in tests if len(t.examples) > 0]
>>> len(real_tests) # objects that actually have doctests # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
>>> len(real_tests) # objects that actually have doctests
14
>>> for t in real_tests: # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
>>> for t in real_tests:
... print('{} {}'.format(len(t.examples), t.name))
...
1 builtins.bin
Expand Down
45 changes: 0 additions & 45 deletions Lib/test/test_hmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,46 +804,6 @@ class OpenSSLRFCTestCase(OpenSSLAssertersMixin,
The underlying hash functions are also OpenSSL-based.
"""

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_md5_rfc2202(self):
return super().test_md5_rfc2202()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha1_rfc2202(self):
return super().test_sha1_rfc2202()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha2_224_rfc4231(self):
return super().test_sha2_224_rfc4231()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha2_256_rfc4231(self):
return super().test_sha2_256_rfc4231()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha2_384_rfc4231(self):
return super().test_sha2_384_rfc4231()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha2_512_rfc4231(self):
return super().test_sha2_512_rfc4231()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha3_224_nist(self):
return super().test_sha3_224_nist()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha3_256_nist(self):
return super().test_sha3_256_nist()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha3_384_nist(self):
return super().test_sha3_384_nist()

@unittest.expectedFailure # TODO: RUSTPYTHON; _hashlib.UnsupportedDigestmodError: unsupported hash type
def test_sha3_512_nist(self):
return super().test_sha3_512_nist()


class BuiltinRFCTestCase(BuiltinAssertersMixin,
NamedHashFunctionsTrait,
Expand Down Expand Up @@ -1057,7 +1017,6 @@ def obj_type(self):
def exc_type(self):
return _hashlib.UnsupportedDigestmodError

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_hmac_digest_digestmod_parameter(self):
for value in [object, 'unknown', 1234, None]:
with (
Expand All @@ -1066,10 +1025,6 @@ def test_hmac_digest_digestmod_parameter(self):
):
self.hmac_digest(b'key', b'msg', value)

@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module '_hashlib' has no attribute 'hmac_digest'
def test_digest(self):
return super().test_digest()


class BuiltinConstructorTestCase(ThroughBuiltinAPIMixin,
ExtensionConstructorTestCaseMixin,
Expand Down
4 changes: 0 additions & 4 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3511,7 +3511,6 @@ def m1d(*args, **kwargs):
('arg2', 1, ..., "positional_or_keyword")),
int))

@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: no signature found for builtin type <class 'classmethod'>
def test_signature_on_classmethod(self):
if not support.MISSING_C_DOCSTRINGS:
self.assertEqual(self.signature(classmethod),
Expand All @@ -3535,7 +3534,6 @@ def foo(cls, arg1, *, arg2=1):
('arg2', 1, ..., "keyword_only")),
...))

@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: no signature found for builtin type <class 'staticmethod'>
def test_signature_on_staticmethod(self):
if not support.MISSING_C_DOCSTRINGS:
self.assertEqual(self.signature(staticmethod),
Expand Down Expand Up @@ -4614,7 +4612,6 @@ class D(C): pass
with self.assertRaisesRegex(ValueError, "callable.*is not supported"):
self.assertEqual(inspect.signature(D), None)

@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: no signature found for builtin type <class '_pickle.Pickler'>
@unittest.skipIf(MISSING_C_DOCSTRINGS,
"Signature information for builtins requires docstrings")
def test_signature_on_builtin_class(self):
Expand Down Expand Up @@ -5156,7 +5153,6 @@ class foo: pass
foo_sig = MySignature.from_callable(foo)
self.assertIsInstance(foo_sig, MySignature)

@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: no signature found for builtin type <class '_pickle.Pickler'>
@unittest.skipIf(MISSING_C_DOCSTRINGS,
"Signature information for builtins requires docstrings")
def test_signature_from_callable_builtin_obj(self):
Expand Down
11 changes: 0 additions & 11 deletions Lib/test/test_pydoc/test_pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,6 @@ class C: "New-style class"
expected = 'C in module %s object' % __name__
self.assertIn(expected, pydoc.render_doc(c))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_generic_alias(self):
self.assertEqual(pydoc.describe(typing.List[int]), '_GenericAlias')
doc = pydoc.render_doc(typing.List[int], renderer=pydoc.plaintext)
Expand All @@ -1466,7 +1465,6 @@ def test_generic_alias(self):
if not MISSING_C_DOCSTRINGS:
self.assertIn(list.__doc__.strip().splitlines()[0], doc)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_union_type(self):
self.assertEqual(pydoc.describe(typing.Union[int, str]), 'Union')
doc = pydoc.render_doc(typing.Union[int, str], renderer=pydoc.plaintext)
Expand Down Expand Up @@ -1582,7 +1580,6 @@ def test_module_level_callable_noargs(self):
self.assertEqual(self._get_summary_line(time.time),
"time()")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_module_level_callable_o(self):
try:
import _stat
Expand All @@ -1609,12 +1606,10 @@ def test_bound_builtin_method_o(self):
self.assertEqual(self._get_summary_line(set().add),
"add(object, /) method of builtins.set instance")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_unbound_builtin_method_coexist_o(self):
self.assertEqual(self._get_summary_line(set.__contains__),
"__contains__(self, object, /) unbound builtins.set method")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_bound_builtin_method_coexist_o(self):
self.assertEqual(self._get_summary_line(set().__contains__),
"__contains__(object, /) method of builtins.set instance")
Expand All @@ -1628,12 +1623,10 @@ def test_bound_builtin_classmethod_noargs(self):
self.assertEqual(self._get_summary_line(datetime.datetime.utcnow),
"utcnow() class method of datetime.datetime")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_unbound_builtin_classmethod_o(self):
self.assertEqual(self._get_summary_line(dict.__dict__['__class_getitem__']),
"__class_getitem__(type, object, /) unbound builtins.dict method")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_bound_builtin_classmethod_o(self):
self.assertEqual(self._get_summary_line(dict.__class_getitem__),
"__class_getitem__(object, /) class method of builtins.dict")
Expand Down Expand Up @@ -1950,7 +1943,6 @@ def getsection(self, text, beginline, endline):
endindex = lines.index(endline, beginindex)
return lines[beginindex:endindex]

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_text_doc_routines_in_class(self, cls=pydocfodder.B):
doc = pydoc.TextDoc()
result = doc.docclass(cls)
Expand Down Expand Up @@ -2027,14 +2019,12 @@ def test_html_doc_routines_in_class(self, cls=pydocfodder.B):
self.assertIn('B_classmethod(x)', lines)
self.assertIn('B_classmethod_alias = B_classmethod(x)', lines)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_text_doc_inherited_routines_in_class(self):
self.test_text_doc_routines_in_class(pydocfodder.D)

def test_html_doc_inherited_routines_in_class(self):
self.test_html_doc_routines_in_class(pydocfodder.D)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_text_doc_routines_in_module(self):
doc = pydoc.TextDoc()
result = doc.docmodule(pydocfodder)
Expand Down Expand Up @@ -2081,7 +2071,6 @@ def test_text_doc_routines_in_module(self):
else:
self.assertIn(' sin(object, /)', lines)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_html_doc_routines_in_module(self):
doc = pydoc.HTMLDoc()
result = doc.docmodule(pydocfodder)
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_rlcompleter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def test_global_matches(self):
self.assertEqual(self.completer.global_matches('CompleteM'),
['CompleteMe(' if MISSING_C_DOCSTRINGS else 'CompleteMe()'])

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_attr_matches(self):
# test with builtins namespace
self.assertEqual(self.stdcompleter.attr_matches('str.s'),
Expand Down
Loading
Loading