Skip to content

Add the filecmp module from cpython v3.10.2 #3526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 25, 2022

Conversation

burck1
Copy link
Contributor

@burck1 burck1 commented Jan 24, 2022

Copy filecmp module and tests from cpython v3.10.2
Enable filecmp in Lib/test/test_genericalias.py

Run the tests:

$ cargo run --release -- -m test test_filecmp -v

== RustPython 3.9.0alpha (heads/module-filecmp:7b7378509, Jan 23 2022, 21:05:31) [rustc 1.58.1]
== macOS-11.6.1-x86_64-64bit little-endian
== cwd: /private/var/folders/fv/652pf8d94lg8fmxym5m8g9xh0000gn/T/test_python_607
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 8.81 [1/1] test_filecmp
test_cmpfiles (test.test_filecmp.DirCompareTestCase) ... ok
test_default_ignores (test.test_filecmp.DirCompareTestCase) ... ok
test_dircmp (test.test_filecmp.DirCompareTestCase) ... ok
test_dircmp_subdirs_type (test.test_filecmp.DirCompareTestCase)
Check that dircmp.subdirs respects subclassing. ... ok
test_report_full_closure (test.test_filecmp.DirCompareTestCase) ... ok
test_report_partial_closure (test.test_filecmp.DirCompareTestCase) ... ok
test_cache_clear (test.test_filecmp.FileCompareTestCase) ... ok
test_different (test.test_filecmp.FileCompareTestCase) ... ok
test_matching (test.test_filecmp.FileCompareTestCase) ... ok

----------------------------------------------------------------------

Ran 9 tests in 0.041s

OK
test_filecmp passed

== Tests result: SUCCESS ==

1 test OK.

Total duration: 97 ms
Tests result: SUCCESS
$ ./whats_left.sh
BEFORE AFTER
... ...
curses (entire module) curses (entire module)
ensurepip (entire module) ensurepip (entire module)
filecmp (entire module) ❌️
fileinput (entire module) fileinput (entire module)
graphlib (entire module) graphlib (entire module)
... ...
out of 275 modules: out of 275 modules:
not_implemented 85 not_implemented 84 ⚠️
failed_to_import 0 failed_to_import 0
missing_items 102 missing_items 102
mismatched_items 61 mismatched_items 61

== RustPython 3.9.0alpha (heads/module-filecmp:7b7378509, Jan 23 2022, 21:05:31) [rustc 1.58.1]
== macOS-11.6.1-x86_64-64bit little-endian
== cwd: /private/var/folders/fv/652pf8d94lg8fmxym5m8g9xh0000gn/T/test_python_607
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 8.81 [1/1] test_filecmp
test_cmpfiles (test.test_filecmp.DirCompareTestCase) ... ok
test_default_ignores (test.test_filecmp.DirCompareTestCase) ... ok
test_dircmp (test.test_filecmp.DirCompareTestCase) ... ok
test_dircmp_subdirs_type (test.test_filecmp.DirCompareTestCase)
Check that dircmp.subdirs respects subclassing. ... ok
test_report_full_closure (test.test_filecmp.DirCompareTestCase) ... ok
test_report_partial_closure (test.test_filecmp.DirCompareTestCase) ... ok
test_cache_clear (test.test_filecmp.FileCompareTestCase) ... ok
test_different (test.test_filecmp.FileCompareTestCase) ... ok
test_matching (test.test_filecmp.FileCompareTestCase) ... ok

----------------------------------------------------------------------

Ran 9 tests in 0.041s

OK
test_filecmp passed

== Tests result: SUCCESS ==

1 test OK.

Total duration: 97 ms
Tests result: SUCCESS
== RustPython 3.9.0alpha (heads/module-filecmp:7b7378509, Jan 23 2022, 21:05:31) [rustc 1.58.1]
== macOS-11.6.1-x86_64-64bit little-endian
== cwd: /private/var/folders/fv/652pf8d94lg8fmxym5m8g9xh0000gn/T/test_python_1550
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 2.26 [1/1] test_genericalias
test_class_methods (test.test_genericalias.BaseTest) ... ok
test_copy (test.test_genericalias.BaseTest) ... ok
test_dir (test.test_genericalias.BaseTest) ... ok
test_equality (test.test_genericalias.BaseTest) ... ok
test_exposed_type (test.test_genericalias.BaseTest) ... ok
test_generic_subclass (test.test_genericalias.BaseTest) ... ok
test_instantiate (test.test_genericalias.BaseTest) ... ok
test_isinstance (test.test_genericalias.BaseTest) ... ok
test_issubclass (test.test_genericalias.BaseTest) ... ok
test_no_chaining (test.test_genericalias.BaseTest) ... ok
test_no_kwargs (test.test_genericalias.BaseTest) ... ok
test_parameter_chaining (test.test_genericalias.BaseTest) ... ok
test_parameters (test.test_genericalias.BaseTest) ... ok
test_pickle (test.test_genericalias.BaseTest) ... ok
test_repr (test.test_genericalias.BaseTest) ... expected failure
test_subclassing (test.test_genericalias.BaseTest) ... ok
test_subclassing_types_genericalias (test.test_genericalias.BaseTest) ... ok
test_subscriptable (test.test_genericalias.BaseTest) ... ok
test_type_generic (test.test_genericalias.BaseTest) ... ok
test_type_subclass_generic (test.test_genericalias.BaseTest) ... ok
test_unbound_methods (test.test_genericalias.BaseTest) ... ok
test_union (test.test_genericalias.BaseTest) ... ok
test_union_generic (test.test_genericalias.BaseTest) ... expected failure
test_unsubscriptable (test.test_genericalias.BaseTest) ... ok
test_weakref (test.test_genericalias.BaseTest) ... ok

----------------------------------------------------------------------

Ran 25 tests in 0.052s

OK (expected failures=2)
test_genericalias passed

== Tests result: SUCCESS ==

1 test OK.

Total duration: 164 ms
Tests result: SUCCESS
Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for contributing!

@youknowone youknowone merged commit a0c00b2 into RustPython:main Jan 25, 2022
@burck1 burck1 deleted the module-filecmp branch January 29, 2022 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants