R2D2
3cfc76ae93
Reworked struct error messages to use the of an error rather than concatenating all error messages
2021-07-31 23:21:07 +02:00
R2D2
403d882d6c
Merge branch 'main' of https://github.com/PyO3/pyo3 into enhanced_extract_type_errors
2021-07-31 21:21:10 +02:00
R2D2
a42447bfe2
Small refactor
2021-07-31 21:20:57 +02:00
Jacob Turner
363383ea84
Update pyo3-macros-backend/src/from_pyobject.rs
...
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-07-31 20:38:44 +02:00
David Hewitt
ee9a1678d5
rust: updates for rust & clippy 1.54
2021-07-31 08:19:38 +01:00
David Hewitt
a7244b864d
testing: use mod tests
instead of mod test
2021-07-26 18:19:53 +01:00
Alex Gaynor
82697bfec0
workaround an issue that causes function arguments to show up as if they are uncovered
...
https://github.com/rust-lang/rust/issues/86972 describes this issue in some detail and links to a minimal reproducer
making this change, and this change alone, resolves the coverage issues
2021-07-14 23:38:08 -04:00
David Hewitt
d11943ab6d
macros-backend: don't error on #[doc(hidden)]
2021-07-08 23:41:24 +01:00
David Hewitt
3f8c4ad38e
release: 0.14.1
2021-07-04 16:49:36 +01:00
David Hewitt
adf6bdba8e
release: 0.14.0
2021-07-03 08:37:00 +01:00
mejrs
c07c5a4c93
Add full path for PyCell
2021-07-03 07:51:18 +01:00
David Hewitt
542a6124b1
Merge pull request #1696 from scalexm/unwrap
...
Unwrap `syn::*::Group` in a few places
2021-06-29 22:12:49 +01:00
David Hewitt
8fb4ce6fbc
pyo3-build-config: fix cross compilation
2021-06-26 14:19:03 +01:00
scalexm
20fa398fdb
Unwrap syn::*::Group
in a few places
2021-06-25 00:12:38 +02:00
scalexm
53773d5484
Use explicit lifetimes in proc-macro expansion
2021-06-25 00:02:21 +02:00
David Hewitt
67948a24f7
while let unwrap_group
2021-06-24 09:11:27 +01:00
Giles Cope
aaad7ffd63
Need to be able to create structs via macro_rules
...
(Currently only possible using tt escape type.)
2021-06-24 08:40:49 +01:00
David Hewitt
f916867375
pyclass: refactor initialization, call native type dealloc
2021-06-23 07:45:51 +01:00
R2D2
ec40446fa3
Removed stray newline character from error message
2021-06-09 14:23:16 +02:00
R2D2
e6da1ebc73
Fixed formatting of error messages and tests
2021-06-09 11:40:14 +02:00
David Hewitt
b081e37de5
Merge pull request #1665 from PyO3/kwds_varargs
...
Argument parsing: use VARARGS for *any* function taking **kwds
2021-06-07 23:23:05 +01:00
R2D2
35060f4693
Removed unused custom keyword in macros
2021-06-07 11:50:15 +02:00
R2D2
0b3fbb5533
Fixed formatting
2021-06-07 10:26:58 +02:00
R2D2
973f0a5bae
Removed the custom error messages from the macro api
2021-06-07 10:18:38 +02:00
Georg Brandl
b60a56d9fd
Reorganize method wrapper generation
...
Remove unneded splitting of functions in two, and reorder the
functions to order of the main match {} in gen_py_method().
2021-06-07 07:33:28 +02:00
Georg Brandl
f12c1a4005
Argument parsing: use VARARGS for *any* function taking **kwds
2021-06-06 15:58:19 +02:00
David Hewitt
18e0aa17e0
pymodule: accept #[pyo3(name = "...")]
option
2021-06-06 08:41:20 +01:00
Georg Brandl
bd6788b2fa
Argument parsing: optimize the f(*args, **kwds) case.
...
Use the VARARGS calling convention and just pass through the two objects.
2021-06-06 07:48:38 +02:00
Georg Brandl
c670c57ddb
Refactor PyMethodDef creation too.
2021-06-06 07:07:48 +02:00
Georg Brandl
a8d2649032
Refactor wrapper generation, and enable fastcall for static/class methods.
2021-06-06 07:07:46 +02:00
David Hewitt
9b8b133905
pyfunction: document #[pyo3(pass_module)]
2021-06-05 17:36:50 +01:00
David Hewitt
cec4c2d2e9
text_signature: move to #[pyo3(text_signature = "...")]
2021-06-05 16:33:03 +01:00
Georg Brandl
3e8d003faf
Implement METH_FASTCALL for pyfunctions and pymethods.
2021-06-05 12:57:22 +02:00
David Hewitt
d011467e63
pyclass: allow #[pyo3(get, set, name = "foo")]
2021-06-04 11:30:40 +01:00
R2D2
416b1132b4
Added custom error messages to enum fields and container types. Covered with tests. Fixed formatting and linting issues
2021-06-01 22:44:16 +02:00
R2D2
1a8fec2e88
Added detailed TypeError messages to enums with derive(FromPyOjbect)
2021-05-31 17:38:15 +02:00
R2D2
4a99bfaaba
Fixed tests after modifying TypeErrors originating from structs. Started work on TypeError message on Enums
2021-05-31 00:28:53 +02:00
Tim Robinson
1ba32178dd
Method and slot visitors accept slices instead of individual items
2021-05-29 09:38:15 +01:00
Tim Robinson
030aa43544
Simplify code generated for for_each_method_def and for_each_proto_slot
2021-05-29 09:10:38 +01:00
R2D2
1843ff20fd
Added support for enhanced errors for the FromPyObject trait derived on tuples and newtype structs/tuples
2021-05-28 00:38:32 +02:00
R2D2
8981b84b79
Added customizable conversion error message for type errors encounted in FromPyObject::extract
2021-05-28 00:24:47 +02:00
R2D2
d71d4329ae
Changed format of TypeError messages
2021-05-27 22:36:19 +02:00
R2D2
f68ab481ba
Added improved error messages to the derive FromPyObject macro for basic structs and enums
2021-05-27 15:42:57 +02:00
messense
5523ad6d5b
Merge pull request #1633 from davidhewitt/async-fn-error
...
pyfunction: better error message with `async fn`
2021-05-26 14:33:52 +08:00
David Hewitt
9f74336bc9
pyfunction: better error message with async fn
2021-05-25 11:32:52 +01:00
David Hewitt
355bd0c336
pymodule: tidy up module init
2021-05-25 10:54:16 +01:00
David Hewitt
9a4e7b5877
Merge pull request #1622 from davidhewitt/pyo3-build-config
...
pyo3-build-config: new crate to re-use build.rs across crates
2021-05-25 07:11:24 +01:00
David Hewitt
284ad1f98a
pyo3-build-config: fix build
2021-05-21 23:05:36 +01:00
David Hewitt
825ec08681
pyo3-build-config: docs wip
2021-05-21 08:34:51 +01:00
David Hewitt
79c7149d52
pyo3-build-config: new crate to re-use build.rs across crates
2021-05-20 09:03:33 +01:00