Skip to content

Fix abc error messages#5140

Merged
youknowone merged 3 commits into
RustPython:mainfrom
NakanoMiku39:main
Jan 11, 2024
Merged

Fix abc error messages#5140
youknowone merged 3 commits into
RustPython:mainfrom
NakanoMiku39:main

Conversation

@NakanoMiku39

@NakanoMiku39 NakanoMiku39 commented Dec 28, 2023

Copy link
Copy Markdown
Contributor

Fix #5137

@youknowone

Copy link
Copy Markdown
Member

oh, test_dataclasses seems to be related the message changes too

@NakanoMiku39

Copy link
Copy Markdown
Contributor Author

oh, test_dataclasses seems to be related the message changes too

The test_dataclasses is now a test folder instead of a single test file, and in what way should it be updated?

@youknowone

Copy link
Copy Markdown
Member

We have 2 choices.

  1. Update test_dataclasses first and finish this PR later. The existing single file will be replaced by folder with this patch.
  2. Mark @unittest.expectedFalure to current dataclasses test. Then they will be fixed when we update the test later.

@NakanoMiku39

Copy link
Copy Markdown
Contributor Author

We have 2 choices.

  1. Update test_dataclasses first and finish this PR later. The existing single file will be replaced by folder with this patch.
  2. Mark @unittest.expectedFalure to current dataclasses test. Then they will be fixed when we update the test later.

The test files in the folder seems to be unrelated with the test_dataclasses.py though

@youknowone

Copy link
Copy Markdown
Member

I checked cpython repository. test_dataclasses.py looks still a file in Python 3.12. https://github.com/python/cpython/blob/v3.12.0/Lib/test/test_dataclasses.py
Could you share what's the folder?

@NakanoMiku39

NakanoMiku39 commented Dec 28, 2023

Copy link
Copy Markdown
Contributor Author

I checked cpython repository. test_dataclasses.py looks still a file in Python 3.12. https://github.com/python/cpython/blob/v3.12.0/Lib/test/test_dataclasses.py Could you share what's the folder?

Oh I was checking out the 3.12 branch, why is my url not working :(
My bad, I will keep up with the main branch
https://github.com/python/cpython/tree/3.12/Lib/test/test_dataclasses

@youknowone

Copy link
Copy Markdown
Member

Got it. I think the test is moved to https://github.com/python/cpython/blob/3.12/Lib/test/test_dataclasses/__init__.py

If you run test through -m test, both file and folder will work in same way.
cargo run -- -m test test_dataclasses

@NakanoMiku39

NakanoMiku39 commented Dec 28, 2023

Copy link
Copy Markdown
Contributor Author

Got it. I think the test is moved to https://github.com/python/cpython/blob/3.12/Lib/test/test_dataclasses/__init__.py

If you run test through -m test, both file and folder will work in same way. cargo run -- -m test test_dataclasses

Oh, but we are still following the main branch right? Then I will update the test file and ignore the folder
Well both test_dataclasses.py from rustpython and cpython are the same

@youknowone

Copy link
Copy Markdown
Member

I prefer to follow recent distribution's tag. I'd like recommend v3.12.1 tag at this time. https://github.com/python/cpython/tree/v3.12.1

@NakanoMiku39

Copy link
Copy Markdown
Contributor Author

I prefer to follow recent distribution's tag. I'd like recommend v3.12.1 tag at this time. https://github.com/python/cpython/tree/v3.12.1

I found that test_dataclasses needs support from dataclasses.py, which the latter would went into the match statement support issue

@youknowone

Copy link
Copy Markdown
Member

Marking test_dataclasses expectedFailure seems reasonable in that case.

@NakanoMiku39

Copy link
Copy Markdown
Contributor Author

Marking test_dataclasses expectedFailure seems reasonable in that case.

No it's not working. Things get worse when comment out the parts cuz it is not in a test function
image
image

@youknowone

Copy link
Copy Markdown
Member

Marking test_dataclasses expectedFailure seems reasonable in that case.

I made this temporary change here: https://github.com/RustPython/RustPython/pull/5140/files#diff-f0436842533448f8f02a19081d7c9cc8372b6685756caf32c83dfecebbee68e7R3679

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@youknowone youknowone changed the title Update vm/src/builtins/object.rs Fix abc error messages Jan 11, 2024
@youknowone youknowone merged commit 28f0fa4 into RustPython:main Jan 11, 2024
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.

Mismatching abstractmethod error messages

2 participants