naitoh / py2rb

A code translator using AST from Python to Ruby.
MIT License
134 stars 19 forks source link

only two ok #16

Open zlcython-by-zlc1003 opened 2 years ago

zlcython-by-zlc1003 commented 2 years ago

output:

$ python -V
Python 3.10.4
$ pip -V
pip 22.1.2 from /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip (python 3.10)
$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
$ pip install pyyaml
Requirement already satisfied: pyyaml in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (6.0)
$ pip install numpy
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (1.23.0)
$ python run_tests.py 

Looking for "ruby", "py2rb/builtins/module.rb", "py2rb/builtins/require.rb" [3]:
..                                                               [OK]
tests/test_builtins.rb [1]: .                                    [OK]
tests/algorithms/sqrt.py [4]: .                                [FAIL]
tests/algorithms/triangulation.py [4]: .                       [FAIL]
tests/basic/assert.py [4]: .                                   [FAIL]
tests/basic/assign.py [4]: .                                   [FAIL]
tests/basic/assign_slice.py [4]: .                             [FAIL]
tests/basic/augassign.py [4]: .                                [FAIL]
tests/basic/augassign2.py [4]: .                               [FAIL]
tests/basic/binaryops.py [4]: .                                [FAIL]
tests/basic/break.py [4]: .                                    [FAIL]
tests/basic/class.py [4]: .                                    [FAIL]
tests/basic/class2.py [4]: .                                   [FAIL]
tests/basic/class3.py [4]: .                                   [FAIL]
tests/basic/class4.py [4]: .                                   [FAIL]
tests/basic/class5.py [4]: .                                   [FAIL]
tests/basic/class6.py [4]: .                                   [FAIL]
tests/basic/closure.py [4]: .                                  [FAIL]
tests/basic/closure_in_class.py [4]: .                         [FAIL]
tests/basic/continue.py [4]: .                                 [FAIL]
tests/basic/del_array.py [4]: .                                [FAIL]
tests/basic/del_attr.py [4]: .                                 [FAIL]
tests/basic/del_dict.py [4]: .                                 [FAIL]
tests/basic/del_slice.py [4]: .                                [FAIL]
tests/basic/dictcomp1.py [4]: .                                [FAIL]
tests/basic/dictcomp2.py [4]: .                                [FAIL]
tests/basic/dictionary.py [4]: .                               [FAIL]
tests/basic/dictionary2.py [4]: .                              [FAIL]
tests/basic/dictionary3.py [4]: .                              [FAIL]
tests/basic/docstring.py [4]: .                                [FAIL]
tests/basic/embedding.py [4]: .                                [FAIL]
tests/basic/fib.py [4]: .                                      [FAIL]
tests/basic/float2int.py [4]: .                                [FAIL]
tests/basic/for_in.py [4]: .                                   [FAIL]
tests/basic/for_range1.py [4]: .                               [FAIL]
tests/basic/for_range2.py [4]: .                               [FAIL]
tests/basic/for_step.py [4]: .                                 [FAIL]
tests/basic/getattr.py [4]: .                                  [FAIL]
tests/basic/globalvar.py [4]: .                                [FAIL]
tests/basic/hasattr1.py [4]: .                                 [FAIL]
tests/basic/helloworld.py [4]: .                               [FAIL]
tests/basic/ifelse.py [4]:                                     [FAIL]
tests/basic/ifs.py [4]: .                                      [FAIL]
tests/basic/ifs2.py [4]: .                                     [FAIL]
tests/basic/keys.py [4]: .                                     [FAIL]
tests/basic/kwargs.py [4]: .                                   [FAIL]
tests/basic/kwargs2.py [4]:                                    [FAIL]
tests/basic/kwargs3.py [4]: .                                  [FAIL]
tests/basic/lambda.py [4]: .                                   [FAIL]
tests/basic/lambda2.py [4]:                                    [FAIL]
tests/basic/lambda3.py [4]:                                    [FAIL]
tests/basic/lambda_map.py [4]: .                               [FAIL]
tests/basic/list.py [4]: .                                     [FAIL]
tests/basic/list2.py [4]: .                                    [FAIL]
tests/basic/list3.py [4]: .                                    [FAIL]
tests/basic/listcomp1.py [4]:                                  [FAIL]
tests/basic/literals.py [4]: .                                 [FAIL]
tests/basic/logicalops.py [4]: .                               [FAIL]
tests/basic/loops.py [4]: .                                    [FAIL]
tests/basic/multiassign.py [4]: .                              [FAIL]
tests/basic/none.py [4]: .                                     [FAIL]
tests/basic/numeric.py [4]: .                                  [FAIL]
tests/basic/oo.py [4]: .                                       [FAIL]
tests/basic/oo_attributes.py [4]: .                            [FAIL]
tests/basic/oo_inherit.py [4]: .                               [FAIL]
tests/basic/oo_inherit2.py [4]: .                              [FAIL]
tests/basic/oo_inherit3.py [4]: .                              [FAIL]
tests/basic/oo_inherit_simple.py [4]: .                        [FAIL]
tests/basic/oo_inherit_simple_super1.py [4]: .                 [FAIL]
tests/basic/oo_inherit_simple_super2.py [4]: .                 [FAIL]
tests/basic/oo_inherit_simple_super3.py [4]:                   [FAIL]
tests/basic/oo_static_inherit.py [4]: .                        [FAIL]
tests/basic/pass.py [4]: .                                     [FAIL]
tests/basic/print.py [4]: .                                    [FAIL]
tests/basic/raise.py [4]: .                                    [FAIL]
tests/basic/raise2.py [4]: .                                   [FAIL]
tests/basic/scope.py [4]: .                                    [FAIL]
tests/basic/set.py [4]: .                                      [FAIL]
tests/basic/str1.py [4]: .                                     [FAIL]
tests/basic/str_endswith.py [4]: .                             [FAIL]
tests/basic/sumcomp.py [4]: .                                  [FAIL]
tests/basic/super1.py [4]: .                                   [FAIL]
tests/basic/super2.py [4]: .                                   [FAIL]
tests/basic/trueorfalse.py [4]: .                              [FAIL]
tests/basic/try.py [4]: .                                      [FAIL]
tests/basic/tuple.py [4]: .                                    [FAIL]
tests/basic/tuple2.py [4]: .                                   [FAIL]
tests/basic/vargs.py [4]: .                                    [FAIL]
tests/basic/while.py [4]: .                                    [FAIL]
tests/basic/with.py [4]: .                                     [FAIL]
tests/collections/ordered_dict.py [4]: .                       [FAIL]
tests/decorator/function1.py [4]: .                            [FAIL]
tests/decorator/function2.py [4]: .                            [FAIL]
tests/decorator/function3.py [4]: .                            [FAIL]
tests/decorator/property.py [4]: .                             [FAIL]
tests/decorator/setter.py [4]: .                               [FAIL]
tests/deep-learning-from-scratch/and_gate.py [4]:              [FAIL]
tests/deep-learning-from-scratch/relu.py [4]:                  [FAIL]
tests/deep-learning-from-scratch/sigmoid.py [4]:               [FAIL]
tests/deep-learning-from-scratch/step_function.py [4]:         [FAIL]
tests/errors/py_collision.py [4]: .                            [FAIL]
tests/functions/and.py [4]: .                                  [FAIL]
tests/functions/append.py [4]: .                               [FAIL]
tests/functions/aug.py [4]: .                                  [FAIL]
tests/functions/bitand.py [4]: .                               [FAIL]
tests/functions/bitor.py [4]: .                                [FAIL]
tests/functions/bitxor.py [4]: .                               [FAIL]
tests/functions/divfloor.py [4]: .                             [FAIL]
tests/functions/float.py [4]: .                                [FAIL]
tests/functions/floatdiv.py [4]: .                             [FAIL]
tests/functions/gtge.py [4]: .                                 [FAIL]
tests/functions/in.py [4]: .                                   [FAIL]
tests/functions/int.py [4]: .                                  [FAIL]
tests/functions/isinstance.py [4]: .                           [FAIL]
tests/functions/len.py [4]: .                                  [FAIL]
tests/functions/lshift.py [4]: .                               [FAIL]
tests/functions/ltle.py [4]: .                                 [FAIL]
tests/functions/ne.py [4]: .                                   [FAIL]
tests/functions/or.py [4]: .                                   [FAIL]
tests/functions/pop.py [4]: .                                  [FAIL]
tests/functions/rshift.py [4]: .                               [FAIL]
tests/functions/sort.py [4]: .                                 [FAIL]
tests/functions/str.py [4]: .                                  [FAIL]
tests/functions/ubitcomp.py [4]: .                             [FAIL]
tests/functions/uminus.py [4]: .                               [FAIL]
tests/functions/uplus.py [4]: .                                [FAIL]
tests/lists/all.py [4]: .                                      [FAIL]
tests/lists/any.py [4]: .                                      [FAIL]
tests/lists/extend.py [4]: .                                   [FAIL]
tests/lists/filter.py [4]: .                                   [FAIL]
tests/lists/in.py [4]: .                                       [FAIL]
tests/lists/insert.py [4]: .                                   [FAIL]
tests/lists/map.py [4]: .                                      [FAIL]
tests/lists/max.py [4]: .                                      [FAIL]
tests/lists/min.py [4]: .                                      [FAIL]
tests/lists/reverse.py [4]: .                                  [FAIL]
tests/lists/subclass.py [4]: .                                 [FAIL]
tests/lists/subclass2.py [4]: .                                [FAIL]
tests/lists/subclass3.py [4]: .                                [FAIL]
tests/lists/sum.py [4]: .                                      [FAIL]
tests/lists/sum2.py [4]: .                                     [FAIL]
tests/lists/xrange.py [4]: .                                   [FAIL]
tests/lists/zip.py [4]: .                                      [FAIL]
tests/modules/classname.py [4]: .                              [FAIL]
tests/modules/from_import.py [4]: .                            [FAIL]
tests/modules/from_import_as_module.py [4]: .                  [FAIL]
tests/modules/import.py [4]: .                                 [FAIL]
tests/modules/import_alias.py [4]: .                           [FAIL]
tests/modules/import_as_module.py [4]: .                       [FAIL]
tests/modules/import_class.py [4]: .                           [FAIL]
tests/modules/import_global.py [4]: .                          [FAIL]
tests/modules/import_init.py [4]:                              [FAIL]
tests/modules/import_multi.py [4]: .                           [FAIL]
tests/numpy/abs.py [4]:                                        [FAIL]
tests/numpy/all.py [4]:                                        [FAIL]
tests/numpy/any.py [4]:                                        [FAIL]
tests/numpy/arange.py [4]:                                     [FAIL]
tests/numpy/array2string.py [4]:                               [FAIL]
tests/numpy/asarray.py [4]:                                    [FAIL]
tests/numpy/ellipsis.py [4]:                                   [FAIL]
tests/numpy/empty.py [4]:                                      [FAIL]
tests/numpy/ext_slice.py [4]:                                  [FAIL]
tests/numpy/full.py [4]:                                       [FAIL]
tests/numpy/insert.py [4]:                                     [FAIL]
tests/numpy/like.py [4]:                                       [FAIL]
tests/numpy/linspace.py [4]:                                   [FAIL]
tests/numpy/max_min.py [4]:                                    [FAIL]
tests/numpy/maximum_minimum.py [4]:                            [FAIL]
tests/numpy/ndarray.py [4]:                                    [FAIL]
tests/numpy/ndarray2.py [4]:                                   [FAIL]
tests/numpy/ndarray3.py [4]:                                   [FAIL]
tests/numpy/not_like.py [4]:                                   [FAIL]
tests/numpy/np_copy.py [4]:                                    [FAIL]
tests/numpy/product.py [4]:                                    [FAIL]
tests/numpy/random_rand.py [4]:                                [FAIL]
tests/numpy/random_randint.py [4]:                             [FAIL]
tests/numpy/random_random.py [4]:                              [FAIL]
tests/numpy/random_uniform.py [4]:                             [FAIL]
tests/numpy/special_values.py [4]:                             [FAIL]
tests/numpy/sqrt.py [4]:                                       [FAIL]
tests/numpy/sum.py [4]:                                        [FAIL]
tests/numpy/trigonometric_funcitons.py [4]:                    [FAIL]
tests/numpy/type.py [4]:                                       [FAIL]
tests/os/path_basename.py [4]: .                               [FAIL]
tests/os/path_dirname.py [4]: .                                [FAIL]
tests/os/path_join.py [4]: .                                   [FAIL]
tests/os/walk.py [4]: .                                        [FAIL]
tests/random/random_random.py [4]: .                           [FAIL]
tests/six/integer_types.py [4]: .                              [FAIL]
tests/six/iteritems.py [4]: .                                  [FAIL]
tests/six/itervalues.py [4]: .                                 [FAIL]
tests/six/moves.range.py [4]: .                                [FAIL]
tests/six/py23.py [4]: .                                       [FAIL]
tests/strings/count.py [4]: .                                  [FAIL]
tests/strings/find.py [4]: .                                   [FAIL]
tests/strings/join.py [4]: .                                   [FAIL]
tests/strings/lstrip0.py [4]: .                                [FAIL]
tests/strings/lstrip1.py [4]: .                                [FAIL]
tests/strings/replace.py [4]: .                                [FAIL]
tests/strings/rfind.py [4]: .                                  [FAIL]
tests/strings/rstrip0.py [4]: .                                [FAIL]
tests/strings/rstrip1.py [4]: .                                [FAIL]
tests/strings/split.py [4]: .                                  [FAIL]
tests/strings/splitlines.py [4]: .                             [FAIL]
tests/strings/string_format_combined_simple.py [4]: .          [FAIL]
tests/strings/string_format_d.py [4]: .                        [FAIL]
tests/strings/string_format_d_simple.py [4]: .                 [FAIL]
tests/strings/string_format_f_simple.py [4]: .                 [FAIL]
tests/strings/string_format_i.py [4]: .                        [FAIL]
tests/strings/string_format_s_simple.py [4]: .                 [FAIL]
tests/strings/string_format_u.py [4]: .                        [FAIL]
tests/strings/strings_in_strings.py [4]: .                     [FAIL]
tests/strings/strip.py [4]: .                                  [FAIL]
tests/strings/strip1.py [4]: .                                 [FAIL]
tests/strings/ulcase.py [4]: .                                 [FAIL]
tests/strings/zipstring.py [4]: .                              [FAIL]
tests/unittest/assertAlmostEqual.py [4]: .                     [FAIL]
tests/unittest/assertEqual.py [4]: .                           [FAIL]
tests/unittest/assertIn.py [4]: .                              [FAIL]
tests/unittest/assertIs.py [4]: .                              [FAIL]
tests/unittest/assertIsInstance.py [4]: .                      [FAIL]
tests/unittest/assertRaises.py [4]: .                          [FAIL]
tests/unittest/assertTrue.py [4]: .                            [FAIL]
tests/unittest/class.py [4]: .                                 [FAIL]
Ran 224 tests in 14.336s

FAILED (failures=222)
nanobowers commented 2 years ago

@zlcython-by-zlc1003 This repo has gone stale and i've forked it here https://github.com/nanobowers/py2rb for use with newer rubies/pythons and fixed some additional bugs. Can you try that out and if it doesn't work submit an issue over there?