-
Notifications
You must be signed in to change notification settings - Fork 783
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
Add error messages for unsupported macro features on compilation #4194
Merged
davidhewitt
merged 29 commits into
PyO3:main
from
codeguru42:add-error-messages-for-unsupported-macro-features-on-compilation
Jun 16, 2024
Merged
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
ffa283f
First implementation
cojmeister 61c488f
tweak error message wording
codeguru42 2dda39c
Fix boolean logic
codeguru42 f1f3efb
Remove redundant parens
codeguru42 e4719c3
Add test for weakref error
codeguru42 0e25b7c
Fix test
codeguru42 36b28d2
Reword error message
codeguru42 bfa8cb6
Add expected error output
codeguru42 219202f
Rinse and repeat for `dict`
codeguru42 03c2cdc
Add test output file
codeguru42 2df737c
Ignore Rust Rover config files
codeguru42 08891c9
cargo fmt
codeguru42 af3d93d
Add newsfragment
codeguru42 e22a51a
Update newsfragments/4194.added.md
codeguru42 aaf6fa7
Use ensure_spanned! macro
codeguru42 0336aeb
Use ensure_spanned! macro for weakref error, too
codeguru42 c5dcad8
Revert "Ignore Rust Rover config files"
codeguru42 6e83437
Update wording for error message
codeguru42 490cee4
Update weakref error message, too
codeguru42 9fb5196
Refactor constant to a pyversions module
codeguru42 5253cf4
Fix compiler errors
codeguru42 a2a9452
Another wording update
codeguru42 77a9101
And make weakref wording the same
codeguru42 28cbbc6
Fix compiler error due to using weakref in our own code
codeguru42 abd1075
Merge remote-tracking branch 'refs/remotes/upstream/main' into add-er…
codeguru42 680f471
Fix after merge
codeguru42 4fbbe98
apply conditional pyclass
davidhewitt 7177d53
update conditional compilation in tests
davidhewitt 3c7e898
Merge remote-tracking branch 'refs/remotes/upstream/main' into add-er…
codeguru42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added error messages when using `weakref` or `dict` when compiling for `abi3` for Python older than 3.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
use pyo3_build_config::PythonVersion; | ||
|
||
pub const PY_3_9: PythonVersion = PythonVersion { major: 3, minor: 9 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//! With abi3, dict not supported until python 3.9 or greater | ||
use pyo3::prelude::*; | ||
|
||
#[pyclass(dict)] | ||
struct TestClass {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: `dict` requires Python >= 3.9 when using the `abi3` feature | ||
--> tests/ui/abi3_dict.rs:4:11 | ||
| | ||
4 | #[pyclass(dict)] | ||
| ^^^^ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged these tests into
test_class_basics
.