Skip to content

Commit d17fcc4

Browse files
authored
Merge branch 'master' into TheAnyKey/p38_named_expression_completion_step2
2 parents be8b6ed + ff6935b commit d17fcc4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4222
-398
lines changed

.github/workflows/cron-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
args: --verbose
3131
env:
3232
CARGO_INCREMENTAL: '0'
33-
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads'
33+
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests' # -Cpanic=abort
3434
- uses: actions/setup-python@v1
3535
with:
3636
python-version: 3.8

Cargo.lock

Lines changed: 47 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ clap = "2.33"
2727
rustpython-compiler = {path = "compiler", version = "0.1.1"}
2828
rustpython-parser = {path = "parser", version = "0.1.1"}
2929
rustpython-vm = {path = "vm", version = "0.1.1"}
30-
dirs = "=2.0.1"
30+
dirs = { package = "dirs-next", version = "1.0" }
3131
num-traits = "0.2.8"
3232
cfg-if = "0.1"
3333

@@ -47,10 +47,8 @@ path = "src/main.rs"
4747

4848
[patch.crates-io]
4949
# REDOX START, Uncommment when you want to compile/check with redoxer
50-
# time = { git = "https://gitlab.redox-os.org/redox-os/time.git", branch = "redox-unix" }
51-
# nix = { git = "https://github.com/coolreader18/nix", branch = "add-redox-support" }
5250
# # following patches are just waiting on a new version to be released to crates.io
53-
# socket2 = { git = "https://github.com/alexcrichton/socket2-rs", rev = "75fe3f2fe0e3079ad9d4dfb3a19e60bea3f2f055" }
54-
# rustyline = { git = "https://github.com/kkawakam/rustyline" }
55-
# libc = { git = "https://github.com/rust-lang/libc" }
51+
# nix = { git = "https://github.com/nix-rust/nix" }
52+
# crossbeam-utils = { git = "https://github.com/crossbeam-rs/crossbeam" }
53+
# socket2 = { git = "https://github.com/alexcrichton/socket2-rs" }
5654
# REDOX END

Lib/_threading_local.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@
126126
127127
affects what we see:
128128
129-
>>> mydata.number
129+
>>> # TODO: RUSTPYTHON, __slots__
130+
>>> mydata.number #doctest: +SKIP
130131
11
131132
132133
>>> del mydata

Lib/re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class RegexFlag(enum.IntFlag):
158158
TEMPLATE = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking
159159
T = TEMPLATE
160160
DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation
161-
#TODO: globals().update(RegexFlag.__members__) once mappingproxy has __iter__
161+
# TODO: globals().update(RegexFlag.__members__) once mappingproxy has __iter__
162162
for name in ("ASCII","IGNORECASE","LOCALE","UNICODE","MULTILINE","DOTALL",
163163
"VERBOSE","A","I","L","U","M","S","X","TEMPLATE","T","DEBUG"):
164164
globals()[name] = getattr(RegexFlag, name)

Lib/test/libregrtest/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ def _main(self, tests, kwargs):
614614

615615
# If we're on windows and this is the parent runner (not a worker),
616616
# track the load average.
617-
# TODO: RustPython
617+
# TODO: RUSTPYTHON
618618
# if sys.platform == 'win32' and (self.ns.worker_args is None):
619619
# from test.libregrtest.win_utils import WindowsLoadTracker
620620

Lib/test/seq_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def test_repeat(self):
321321
self.assertEqual(self.type2test(s)*(-4), self.type2test([]))
322322
self.assertEqual(id(s), id(s*1))
323323

324+
@unittest.skip("TODO: RUSTPYTHON")
324325
def test_bigrepeat(self):
325326
if sys.maxsize <= 2147483647:
326327
x = self.type2test([0])

Lib/test/string_tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ def test_expandtabs(self):
352352

353353
self.checkraises(TypeError, 'hello', 'expandtabs', 42, 42)
354354
# This test is only valid when sizeof(int) == sizeof(void*) == 4.
355-
if sys.maxsize < (1 << 32) and struct.calcsize('P') == 4:
355+
# XXX RUSTPYTHON TODO: expandtabs overflow checks
356+
if sys.maxsize < (1 << 32) and struct.calcsize('P') == 4 and False:
356357
self.checkraises(OverflowError,
357358
'\ta\n\tb', 'expandtabs', sys.maxsize)
358359

@@ -672,6 +673,7 @@ def test_replace(self):
672673
self.checkraises(TypeError, 'hello', 'replace', 42, 'h')
673674
self.checkraises(TypeError, 'hello', 'replace', 'h', 42)
674675

676+
@unittest.skip("TODO: RUSTPYTHON")
675677
@unittest.skipIf(sys.maxsize > (1 << 32) or struct.calcsize('P') != 4,
676678
'only applies to 32-bit platforms')
677679
def test_replace_overflow(self):

Lib/test/test_bytes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ def test_copy(self):
5454
self.assertEqual(a, b)
5555
self.assertEqual(type(a), type(b))
5656

57-
# TODO: RUSTPYTHON
58-
@unittest.expectedFailure
5957
def test_empty_sequence(self):
6058
b = self.type2test()
6159
self.assertEqual(len(b), 0)

Lib/test/test_decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ def outer(cls):
308308
return 'eggs'
309309

310310
self.assertEqual(Class.inner(), 'spam')
311-
#self.assertEqual(Class.outer(), 'eggs') # TODO RustPython
311+
#self.assertEqual(Class.outer(), 'eggs') # TODO: RUSTPYTHON
312312
self.assertEqual(Class().inner(), 'spam')
313-
#self.assertEqual(Class().outer(), 'eggs') # TODO RustPython
313+
#self.assertEqual(Class().outer(), 'eggs') # TODO: RUSTPYTHON
314314

315315

316316
class TestClassDecorators(unittest.TestCase):

Lib/test/test_errno.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""Test the errno module
2+
Roger E. Masse
3+
"""
4+
5+
import errno
6+
import unittest
7+
8+
std_c_errors = frozenset(['EDOM', 'ERANGE'])
9+
10+
class ErrnoAttributeTests(unittest.TestCase):
11+
12+
def test_for_improper_attributes(self):
13+
# No unexpected attributes should be on the module.
14+
for error_code in std_c_errors:
15+
self.assertTrue(hasattr(errno, error_code),
16+
"errno is missing %s" % error_code)
17+
18+
def test_using_errorcode(self):
19+
# Every key value in errno.errorcode should be on the module.
20+
for value in errno.errorcode.values():
21+
self.assertTrue(hasattr(errno, value),
22+
'no %s attr in errno' % value)
23+
24+
25+
class ErrorcodeTests(unittest.TestCase):
26+
27+
def test_attributes_in_errorcode(self):
28+
for attribute in errno.__dict__.keys():
29+
if attribute.isupper():
30+
self.assertIn(getattr(errno, attribute), errno.errorcode,
31+
'no %s attr in errno.errorcode' % attribute)
32+
33+
34+
if __name__ == '__main__':
35+
unittest.main()

0 commit comments

Comments
 (0)