Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix abc error messages #5140

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 3 commits into from
Jan 11, 2024
Merged

Fix abc error messages #5140

merged 3 commits into from
Jan 11, 2024

Conversation

NakanoMiku39
Copy link
Contributor

@NakanoMiku39 NakanoMiku39 commented Dec 28, 2023

Fix #5137

@youknowone
Copy link
Member

oh, test_dataclasses seems to be related the message changes too

@NakanoMiku39
Copy link
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
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
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
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
Copy link
Contributor Author

NakanoMiku39 commented Dec 28, 2023

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
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
Copy link
Contributor Author

NakanoMiku39 commented Dec 28, 2023

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
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
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
Member

Marking test_dataclasses expectedFailure seems reasonable in that case.

@NakanoMiku39
Copy link
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
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

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!

@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