instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PyO3__maturin__3001 | PyO3/maturin | 3,001 | defect | 66b4869413c9e174c3a5a17528f132a1426c7878 | 61bf6a550e8c61f2f5c2669f787d4ac005785313 | feat: support including `OUT_DIR` assets in wheel builds | Add a new include pattern variant that allows users to include files generated by build scripts (build.rs) in wheel builds:
```toml
[tool.maturin]
include = [
{ path = "cpu_features.json", from = "out-dir", to = "my_package/" },
]
```
An optional `crate-name` field allows targeting a specific workspace m... | diff --git a/guide/src/config.md b/guide/src/config.md
index f106ece7d..3efd6748e 100644
--- a/guide/src/config.md
+++ b/guide/src/config.md
@@ -104,6 +104,28 @@ include = [
The default behavior is apply these configurations to both `sdist` and `wheel`
targets.
+To include files generated by a Cargo build script (`... | 4 | 4 | 1 | [{"id": "G0", "claim": "validate_include()'s `from != \"out-dir\"` check runs in a separate validation pass and would be more effective if validated at deserialization time using serde attributes or custom deserializers.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G... | null |
PyO3__maturin__3024 | PyO3/maturin | 3,024 | defect | 8495767a57c5060fbcdf5a33d670efe2d5af1f0b | ca24f4332a52e6bf8b97a6c1b2a1917c10efa96f | feat: include debug info files (.pdb, .dSYM, .dwp) in wheels | Add `--include-debuginfo` CLI flag for `maturin build` and `maturin publish` to opt-in to including debug info files (`.pdb`, `.dSYM`, `.dwp`) in wheels. For maturin develop, debug info is automatically included unless `--strip` is used.
## `split-debuginfo` handling
When `--include-debuginfo` is active (or in de... | diff --git a/.gitignore b/.gitignore
index 8f81aadac..e16b14b71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
*.egg
*.egg-info/
+*.dwp
+*.dSYM
*.o
+*.pdb
*.py[cdo]
*.so
.pytest_cache/
diff --git a/Cargo.lock b/Cargo.lock
index d542241fb..770bdfabf 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1720,6 +17... | 2 | 1 | 0 | [{"id": "G0", "claim": "In src/binding_generator/mod.rs the debug-info helpers silently succeed when the debug info path is neither a file nor a directory (e.g. a broken symlink or nonexistent path); an else branch should return an error or log a warning to make debugging easier.", "category": "correctness", "verdict":... | null |
PyO3__maturin__3074 | PyO3/maturin | 3,074 | defect | 0e902179cf83d3d99d58a6fd47f14899febf32a6 | 0490d07a6448be095102631020145889ef0485b1 | refactor: improve type safety and API clarity | - source_distribution/unpack.rs: Replace bare (TempDir, PathBuf, PathBuf) tuple with named UnpackedSdist struct for self-documenting fields
- target/mod.rs: Change get_supported_architectures() to return &'static [Arch] instead of allocating Vec<Arch> on every call | diff --git a/src/lib.rs b/src/lib.rs
index d96d6c170..b7d4c602d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -40,7 +40,7 @@ pub use crate::module_writer::{
pub use crate::new_project::{GenerateProjectOptions, init_project, new_project};
pub use crate::pyproject_toml::PyProjectToml;
pub use crate::python_interpreter::... | 3 | 2 | 0 | [{"id": "G0", "claim": "Moving unpacked.cargo_toml into build.cargo.manifest_path partially moves the UnpackedSdist value, making the later field moves of a type with drop glue invalid; destructure UnpackedSdist into separate locals up front so all fields are moved without partially moving the struct.", "category": "ma... | null |
PyO3__maturin__3085 | PyO3/maturin | 3,085 | defect | 74baa6714808eae61ac330c972d22a9122f9b190 | 84dca39102d6ab0d3a6765cdcd0c7435618f1245 | feat: add Profile-Guided Optimization (PGO) support | Add `--pgo` CLI flag and `pgo-command` config in `[tool.maturin]` to enable PGO builds via a three-phase pipeline:
1. Build instrumented wheel with `-Cprofile-generate`
2. Install in temp venv and run the user's pgo-command to collect `.profraw` files
3. Merge profiles with `llvm-profdata` and rebuild with `-Cprof... | diff --git a/src/build_context/builder.rs b/src/build_context/builder.rs
index 9523c9edc..e6bb06b3c 100644
--- a/src/build_context/builder.rs
+++ b/src/build_context/builder.rs
@@ -29,6 +29,7 @@ pub struct BuildContextBuilder {
editable: bool,
sdist_only: bool,
pyproject_toml_path: Option<PathBuf>,
+ ... | 5 | 5 | 5 | [{"id": "G0", "claim": "The PGO instrumentation command is executed without an explicit working directory, so relative paths in commands like `pytest tests/...` may fail when maturin is invoked from outside the project root; it should set `current_dir` to the project root.", "category": "correctness", "verdict": "suppo... | null |
PyO3__maturin__3115 | PyO3/maturin | 3,115 | defect | d97bbd0a51003ad62ccfcb854ea0c6e9713c6cd2 | 7d9350be2409d9f471452aa1443fa9e98789cf31 | PyO3: Adds generate-stubs command | This builds the package in debug mode then tries to extract the generated stubs in a given target directory
I plan to add (in a follow up?) better error messages but wanted to get feedback first | diff --git a/src/commands/generate_stubs.rs b/src/commands/generate_stubs.rs
new file mode 100644
index 000000000..4559c40ab
--- /dev/null
+++ b/src/commands/generate_stubs.rs
@@ -0,0 +1,62 @@
+use anyhow::{Context, Result, ensure};
+use fs_err as fs;
+use maturin::{BuildOptions, BuildOrchestrator, CargoOptions, Output... | 1 | 1 | 1 | [{"id": "G0", "claim": "Building a full wheel into a temp dir and re-opening the ZIP to extract .pyi files is a wasteful round-trip; generate-stubs should compile the artifact and load it directly via the binding generator, skipping wheel creation and the temp dir + ZIP overhead.", "category": "performance", "verdict":... | null |
PyO3__maturin__3182 | PyO3/maturin | 3,182 | defect | 863c990a5a41f7951c577436378aeff109ea3f5a | ec7b0ce0f61406e3f16f20ecb2d0bab02e82730f | Support parent-relative pyproject metadata in sdists | Fixes PyO3/maturin#3181.
When `pyproject.toml` lives in a Cargo workspace member, `maturin sdist` places `pyproject.toml` at the sdist root as required by the source distribution format. If PEP 621 metadata such as `[project.readme] file = "../README.md"` or `license = { file = "../LICENSE" }` points outside the membe... | diff --git a/src/source_distribution/pyproject.rs b/src/source_distribution/pyproject.rs
index 0e0cb6fef..706b6fbfe 100644
--- a/src/source_distribution/pyproject.rs
+++ b/src/source_distribution/pyproject.rs
@@ -116,7 +116,14 @@ pub(super) fn add_pyproject_metadata(
// Skip if already added (e.g. from Cargo.toml ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The readme path derived from pyproject.toml is used unvalidated to form both the archive target path and the source path, so an absolute path or one containing `..` components can add surprising entries to the sdist or read files outside the project directory; such paths should be rejected befor... | null |
PyO3__maturin__436 | PyO3/maturin | 436 | defect | 6099945a281f45943172d295718cb2ee52bdddcb | b6d20f3e2dc248e9811b8a5644d3643807228483 | Enforce manylinux symbol versions check | Closes #303 | diff --git a/Cargo.lock b/Cargo.lock
index 29d350acc..190a25e97 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -909,12 +909,14 @@ dependencies = [
"indoc",
"keyring",
"mailparse",
+ "once_cell",
"platform-info",
"platforms",
"pretty_env_logger",
"regex",
"reqwest",
"rpassword",
+ "scroll",
"serde",
"... | 3 | 3 | 1 | [{"id": "G0", "claim": "Indexing policy.symbol_versions with the target architecture could panic for an unsupported architecture, and it would be better to use .get and error appropriately instead.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The ... | null |
PyO3__maturin__584 | PyO3/maturin | 584 | defect | 7f0dd705dd05ebb3d6b24c24a0806424aec29773 | 0cec146078b369d6559823034dc374da5e1d564c | Add path option for Python source | With this PR you can specify Python source code location in `Cargo.toml` by setting `package.metadata.maturin.python-source` to your Python source code directory.
Here is an example project layout with `python-source` set to `python`:
```bash
├── Cargo.lock
├── Cargo.toml
├── Readme.md
├── check_installed
│ ... | diff --git a/src/build_context.rs b/src/build_context.rs
index f41c9fb36..67acf8c2a 100644
--- a/src/build_context.rs
+++ b/src/build_context.rs
@@ -73,22 +73,31 @@ pub enum ProjectLayout {
impl ProjectLayout {
/// Checks whether a python module exists besides Cargo.toml with the right name
- pub fn determin... | 4 | 3 | 0 | [{"id": "G0", "claim": "The newly added code copies the project root path where a borrowing Cow could avoid it, so use map_or with Cow in ProjectLayout::determine and Metadata21::from_pyproject_toml.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Th... | null |
PyO3__maturin__608 | PyO3/maturin | 608 | defect | 9ab2099303b6a58752f85449387ff1ff19ad1795 | 5ddbf7ca8ec3e0bc3c12f1590823de7c4ce72de0 | Warn missing `build-backend` in pyproject.toml | Closes #607 | diff --git a/src/auditwheel/audit.rs b/src/auditwheel/audit.rs
index 2e6475fb2..3047d11fe 100644
--- a/src/auditwheel/audit.rs
+++ b/src/auditwheel/audit.rs
@@ -255,7 +255,7 @@ pub fn auditwheel_rs(
}
if let Some(musl_tag @ PlatformTag::Musllinux { .. }) = platform_tag {
// TODO: add support for musl... | 4 | 2 | 0 | [{"id": "G0", "claim": "In the 'No compatible platform tag found' warning in auditwheel_rs, 'pypi' should be capitalized as 'PyPI' (the reviewer left a suggestion block rewriting 'You won't be able to upload those wheels to pypi.' to '... to PyPI.').", "category": "documentation", "verdict": "supported", "priority": "P... | null |
PyO3__maturin__763 | PyO3/maturin | 763 | defect | 33be3620b8c3940206a44b5ece65282e41a2b9e4 | 27050970801165e1c1a52b73c596f89851f31710 | Add a subcommand wrapper for `zig cc` and `zig c++` | Closes #761 | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index cf0a836f4..c9a06e234 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -110,7 +110,6 @@ jobs:
with:
python-version: "3.10.0"
- name: test cross compiling with zig
- if: matrix.os != 'wi... | 6 | 5 | 0 | [{"id": "G0", "claim": "The code comment about rustc passing linker arguments via an @-file should reference rust-lang/rust issue 41190.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `zig` subcommand should be hidden from the CLI help, just l... | null |
PyO3__maturin__862 | PyO3/maturin | 862 | defect | 52495dcf806c1e88e632f4f29c2960bd34c1d966 | 62aa103f9fb0c618bdfaec7a985f59f380a9c618 | Automatically include license files in `.dist-info/license_files` | Implementing parts of #861 for PEP 639 not requiring updates to the metadata version. The changes in #837 added the `.dist-info/license_files` using the `License-File` field.
Any files in the project root matching glob patterns `["LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*"]` (from PEP 639) are automatically add... | diff --git a/Changelog.md b/Changelog.md
index bb038f4cb..ce0c9e448 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+* Automatically include license files in `.dist-info/license_files` following PEP 639 in... | 4 | 3 | 1 | [{"id": "G0", "claim": "The new test could keep the license paths as PathBuf and drop the repeated to_str().unwrap() conversions.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The manifest_path must be escaped (glob::Pattern::escape) before bei... | null |
PyO3__pyo3-async-runtimes__7 | PyO3/pyo3-async-runtimes | 7 | defect | 38e34c59eb1cf78e9f4d9e10bd6023a5e84701d6 | fd70e99f349f6433a196d0ad75a42274f8fa2354 | Update to Pyo3 v0.22 | This is my first attempt at updating to pyo3 v0.22 without the `py-clone` feature. I've added a `Python::with_gil` naively everywhere a GIL token was required, so it may need some refactoring & cleanup next. Furthermore all fmt/cargo checks should be resolved.
ref #1 | diff --git a/Cargo.toml b/Cargo.toml
index 49a0f6a..7d6f662 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -120,11 +120,11 @@ futures = "0.3"
inventory = { version = "0.3", optional = true }
once_cell = "1.14"
pin-project-lite = "0.2"
-pyo3 = "0.21"
+pyo3 = "0.22"
pyo3-async-runtimes-macros = { path = "pyo3-asyncio-ma... | 1 | 1 | 0 | [{"id": "G0", "claim": "In the src/async_std.rs doc comment, the `>` this PR added before \"are only available when the `unstable-streams` Cargo feature is enabled:\" is incorrect because it closes the `<span>` tag, and that character should be removed.", "category": "documentation", "verdict": "supported", "priority":... | null |
PyO3__pyo3__3491 | PyO3/pyo3 | 3,491 | defect | f335f42197a7b043b24ea1a1115a44772a8bf94a | b3fcbd89d916f26d037c23eb4d3ddc481119f06d | emit compile errors on macros inside `#[pymethods]` | Fixes #2862
This is a small UX improvement to raise an error instead of silently ignoring macro invocations inside `#[pymethods]`. | diff --git a/newsfragments/3491.fixed.md b/newsfragments/3491.fixed.md
new file mode 100644
index 000000000000..091f60937926
--- /dev/null
+++ b/newsfragments/3491.fixed.md
@@ -0,0 +1 @@
+Emit compile errors instead of ignoring macro invocations inside `#[pymethods]` blocks.
diff --git a/pyo3-macros-backend/src/pyimpl.... | 1 | 1 | 0 | [{"id": "G0", "claim": "The error message should read \"macros cannot be used as items in `#[pymethods]` impl blocks\" instead of \"macros cannot be used in `#[pymethods]` impl blocks\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyO3__pyo3__3661 | PyO3/pyo3 | 3,661 | defect | ff50285d1f47327d8cd549730e24dd62944caf6c | 6f81bd0c67a3843919641ce8ca170103443d5430 | Replace (A)IterNextOutput by autoref-based specialization to allow returning arbitrary value | To be done:
- [x] changelog entry
- [x] migration guide entry
Closes #3190 | diff --git a/pyo3-macros-backend/src/pymethod.rs b/pyo3-macros-backend/src/pymethod.rs
index be6e1757bd18..cef5501e6487 100644
--- a/pyo3-macros-backend/src/pymethod.rs
+++ b/pyo3-macros-backend/src/pymethod.rs
@@ -787,9 +787,11 @@ pub const __RICHCMP__: SlotDef = SlotDef::new("Py_tp_richcompare", "richcmpfunc"
const ... | 6 | 4 | 3 | [{"id": "G0", "claim": "The Option<T> special case for __next__ should not be deprecated; it should be kept so that returning None efficiently produces NULL (which means dropping the generic Target and enforcing *mut ffi::PyObject), since Rust iterators return Option and this form is attractive in user code.", "categor... | null |
PyO3__pyo3__3689 | PyO3/pyo3 | 3,689 | defect | a115877bba7fbb32cfbf3e27e6600020e2803dab | 8ef1d1ea98509b0982ea8aab1b4fafe566be7495 | Turn calls of __traverse__ into no-ops for unsendable pyclass if on the wrong thread | Adds a "threadsafe" variant of `PyCell::try_borrow` which will fail instead of panicking if called on the wrong thread and use it in `call_traverse` to turn GC traversals of unsendable pyclasses into no-ops if on the wrong thread.
This can imply leaking the underlying resource if the originator thread has already ex... | diff --git a/newsfragments/3689.changed.md b/newsfragments/3689.changed.md
new file mode 100644
index 000000000000..d9eca98def42
--- /dev/null
+++ b/newsfragments/3689.changed.md
@@ -0,0 +1 @@
+Calls to `__traverse__` become no-ops for unsendable pyclasses if on the wrong thread, thereby avoid hard aborts at the cost o... | 3 | 2 | 1 | [{"id": "G0", "claim": "The new PyCellLayout::check_threadsafe could return bool instead of Result<(), PyBorrowError> to match the PyClassThreadChecker trait's check implementation, for consistency, even if that makes try_borrow_threadsafe a bit messier.", "category": "design", "verdict": "opposed", "priority": "P3", "... | null |
PyO3__pyo3__3995 | PyO3/pyo3 | 3,995 | defect | 1be2fad9bfa900dc2df412e32613641d9175d759 | 217922ccf79045793907db3aa00f9897e8750255 | handle `#[pyo3(from_py_with = "")]` in `#[setter]` methods | Fixes #3992
Handle the `#[pyo3(from_py_with = "")]` attribute in `#[setter]` methods instead of silently ignoring it.
| diff --git a/newsfragments/3995.fixed.md b/newsfragments/3995.fixed.md
new file mode 100644
index 00000000000..e47a71b790d
--- /dev/null
+++ b/newsfragments/3995.fixed.md
@@ -0,0 +1 @@
+handle `#[pyo3(from_py_with = "")]` in `#[setter]` methods
\ No newline at end of file
diff --git a/pyo3-macros-backend/src/pymethod.r... | 1 | 1 | 1 | [{"id": "G0", "claim": "In the new `from_py_with` setter extraction the extracted `_val` should probably also be checked as a GIL Ref, via `holders.push_gil_refs_checker`, like the function-argument path does.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
PyO3__pyo3__4045 | PyO3/pyo3 | 4,045 | defect | a4aea230ed6087a5fccc415d6456c536645e0df1 | 1a6cf30a4ece6fd7f846c3fcc0e4cbe5dd335b92 | add descriptive error msg for `__traverse__` receivers other than `&self` | This adds a descriptive error message if receivers other than `&self` are tried to extract from `__traverse__` along with the corresponding UI tests. In particular this tests for `PyRef`, `PyRefMut`, `Bound` and `&mut self`.
Fixes #3180 | diff --git a/newsfragments/4045.fixed.md b/newsfragments/4045.fixed.md
new file mode 100644
index 00000000000..6b2bbcfa01d
--- /dev/null
+++ b/newsfragments/4045.fixed.md
@@ -0,0 +1 @@
+Add better error message on wrong receiver extraction in `__traverse__`.
diff --git a/pyo3-macros-backend/src/pymethod.rs b/pyo3-macro... | 1 | 1 | 0 | [{"id": "G0", "claim": "The `__traverse__` error messages refer to `visit.call` without introducing the `visit` identifier, which could be opaque if the user has not named the argument `visit`, so the message should bind the `visit` identifier somehow, e.g. by showing `__traverse__(&self, visit: PyVisit)`.", "category"... | null |
PyO3__pyo3__4117 | PyO3/pyo3 | 4,117 | defect | c951bf86de4c32c1e4d026687d6b54f975aea802 | ac8db6f9c1461bb9f9d2aa137583927f3131aa23 | handle `#[pyo3(from_py_with = ...)]` on dunder (`__magic__`) methods | Handle `#[pyo3(from_py_with = ...)]` attribute on dunder (`__magic__`) method arguments
Closes #4113 | diff --git a/newsfragments/4117.fixed.md b/newsfragments/4117.fixed.md
new file mode 100644
index 000000000000..c3bb4c144b6d
--- /dev/null
+++ b/newsfragments/4117.fixed.md
@@ -0,0 +1 @@
+Correctly handle `#[pyo3(from_py_with = ...)]` attribute on dunder (`__magic__`) method arguments instead of silently ignoring it.
d... | 1 | 1 | 0 | [{"id": "G0", "claim": "The code would become clearer if the enum variants carried the `syn::Ident` (e.g. `enum GilRefChecker { FunctionArg(syn::Ident), FromPyWith(syn::Ident) }`) instead of pairing Idents with a separate `GilRefCheckerType`.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "i... | null |
PyO3__pyo3__4288 | PyO3/pyo3 | 4,288 | defect | 2e2d4404a682ce87e0b0fe254816457872acf5b2 | d115719d168ffc649cb1c9120df83123f693234c | fixes #4285 -- allow full-path to pymodule with nested declarative modules | fixes #4285 | diff --git a/newsfragments/4288.fixed.md b/newsfragments/4288.fixed.md
new file mode 100644
index 000000000000..105bb0422765
--- /dev/null
+++ b/newsfragments/4288.fixed.md
@@ -0,0 +1 @@
+allow `#[pyo3::prelude::pymodule]` with nested declarative modules
diff --git a/pyo3-macros-backend/src/module.rs b/pyo3-macros-back... | 2 | 2 | 2 | [{"id": "G0", "claim": "Use `ctx.pyo3_path` instead of the hard-coded `pyo3` segment, and also allow `pyo3::pymodule` (not only `pyo3::prelude::pymodule`) as the path to the macro.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The full-path attribu... | null |
PyO3__pyo3__4304 | PyO3/pyo3 | 4,304 | defect | f3603a0a483448c71f1811786257d070733540bf | 646beb7ce80a5a5df1ce40b581bc30f3a70dd480 | fix deprecation warning for trailing optional on `#[setter]` functions | Fixes #4292
Basically just don't emit the warning for `setter` or `getter` functions, and adds a test. | diff --git a/newsfragments/4304.fixed.md b/newsfragments/4304.fixed.md
new file mode 100644
index 00000000000..5f5b5fd8ed0
--- /dev/null
+++ b/newsfragments/4304.fixed.md
@@ -0,0 +1 @@
+Fix invalid deprecation warning for trailing optional on `#[setter]` function.
diff --git a/pyo3-macros-backend/src/deprecations.rs b/... | 1 | 1 | 0 | [{"id": "G0", "claim": "A comment should be added to `signature_attribute_allowed` explaining why getter/setter/classattr have fixed signatures with a single arg where `Option<>` has a specific meaning.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyO3__pyo3__4308 | PyO3/pyo3 | 4,308 | defect | ee9123a2d278dee8b461f9c3ee3235dee9c755c0 | efebf5119cb6dd464a14affddaf910a85ccac1d3 | Automatically treat nested modules as submodules | fixes #4286
| diff --git a/newsfragments/4308.changed.md b/newsfragments/4308.changed.md
new file mode 100644
index 000000000000..6b5310cdd36d
--- /dev/null
+++ b/newsfragments/4308.changed.md
@@ -0,0 +1 @@
+Nested declarative `#[pymodule]` are automatically treated as submodules (no `PyInit_` entrypoint is created)
diff --git a/pyo... | 3 | 2 | 2 | [{"id": "G0", "claim": "The new automatic `submodule` attribute needs additional tests, in particular for a nested module on which `submodule` is already present, and the duplicate-setting error should ideally read \"submodules of declarative modules don't need `submodule` attribute set\".", "category": "testing", "ver... | null |
PyO3__pyo3__4349 | PyO3/pyo3 | 4,349 | defect | 0881fa0542261781565a77d62d98602e5e8d59ba | 9c54a0b1f037220cc546bd67e7be677e60d2eaa1 | Improve error messages for #[pyfunction] defined inside #[pymethods] | Make error message more specific when `#[pyfunction]` is used in `#[pymethods]`.
Effectively, this replaces the error message:
```
error: static method needs #[staticmethod] attribute
```
To:
```
functions inside #[pymethods] do not need to be annotated with #[pyfunction]
```
Fixes #4340
| diff --git a/newsfragments/4349.fixed.md b/newsfragments/4349.fixed.md
new file mode 100644
index 000000000000..0895ffa1ae1f
--- /dev/null
+++ b/newsfragments/4349.fixed.md
@@ -0,0 +1 @@
+Improve error messages for `#[pyfunction]` defined inside `#[pymethods]`
diff --git a/pyo3-macros-backend/src/pyimpl.rs b/pyo3-macro... | 2 | 2 | 2 | [{"id": "G0", "claim": "The new check should remove the `#[pyfunction]` attribute rather than only detecting it, so the error output no longer shows all the gibberish errors from the `pyfunction` macro expansion.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "cla... | null |
PyO3__pyo3__4692 | PyO3/pyo3 | 4,692 | defect | faa644afa4c0a88ecbc50c6c1b76d0bdbe795568 | 808676302d5886511fa00a684de54c19fe9d7830 | silence deprecation warning for enum with custom `__eq__` | Fixes #4687
This adjusts the deprecation warning so that it's conditionally emitted using good old auto ref specialization, so that if the user provides `__eq__` (or any other `__richcmp__` component) then the deprecation warning is not emitted. | diff --git a/newsfragments/4692.fixed.md b/newsfragments/4692.fixed.md
new file mode 100644
index 00000000000..a5dc6d098cf
--- /dev/null
+++ b/newsfragments/4692.fixed.md
@@ -0,0 +1 @@
+Fix incorrect deprecation warning for `#[pyclass] enum`s with custom `__eq__` implementation.
diff --git a/pyo3-macros-backend/src/pyc... | 1 | 1 | 1 | [{"id": "G0", "claim": "The fix does not work with a manual `__richcmp__` implementation directly; the reviewer's suggested patch to pymethod.rs should be applied to catch that case as well.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
PyO3__pyo3__4725 | PyO3/pyo3 | 4,725 | defect | 06d2affe0897c893498a262242b77900dc366cd6 | 8aaabb2d9cda2d89cd613d5e4dc95107fa04842d | Fix ambiguous associated item error | Fixes #4723. | diff --git a/pyo3-macros-backend/src/pyclass.rs b/pyo3-macros-backend/src/pyclass.rs
index 87d02c6f878d..78d469304aba 100644
--- a/pyo3-macros-backend/src/pyclass.rs
+++ b/pyo3-macros-backend/src/pyclass.rs
@@ -1075,7 +1075,10 @@ fn impl_complex_enum(
type Output = #pyo3_path::Bound<'py, Self::Target>;... | 2 | 2 | 1 | [{"id": "G0", "claim": "The `Self::Target` in the generated `IntoPyObject` impl for `#[pyclass]` (at pyclass.rs:2167, and the similar occurrence right above) may also hit the ambiguous associated item error on some platforms and should be fixed.", "category": "correctness", "verdict": "supported", "priority": "P1", "sc... | null |
PyO3__pyo3__4729 | PyO3/pyo3 | 4,729 | defect | 0fb3623d1e83467f2553b3e83d411a2849e443a5 | 9c728f587dca75e2f89a804c886cbffe8f6041ce | removes implicit default of trailing optional arguments (see #2935) | This continues #2935 and ~makes trailing optional arguments a hard error (for this release)~ removes implicit default of trailing optional arguments. This also already makes `Option<T>` args required, removing the ambiguity for this case already:
```rust
#[pyfunction]
fn function_with_required_after_option(_opt: Opt... | diff --git a/guide/src/function/signature.md b/guide/src/function/signature.md
index 8ebe74456a12..431cad87bfd9 100644
--- a/guide/src/function/signature.md
+++ b/guide/src/function/signature.md
@@ -2,7 +2,7 @@
The `#[pyfunction]` attribute also accepts parameters to control how the generated Python function accepts... | 2 | 1 | 0 | [{"id": "G0", "claim": "Skip the intermediate hard-error phase and start with the new behaviour immediately, rather than keeping the compile error for trailing Option<T> arguments for 1-2 releases.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "As a foll... | null |
PyO3__pyo3__4768 | PyO3/pyo3 | 4,768 | defect | 77202aab7e9d0aded57b21bc592b51f6342078b0 | 0608fa99f6cd872ddd219613f7d5876c3cb1b4c3 | reintroduce `vectorcall` optimization with new `PyCallArgs` trait | This reintroduces the `vectorcall` optimization we removed temporarily in #4653 using a new `PyCallArgs` trait as was discussed during the initial implementation in #4456.
This slightly reduces the number of types that can be passed to `PyAnyMethods::call` and friends. With this only Rust tuples (including unit), `B... | diff --git a/src/call.rs b/src/call.rs
new file mode 100644
index 000000000000..d29a032dc831
--- /dev/null
+++ b/src/call.rs
@@ -0,0 +1,120 @@
+//! TODO
+//!
+//!
+
+use crate::ffi_ptr_ext::FfiPtrExt as _;
+use crate::types::{PyAnyMethods as _, PyDict, PyString, PyTuple};
+use crate::{ffi, Borrowed, Bound, IntoPy... | 4 | 4 | 1 | [{"id": "G0", "claim": "The placeholder TODO comment at the top of src/call.rs should be replaced with meaningful documentation.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The PyCallArgs trait should carry a `#[diagnostic::on_unimplemented]` a... | null |
PyO3__pyo3__4900 | PyO3/pyo3 | 4,900 | defect | 8ab39d2c1820e67103b18c5e66cddef71049835e | a9ec2c0b68c0a2cd5e8900c884add246179e5bf2 | Format python traceback in impl Debug for PyErr. | Fixes #4863. | diff --git a/newsfragments/4900.changed.md b/newsfragments/4900.changed.md
new file mode 100644
index 000000000000..89bab779af1d
--- /dev/null
+++ b/newsfragments/4900.changed.md
@@ -0,0 +1 @@
+Format python traceback in impl Debug for PyErr.
diff --git a/src/err/mod.rs b/src/err/mod.rs
index 20108f6e8dc4..8f5c79c697d6... | 1 | 1 | 0 | [{"id": "G0", "claim": "The inner Result should be flattened into the outer Option for simplicity, handling a format error like `impl Display for Bound` does, since trying to render the error inside Debug could descend infinitely.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyO3__pyo3__4902 | PyO3/pyo3 | 4,902 | defect | 8ab39d2c1820e67103b18c5e66cddef71049835e | 84892ef969ea6c6c4962dffd17d2c137ff7a562b | fix multithreaded access to freelist pyclasses | Fixes #4894
Wraps the freelist in a mutex.
I removed the generic from the `FreeList` struct and renamed it `PyObjectFreeList`. That makes it much easier to add an `unsafe impl for Send`. The generic parameter in `FreeList` is not used for anything but `*mut PyObject`.
Note: I haven't benchmarked whether this c... | diff --git a/newsfragments/4902.fixed.md b/newsfragments/4902.fixed.md
new file mode 100644
index 00000000000..e377ab018d7
--- /dev/null
+++ b/newsfragments/4902.fixed.md
@@ -0,0 +1 @@
+* Fixed thread-unsafe implementation of freelist pyclasses on the free-threaded build.
\ No newline at end of file
diff --git a/pyo3-m... | 6 | 5 | 3 | [{"id": "G0", "claim": "The per-pyclass freelist should be stored in a GILOnceCell<Mutex<FreeList>> instead of a raw static-mut plus std::sync::Once initialization.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G3", "claim": "In alloc_with_freelist, the freelist mutex... | null |
PyO3__pyo3__4925 | PyO3/pyo3 | 4,925 | defect | 73ce4030ef09df7c799996253a332e9d402e2885 | fc26584e13cfeb16b53c0b05b25a65a6be08a61e | Convert `PathBuf` & `Path` into python `pathlib.Path` instead of `PyString` | closes #4907
| diff --git a/newsfragments/4925.changed.md b/newsfragments/4925.changed.md
new file mode 100644
index 00000000000..1501e375c63
--- /dev/null
+++ b/newsfragments/4925.changed.md
@@ -0,0 +1 @@
+Convert `PathBuf` & `Path` into python `pathlib.Path` instead of `PyString`
\ No newline at end of file
diff --git a/pytests/tes... | 3 | 2 | 1 | [{"id": "G0", "claim": "The PR may not safely handle paths that are not utf-8 when converting between Rust and Python representations, since both sides represent these but the Rust side treats them as an implementation detail.", "category": "correctness", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, ... | null |
PyO3__pyo3__4926 | PyO3/pyo3 | 4,926 | defect | 73ce4030ef09df7c799996253a332e9d402e2885 | 27692611162336ae2d9bccc25f6059fb4b498e94 | Add `#[pyclass(generic)]` | Closes #4849
Follow up of #4917
* [x] Add more tests
* [x] Add changelog entry
* [x] Update the documentation
* [x] Reject `generic` for enums; let's focus only on supporting structs for now
* [x] ~Error in Python 3.7 and 3.8~ (it just fails to compile for now)
* [x] Fix the compile error tests regressions... | diff --git a/guide/pyclass-parameters.md b/guide/pyclass-parameters.md
index 7ebca2ec821..2ac0dfb9aec 100644
--- a/guide/pyclass-parameters.md
+++ b/guide/pyclass-parameters.md
@@ -23,6 +23,7 @@
| `subclass` | Allows other Python classes and `#[pyclass]` to inherit from this class. Enums cannot be subclassed. |
| `un... | 4 | 3 | 2 | [{"id": "G0", "claim": "The macro registers __class_getitem__ with Python but does not emit the Rust function itself, which causes an error; the impl item needs to be added to the generated impl block as outlined.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1"... | null |
PyO3__pyo3__4941 | PyO3/pyo3 | 4,941 | defect | 241080aeba3e97f29ac2617cd89c0e26563d6703 | 111ec1b9f125370621215850448e5286c129b6f6 | add `#[pyo3(rename_all = "...")]` for `#[derive(FromPyObject)]` | This adds a `#[pyo3(rename_all = "...")]` container attribute for the `FromPyObject` derive macro. It will rename the extraction field on the Python side according to the renaming rule (same as the option on `#[pyclass]`). Explicitly renamed fields (via `attribute(...)`/`item(...)`) are left alone, mode change without ... | diff --git a/guide/src/conversions/traits.md b/guide/src/conversions/traits.md
index d6d29490dee2..139dcf55faff 100644
--- a/guide/src/conversions/traits.md
+++ b/guide/src/conversions/traits.md
@@ -476,6 +476,9 @@ If the input is neither a string nor an integer, the error message will be:
- changes the name of th... | 2 | 1 | 0 | [{"id": "G0", "claim": "The guide documentation for `#[pyo3(rename_all = \"...\")]` should either list the names of the allowed rename rules or link to the listing in the pyclass docs.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Codecov reports... | null |
PyO3__pyo3__5015 | PyO3/pyo3 | 5,015 | defect | 4aca459fd30441fa006c3eb388c812047f5465ce | 64f59a3424d6195b3f06e0a2447b3481f8eb9b39 | fix `#[pyfunction]` option parsing | We did not consume the "," after the `crate` option, so it could only be used as the last one.
Closes #5012
| diff --git a/newsfragments/5015.fixed.md b/newsfragments/5015.fixed.md
new file mode 100644
index 00000000000..b1da048828f
--- /dev/null
+++ b/newsfragments/5015.fixed.md
@@ -0,0 +1 @@
+Fixes compile error if more options followed after `crate` for `#[pyfunction]`.
\ No newline at end of file
diff --git a/pyo3-macros-b... | 1 | 1 | 0 | [{"id": "G0", "claim": "The parsing loop could be simplified to pass the whole parsed Punctuated sequence to add_attributes at once instead of accumulating options one element at a time.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyO3__pyo3__5070 | PyO3/pyo3 | 5,070 | defect | 7d166f70b4511392520fe8e1d5390c656eaa788f | bb3560dc532517b008bdf45fe916ff32c1f4b069 | unify `IntoPyObject`/`FromPyObject` derive attributes | This combines the attributes of the `IntoPyObject` and `FromPyObject` derive macros, such that individual options can still be used when deriving both.
Closes #4884 | diff --git a/newsfragments/5070.fixed.md b/newsfragments/5070.fixed.md
new file mode 100644
index 000000000000..0b4eb017ab89
--- /dev/null
+++ b/newsfragments/5070.fixed.md
@@ -0,0 +1 @@
+Fixes limited `#[pyo3()]` options when combining `#[derive(IntoPyObject, FromPyObject)]`
\ No newline at end of file
diff --git a/py... | 2 | 2 | 0 | [{"id": "G0", "claim": "The newsfragment should read 'Fix compile failure with `#[derive(IntoPyObject, FromPyObject)]` when using `#[pyo3()]` options recognised by only one of the two derives.' instead of the 'Fixes limited `#[pyo3()]` options when combining ...' wording.", "category": "documentation", "verdict": "supp... | null |
PyO3__pyo3__5101 | PyO3/pyo3 | 5,101 | defect | 5635b0f14678742152981c648d252ff2e0babc98 | c374a08ecedb6031d816e0e877547f0060f00233 | introduce `immutable_type` option for pyclasses | Adds `immutable_type` option allowing `pyclass` type objects to be immutable on Python >= 3.14.
Closes #2349 | diff --git a/guide/pyclass-parameters.md b/guide/pyclass-parameters.md
index 7ebca2ec821a..469721ba2782 100644
--- a/guide/pyclass-parameters.md
+++ b/guide/pyclass-parameters.md
@@ -12,6 +12,7 @@
| <span style="white-space: pre">`frozen`</span> | Declares that your pyclass is immutable. It removes the borrow checker ... | 4 | 4 | 0 | [{"id": "G0", "claim": "Consider making `immutable_type` work on Python 3.10+ by using `Py_TPFLAGS_IMMUTABLETYPE` (available since 3.10, and without `PyType_Freeze`'s requirement that base classes are immutable) instead of relying only on the 3.14-only `PyType_Freeze`.", "category": "design", "verdict": "supported", "p... | null |
PyO3__pyo3__5331 | PyO3/pyo3 | 5,331 | defect | b788b9b5aca3625a077c990738e7e3f7bb026cc1 | e6106f22a712487ac89a8f2fc4ddb87cf10be76a | Introspection: Basic pyclass(extends) support | Rely on `PyTypeInfo::TYPE_HINT` and the same system as decorators | diff --git a/pyo3-introspection/src/introspection.rs b/pyo3-introspection/src/introspection.rs
index eedbd625e5c5..66e64e161f88 100644
--- a/pyo3-introspection/src/introspection.rs
+++ b/pyo3-introspection/src/introspection.rs
@@ -120,9 +120,13 @@ fn convert_members<'a>(
chunks_by_parent,
... | 4 | 3 | 2 | [{"id": "G0", "claim": "Removing the $(;$generics:ident)* parameter from pyobject_subclassable_native_type! may break downstream users such as rust-numpy and departs from the generics syntax all the other macros share, so the parameter should be kept as-is.", "category": "design", "verdict": "supported", "priority": "P... | null |
PyO3__pyo3__5349 | PyO3/pyo3 | 5,349 | defect | e93393c84213bf5b02a9624eaa2b0cb2de12c1ec | dd047097e75ce3ad1057d453ecd504c4ffde7149 | add `PyErr::set_traceback` | This adds `PyErr::set_traceback` in an attempt to fix #5348. For Python 3.12+ this is pretty straight forward. For <3.12 it's a bit more tricky because we track it ourselves. For now used a `Mutex` to get the interior mutability, but since we always have a `Python` token available (and there is no free-threading in thi... | diff --git a/src/err/err_state.rs b/src/err/err_state.rs
index 8616979310f4..12ee528c7aea 100644
--- a/src/err/err_state.rs
+++ b/src/err/err_state.rs
@@ -4,6 +4,8 @@ use std::{
thread::ThreadId,
};
+#[cfg(not(Py_3_12))]
+use crate::sync::MutexExt;
use crate::{
exceptions::{PyBaseException, PyTypeError},
... | 3 | 2 | 0 | [{"id": "G0", "claim": "Instead of remapping the error into a new TypeError, call `.add_note()` to attach a note like 'this happened while processing argument X', which would work for all exception types and could drop the remapping entirely (doing nothing on old Python versions where notes do not exist).", "category":... | null |
PyO3__pyo3__5375 | PyO3/pyo3 | 5,375 | defect | a43cf79bbfbe9edd4545dc915c40fdcea7b5b10b | b69ef460dd1ece1ea4f5b47ec05d9e21b910a177 | use last segment of module name (path) when adding to parent | with submodules, the module `.__name__` is the full dotted import path (below, `"this.that"`). pyo3 is presently using that value for the key when adding the submodule to the parent but should instead be using just the last segment (below, "that"). there may be a more proper way to achieve this than this pr, but here... | diff --git a/newsfragments/5375.fixed.md b/newsfragments/5375.fixed.md
new file mode 100644
index 00000000000..ee6b3893e76
--- /dev/null
+++ b/newsfragments/5375.fixed.md
@@ -0,0 +1 @@
+Fixed `PyModuleMethods::add_submodul()` to use the last segment of the submodule name as the attribute name on the parent module inste... | 5 | 4 | 1 | [{"id": "G0", "claim": "Error-case coverage of add_submodule is incomplete — a pre-existing unchanged line and the added `?` branches are not exercised — and the author asks whether that partial coverage should be addressed as part of this PR.", "category": "testing", "verdict": "opposed", "priority": "P2", "scope": "i... | null |
PyO3__pyo3__5384 | PyO3/pyo3 | 5,384 | defect | c6dba9a3f2a340d0ad96107c20d8b80ed63327f2 | 3f2fab32eca9f999d58fa1a7595bafb4336a29c5 | deprecate `pyfn` attribute | Closes #694
Now that we have had declarative modules for some time, and they have been shown to work well, I think we are ready to deprecate the `#[pyfn]` attribute which is an old variant of `pyfunction` which worked inside imperative `#[pymodule]` functions. | diff --git a/guide/src/function.md b/guide/src/function.md
index b129480559c..2a3d8f84240 100644
--- a/guide/src/function.md
+++ b/guide/src/function.md
@@ -26,7 +26,6 @@ This chapter of the guide explains full usage of the `#[pyfunction]` attribute.
- [`#[pyo3(warn(message = "...", category = ...))]`](#warn)
- [Pe... | 1 | 1 | 1 | [{"id": "G0", "claim": "Add a UI test to make sure the deprecation of the `pyfn` attribute is correctly emitted.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
PyO3__pyo3__5387 | PyO3/pyo3 | 5,387 | defect | 55d379cff8e4157024ffe22215715bd04a5fb1a1 | 7b921c916de93bfe386c6c3c6bbd33989a4d66e0 | Fetch type name dynamically on cast errors instead of using `PyTypeInfo::NAME` | Introduce `PyTypeCheck::classinfo_object` that returns an object compatible with `instance` and make use of it.
Remove `PyTypeCheck::NAME` | diff --git a/newsfragments/5387.changed.md b/newsfragments/5387.changed.md
new file mode 100644
index 000000000000..bd6ad5b1fbb3
--- /dev/null
+++ b/newsfragments/5387.changed.md
@@ -0,0 +1 @@
+Fetch type name dynamically on cast errors instead of using `PyTypeInfo::NAME`
\ No newline at end of file
diff --git a/src/in... | 5 | 4 | 3 | [{"id": "G0", "claim": "The 10.84% cast-path performance regression from eagerly fetching the type name could be avoided by storing in the error a function pointer (or equivalent) that loads the type name at formatting time.", "category": "performance", "verdict": "supported", "priority": "P1", "scope": "introduced"}, ... | null |
PyO3__pyo3__5421 | PyO3/pyo3 | 5,421 | defect | a4a202d951551d1b63b23d3b365409c3489a8410 | 164fb7bfc1a117f16c0ce231bddb5580358778a1 | Implement `auto_new` attribute for `#[pyclass]` | PR for issue #5416
This introduces a new `#[pyclass]` attribute called `auto_new`, where `set_all` is required to be used alongside it. It automatically generates a `#[new]` function for this class, similar to that of the python dataclass. It requires the `multiple-pymethods` feautre, as it generates its own `#[pym... | diff --git a/guide/pyclass-parameters.md b/guide/pyclass-parameters.md
index 8fdb2122ff86..ddcabbec833c 100644
--- a/guide/pyclass-parameters.md
+++ b/guide/pyclass-parameters.md
@@ -21,6 +21,7 @@
| `rename_all = "renaming_rule"` | Applies renaming rules to every getters and setters of a struct, or every variants of a... | 12 | 11 | 4 | [{"id": "G0", "claim": "The restriction that `auto_new` requires the `multiple-pymethods` feature is not needed and should be removed, at the cost of a slightly more complicated implementation using `generate_protocol_slot` as done for `__str__`.", "category": "design", "verdict": "supported", "priority": "P2", "scope"... | null |
PyO3__pyo3__5450 | PyO3/pyo3 | 5,450 | defect | cb9111b608a1714ff7ce878103a931e37e9149f7 | c808cc47d0acb9f19eb1a8cda02511dfc0e5172b | Introspection: emit messages inline in the binaries instead of introducing a ptr+len indirection | Significantly simplifies the parsing by avoiding to resolve pointers and fixes compatibility with LLD
I dropped the old code path, we can add it back if we want to maintain backward compatibility
Thanks to uniffi for the inspiration | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d5261de24720..7e4c19e610ee 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -697,8 +697,7 @@ jobs:
with:
save-if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI... | 1 | 1 | 1 | [{"id": "G0", "claim": "The inline-emitted static carries no length, which the reviewer surmises breaks decoding for annotations greater than 4096 characters, and proposes instead storing each static as a #[repr(C)] struct of a u32 size plus the bytes so a length is still available.", "category": "design", "verdict": "... | null |
PyO3__pyo3__5488 | PyO3/pyo3 | 5,488 | defect | 2f4083ef19abfce8165319b1e3172a5965652be4 | 568f4ee3e288ef007766864afa656defe1d777a4 | move away from the `FromPyObject` blanket for `PyClass + Clone` | This proposes a first step in removing the `FromPyObject` blanket implementation for cloneable pyclasses.
This adds a marker trait `ExtractPyClassWithClone` which is automatically implemented by the `#[pyclass]` macro for every pyclass and modifies the blanket to require the marker. I think this should be functional... | diff --git a/guide/pyclass-parameters.md b/guide/pyclass-parameters.md
index 8fdb2122ff8..45d7714e23f 100644
--- a/guide/pyclass-parameters.md
+++ b/guide/pyclass-parameters.md
@@ -21,6 +21,7 @@
| `rename_all = "renaming_rule"` | Applies renaming rules to every getters and setters of a struct, or every variants of an ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The new `skip_from_py_object` option needs to be documented alongside the rest of the `#[pyclass]` options and somewhere in the guide, probably the \"Conversion Traits\" section.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim"... | null |
PyO3__pyo3__5550 | PyO3/pyo3 | 5,550 | defect | 85e6507f261e8a288fc699cb25bd6fd6986d2101 | 762ef5f11cd899817af4a5b0ef6d2d0dfee53bf7 | emit deprecation on pyclasses that are affected by the `FromPyObject` blanket impl | This emits a deprecation warning on `#[pyclass]`es that are affected by the `FromPyObject + Clone` blanket impl. It uses a `Probe` to detect the `Clone` impl and conditionally emits the deprecation. This ensures only types are flagged that are actually affected by the change. The deprecation can be suppressed by specif... | diff --git a/guide/src/class.md b/guide/src/class.md
index 26e6880d42b8..6c501bda0b60 100644
--- a/guide/src/class.md
+++ b/guide/src/class.md
@@ -887,7 +887,7 @@ Classes can also be passed by value if they can be cloned, i.e. they automatical
```rust,no_run
# #![allow(dead_code)]
# use pyo3::prelude::*;
-#[pyclass]... | 3 | 2 | 0 | [{"id": "G0", "claim": "The deprecation warning's hint should be reworded (as suggested) and its struct renamed so the message makes clear it applies to `#[pyclass]` types that implement `Clone`.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The ... | null |
PyO3__pyo3__5564 | PyO3/pyo3 | 5,564 | defect | c7c3c53abb5ca0a19fb05cfc29cc87cf14cd7890 | 3d047ffe7212c6c305f1fbe3922c64452b98f1bb | default to `gil_used = false` | Related to #5525 which has switched the default `gil_used` flag to `false` as part of that diff, also default modules created with `PyModule::new` to not require the GIL. This PR also takes the opportunity to add documentation to the migration guide. | diff --git a/guide/src/free-threading.md b/guide/src/free-threading.md
index 5222ff2202b..cf87d054ff5 100644
--- a/guide/src/free-threading.md
+++ b/guide/src/free-threading.md
@@ -29,16 +29,16 @@ free-threaded Python.
## Supporting free-threaded Python with PyO3
-Many simple uses of PyO3, like exposing bindings f... | 4 | 3 | 0 | [{"id": "G0", "claim": "The paragraph starting 'At a low-level, annotating a module sets the `Py_MOD_GIL` slot...' was accidentally rendered as a Markdown blockquote by a leading `>`, which the reviewer thinks is a typo.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"... | null |
PyO3__pyo3__5608 | PyO3/pyo3 | 5,608 | defect | 7ed0b2f2aeb5dbc40c9017acc191db5106dd7286 | 80f8d06b6118dbd9c290edb1d7b423f13b18f561 | drop `unindent` and `indoc` dependencies | With const eval getting more powerful, we're able to drop the `indoc` and `unindent` dependencies for the `py_run!` macro. | diff --git a/Cargo.toml b/Cargo.toml
index c5628a94d4e..1a7588b5f95 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -33,8 +33,6 @@ pyo3-ffi = { path = "pyo3-ffi", version = "=0.27.1" }
# support crates for macros feature
pyo3-macros = { path = "pyo3-macros", version = "=0.27.1", optional = true }
-indoc = { version = "... | 5 | 5 | 1 | [{"id": "G0", "claim": "The new const `unindent_sized` code needs `copy_from_slice`, which is const-stable only from Rust 1.87.0, so it would break the crate's MSRV build.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "unindent_bytes is a bit hard t... | null |
PyO3__pyo3__5677 | PyO3/pyo3 | 5,677 | defect | 6af95957d5f3022d0dbc9f6d19f393d0e425a22f | e32cbf838a83bcc36c09289a9edd231bf8fc1264 | clean up handling of default values in function signatures | This is a bit of a cleanup following on from #4729:
- Adds test cases to the trailing option case to make sure we don't treat them as having defaults of `None` any more (we seemed to be missing tests).
- Refactors the macro code to store the default value expressions within the `PythonSignature` struct; this makes ... | diff --git a/pyo3-macros-backend/src/method.rs b/pyo3-macros-backend/src/method.rs
index fd43d4f28be..e6e1aaeaf07 100644
--- a/pyo3-macros-backend/src/method.rs
+++ b/pyo3-macros-backend/src/method.rs
@@ -9,7 +9,7 @@ use syn::{ext::IdentExt, spanned::Spanned, Ident, Result};
use crate::pyfunction::{PyFunctionWarning... | 2 | 2 | 0 | [{"id": "G0", "claim": "In `handle_positional` (signature.rs ~line 331), the `if default_value.is_some()` block that pushes `default_value.unwrap()` could be written as an `if let Some(v) =` binding instead.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", ... | null |
PyO3__pyo3__5684 | PyO3/pyo3 | 5,684 | defect | e74edbf955730d51c8cad9d7f0bc55092ab419fe | d7a22d06f964eff1ab677e2aaf1e3cafdceebc69 | Simplify method receivers in macros | This cleans up the handling of the "self" parameter, particularly inside `async` functions, by using our `PyClassGuard(Mut)` types rather than custom owning types used just in the coroutine functions.
This is a first step at getting my head around the problem in #5681 | diff --git a/newsfragments/5684.changed.md b/newsfragments/5684.changed.md
new file mode 100644
index 00000000000..f5b522da4f9
--- /dev/null
+++ b/newsfragments/5684.changed.md
@@ -0,0 +1 @@
+`async` pymethods now borrow `self` only for the duration of awaiting the future, not the entire method call.
diff --git a/pyo3-... | 2 | 2 | 0 | [{"id": "G0", "claim": "The mutable/immutable branch could be less verbose by passing a single if-expression to syn::Ident::new instead of duplicating the call.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "A SAFETY comment should be added abov... | null |
PyO3__pyo3__5693 | PyO3/pyo3 | 5,693 | defect | af7a82025b50aef3b33aa5fce090234fc9e1dc1d | 75d7ef9df4d4772d2bc0be8582f091fa766f0e08 | change `CastError` to describe the `isinstance` failure | As discussed in https://github.com/PyO3/pyo3/pull/5472#issuecomment-3634127023, this improves the clarity of the failure in `.cast()` operations.
cc @Icxolu @orlp | diff --git a/guide/src/conversions/traits.md b/guide/src/conversions/traits.md
index dc6a91ed1cb..31081e0185c 100644
--- a/guide/src/conversions/traits.md
+++ b/guide/src/conversions/traits.md
@@ -444,7 +444,7 @@ enum RustyEnum {
# }
```
-If the input is neither a string nor an integer, the error message will be: `... | 2 | 2 | 0 | [{"id": "G0", "claim": "The test casting a None object against the classinfo 'int | NoneType' is confusing because NoneType appears twice — the None object reads as not being an instance of NoneType — and it would be clearer to use a classinfo like 'int | str'.", "category": "testing", "verdict": "supported", "priority... | null |
PyO3__pyo3__5699 | PyO3/pyo3 | 5,699 | defect | 6c5d391235d8407659d2fa2a7f4af0ec3f449a45 | d25fbf74c6a01be1804a41294751b162c84b5f76 | Implement deleters | Adds a `#[deleter]` macro attribute
When deleter is set, the `PyGetSetDef.setter` function calls the setter or deleter depending on if the value is `NULL` or not
Issue #5686 | diff --git a/guide/src/class.md b/guide/src/class.md
index 466682c83b8..1c83b359cb0 100644
--- a/guide/src/class.md
+++ b/guide/src/class.md
@@ -14,6 +14,7 @@ Below is a list of links to the relevant section of this chapter for each:
- [`#[new]`](#constructor)
- [`#[getter]`](#object-properties-using-getter-and-s... | 2 | 2 | 0 | [{"id": "G0", "claim": "The pre-existing `Setter` type could be changed to take `NonNull<*mut ffi::PyObject>` as the value, which might allow dropping some checks inside the setter functions themselves.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "Th... | null |
PyO3__pyo3__5729 | PyO3/pyo3 | 5,729 | defect | 0f4c7ca2227b7d4c712c187b3c88bc56bc620215 | 7fbff3fcaeb00a029cae57299cf3dc79485acd81 | Add wasm32-wasip1 test job | This new CI job compiles a instance of cpython for wasip1 using [their build script](https://github.com/python/cpython/tree/main/Tools/wasm/wasi) and then uses that to run the tests. I've disabled all the tests that where currently failing. Most of the failing tests required unwinding, which is not supported on wasip1 ... | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 06704a30e26a..1cd1131c8ac3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -487,6 +487,82 @@ jobs:
.nox/emscripten
key: emscripten-${{ hashFiles('emscripten/*') }}-${{ hashFiles('noxfile.py') }}-${{ st... | 1 | 1 | 0 | [{"id": "G0", "claim": "The `#[cfg(not(target_os = \"wasi\"))]` gate on test_detach_panics_safely should instead be conditional on `panic = \"unwind\"` to make it future proof.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyO3__pyo3__5731 | PyO3/pyo3 | 5,731 | defect | 7fb7ddedb27e270a168092566107ed8731ac0c43 | 9d934ef024a9a8bedf9d07f00525ab87c59d7371 | Stub generation & introspection: emit async keyword for async functions | Currently, async functions do not emit the `async` keyword when introspected.
```rs
#[pyfunction]
async fn foo() {}
```
results in
```pyi
def foo() -> None: ...
```
This MR checks the `asyncness` of a function, and emits `"async "` if required. For properties (getters and setters) this is unnecessary b... | diff --git a/newsfragments/5731.added.md b/newsfragments/5731.added.md
new file mode 100644
index 00000000000..a92fdf3966e
--- /dev/null
+++ b/newsfragments/5731.added.md
@@ -0,0 +1 @@
+Stub generation & introspection: emit `async` keyword for async functions.
diff --git a/noxfile.py b/noxfile.py
index 9fa8188dd27..076... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new async test fixture (both the function definition and the `use` export) should be gated with `#[cfg(feature = \"experimental-async\")]` alone, since it is ok to include the async function even when introspection is not done.", "category": "design", "verdict": "supported", "priority": "P2"... | null |
PyO3__pyo3__5733 | PyO3/pyo3 | 5,733 | defect | cc0e690b4c237499e13d54983484ab2b5ba32f1d | 14e01396108618dcf2bd99db5995231965fe2999 | enable extending native types on abi3 for 3.12+ | This uses the infrastructure from #5728 to enable subclassing native types on abi3 for 3.12+.
Closes #1344 | diff --git a/guide/src/class.md b/guide/src/class.md
index e5df5285fccf..c7ae2941c78e 100644
--- a/guide/src/class.md
+++ b/guide/src/class.md
@@ -528,7 +528,7 @@ To convert between the Rust type and its native base class, you can take `slf` a
To access the Rust fields use `slf.borrow()` or `slf.borrow_mut()`, and to ... | 3 | 2 | 0 | [{"id": "G0", "claim": "Tpt notes the 'Closes #1344' claim may not be fully true, since supporting 3.10+ is likely required to remove things like `create_exception!`.", "category": "documentation", "verdict": "uncertain", "priority": "P3", "scope": "pre_existing"}, {"id": "G1", "claim": "A TODO should remain noting tha... | null |
PyO3__pyo3__5743 | PyO3/pyo3 | 5,743 | defect | c969dd0253111b62e7b5c1153fc71d5cb3c139ce | 3851142bb8a4f5d54f0161d6a2d816ba13c0d2af | Introspection: adds constants to the AST | Use it for default values and custom signature hints
First step to support Literal type-hints and user-provided hints written using Rust AST
| diff --git a/pyo3-introspection/src/introspection.rs b/pyo3-introspection/src/introspection.rs
index c89701e205f..bf6f87cdb8e 100644
--- a/pyo3-introspection/src/introspection.rs
+++ b/pyo3-introspection/src/introspection.rs
@@ -1,5 +1,5 @@
use crate::model::{
- Argument, Arguments, Attribute, Class, Constant, Expr... | 6 | 3 | 2 | [{"id": "G0", "claim": "Code coverage in this pull request is sparse, and the author plans to improve it later as part of the work on iterating on custom signature annotations.", "category": "testing", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The name PythonTypeHint is no... | null |
PyO3__pyo3__5784 | PyO3/pyo3 | 5,784 | defect | 12d57fe6a3e061b99a7ac46cbc6f4d1f54d32edc | 3443c7a332e1c45d28f78caaa8375dfbdd466b00 | Fix ambiguous associated item error | Fixes #5781
It's possible to use `<Self as #pyo3_path::FromPyObject<..., ...>>::Error` instead of `#pyo3_path::PyErr` in `frompyobject.rs`, but it requires changing a bit more code, and I don't think it's more readable | diff --git a/newsfragments/5784.fixed.md b/newsfragments/5784.fixed.md
new file mode 100644
index 000000000000..6b06c61b8de2
--- /dev/null
+++ b/newsfragments/5784.fixed.md
@@ -0,0 +1 @@
+Fix `ambiguous_associated_items` compilation error when deriving `FromPyObject` or using `#[pyclass(from_py_object)]` macro on enums... | 3 | 3 | 0 | [{"id": "G0", "claim": "Nit: change `#[pyclass(eq, from_py_object)]` to `#[pyclass(from_py_object)]` on SimpleItemsFromPyObject so the test is more self-contained.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Drop `PartialEq` from the derive o... | null |
PyO3__pyo3__5797 | PyO3/pyo3 | 5,797 | defect | 5338c48d479fd9505ad65db6382114aa6b317ce6 | f782e60e300e6d529bd4047498cf9fb431a65e45 | deprecate get_refcnt (#3357) | Closes #3357 and PR #4065 which is now obsolete
From Python docs https://docs.python.org/3/glossary.html#term-reference-count
> In [CPython](https://docs.python.org/3/glossary.html#term-CPython), reference counts are not considered to be stable or well-defined values; the number of references to an object, and ho... | diff --git a/guide/src/class.md b/guide/src/class.md
index 16465f2cb5fe..f1a5bba86ae1 100644
--- a/guide/src/class.md
+++ b/guide/src/class.md
@@ -968,8 +968,8 @@ fn increment_then_print_field(my_class: &Bound<'_, MyClass>) {
// When the Python object smart pointer needs to be stored elsewhere prefer `Py<T>` over `Bou... | 5 | 4 | 2 | [{"id": "G0", "claim": "While deprecating get_refcnt, the PR should also add wrappers for PyUnstable_Object_IsUniquelyReferenced, falling back to the pythoncapi-compat backport on Pythons where it is unavailable, since checking refcnt == 1 is a common idiom that this API is meant to replace.", "category": "design", "ve... | null |
PyO3__pyo3__5837 | PyO3/pyo3 | 5,837 | defect | 3ffad5a9b2ef89c7a8fe2015bbba16b4d3a72097 | fd3c5fe5e806645cb12329d41f27edfed8c26468 | fix(pyo3-macros): allow pyclass named Probe | The `*` import was shadowing the name of the pyclass.
Fixes #4792.
I tested on a codebase that had one struct/pyclass named Probe, and many other structs/pyclasses.
But I'm not sure if some of the imports that I removed are necessary in other situations that I have not tested. | diff --git a/pyo3-macros-backend/src/pyclass.rs b/pyo3-macros-backend/src/pyclass.rs
index 403f7895a28b..bdab57c257c5 100644
--- a/pyo3-macros-backend/src/pyclass.rs
+++ b/pyo3-macros-backend/src/pyclass.rs
@@ -3010,13 +3010,14 @@ impl<'a> PyClassImplsBuilder<'a> {
type BaseNativeType = #base_nativetyp... | 4 | 4 | 2 | [{"id": "G0", "claim": "Add a testcase for allowing a pyclass named Probe so the fix does not regress.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Restore the commented-out #[cfg(not(feature = \"multiple-pymethods\"))] on PyMethods by importing the t... | null |
PyO3__pyo3__5881 | PyO3/pyo3 | 5,881 | defect | d07a1abf347d84b1b266640622cd8b6272abeec1 | 47dcbdfde446c31ec107a8c1ffb7f0bc3547df36 | improve `PyCapsule` constructors | Closes #5692 | diff --git a/newsfragments/5881.added.md b/newsfragments/5881.added.md
new file mode 100644
index 000000000000..790d0b78e172
--- /dev/null
+++ b/newsfragments/5881.added.md
@@ -0,0 +1 @@
+added `PyCapsule::new_with_value` and `PyCapsule::new_with_value_and_destructor`
diff --git a/src/instance.rs b/src/instance.rs
ind... | 6 | 2 | 0 | [{"id": "G0", "claim": "The added doc tests could drop the explicit `# fn main()` wrapper line, since rustdoc supports hiding it with `# `.", "category": "documentation", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "`new_with_value` and `new_with_value_and_destructor` can be im... | null |
PyO3__pyo3__5970 | PyO3/pyo3 | 5,970 | defect | dd63a6ae3ec3aa1856c2a0ef906f389e50a52fdc | 3cd71fac1da8509cc8c08cd26cf7efabd711ad01 | Misc cleanups | I've been re-familiarizing myself with pyo3 a bit :) While doing so I found some cleanups here and there. | diff --git a/pyo3-build-config/src/lib.rs b/pyo3-build-config/src/lib.rs
index 4e705d2ca02..65d7f1bade4 100644
--- a/pyo3-build-config/src/lib.rs
+++ b/pyo3-build-config/src/lib.rs
@@ -257,11 +257,6 @@ pub fn print_feature_cfgs() {
/// - <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check... | 3 | 2 | 1 | [{"id": "G0", "claim": "The abi3 note in `PyClassBaseType`'s diagnostic is outdated: since #5733 native-type subclassing is supported on Python 3.12+, so the note should only apply below 3.12 and say subclassing native types requires Python >= 3.12 when using the `abi3` feature.", "category": "documentation", "verdict"... | null |
PyO3__pyo3__5999 | PyO3/pyo3 | 5,999 | defect | e883df148078f2c55771f24dd55fc6745d2a9847 | 9fa312fdc38888a3be18d76e71a94a98ac22b3e7 | Remove errors when type annotations used without `experimental-inspect` | I want to be able to build with the `experimental-inspect` feature enabled for generating type stubs, but without it for the release build of my extension. It reduces the extension DLL from 7MB to 6MB, and since I ship the generated type stubs anyway, there's no need to include this extra data in the binary.
However... | diff --git a/guide/src/type-stub.md b/guide/src/type-stub.md
index 186225296b1e..0ac11a54e5f6 100644
--- a/guide/src/type-stub.md
+++ b/guide/src/type-stub.md
@@ -66,10 +66,10 @@ class Class:
def __eq__(self, other: Class) -> bool: ...
def __ne__(self, other: Class) -> bool: ...
-def list_of_int_identity(ar... | 5 | 4 | 0 | [{"id": "G0", "claim": "The author should add a changelog entry in newsfragments/5999.changed.md.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "signature.md should be updated so the definition of the `#[pyo3(signature = ...)]` attribute shows tha... | null |
PyPSA__PyPSA__1023 | PyPSA/PyPSA | 1,023 | defect | b1567f7395e6eebe397ae5a9522c7243f323948a | a61fa5a4210dfdc76ca421801ca2fa3fecf6f0f5 | cloud object storage io with cloudpathlib | Closes # (if applicable).
## Changes proposed in this Pull Request
Enable import and export directly from files in cloud object storage. Optional dependency on `cloudpathlib`, installable via `pypsa[cloudpath]`.
## Checklist
- [x] Code changes are sufficiently documented; i.e. new functions contain docstrings... | diff --git a/doc/references/release-notes.rst b/doc/references/release-notes.rst
index d5b693ec6..80c12e076 100644
--- a/doc/references/release-notes.rst
+++ b/doc/references/release-notes.rst
@@ -11,6 +11,9 @@ Release Notes
.. To use the features already you have to install the ``master`` branch, e.g.
.. ``pip ... | 3 | 3 | 0 | [{"id": "G0", "claim": "The `path` argument docstrings should carry a small note that cloud object storage URIs are accepted.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The docs section should explicitly list supported providers (AWS S3, Googl... | null |
PyPSA__PyPSA__1091 | PyPSA/PyPSA | 1,091 | defect | ea13307c8ef9843d2f61fa9ed4f9dd4c47c536d6 | e4cd41621aeb53c5511936351b5183733f6e62b2 | Minor improvement of snapshots handling | Closes #1082
## Changes proposed in this Pull Request
**Current state**
- Snapshots can be single or multi-indexed (have investment periods). This is currently represented by ambiguous index names:
- Without investment periods:
- `n.snapshots.index.name` - `'snapshot'`
- `n.snapshots.index.names`: `[... | diff --git a/examples/scigrid-de/scigrid-with-load-gen-trafos/network.csv b/examples/scigrid-de/scigrid-with-load-gen-trafos/network.csv
index 57874aaea..0f72d8c13 100644
--- a/examples/scigrid-de/scigrid-with-load-gen-trafos/network.csv
+++ b/examples/scigrid-de/scigrid-with-load-gen-trafos/network.csv
@@ -1,2 +1,2 @@... | 4 | 3 | 1 | [{"id": "G0", "claim": "The `index_name` parameter documentation should be removed from the as_index docstring, since the PR removed that parameter from the signature.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The PR unintentionally changed t... | null |
PyPSA__PyPSA__1139 | PyPSA/PyPSA | 1,139 | defect | 108ba337395cc8d83426ce08099e0eead7ebb132 | 12522a965e8defe8818427edaa521a2579f39547 | test: mock cloudpathlib | Closes # (if applicable).
## Changes proposed in this Pull Request
Follow up to https://github.com/PyPSA/PyPSA/pull/1023
* Implement extensive testing using [mocked local implementations provided by cloudpathlib](https://cloudpathlib.drivendata.org/stable/testing_mocked_cloudpathlib/). This remains an optional f... | diff --git a/doc/references/release-notes.rst b/doc/references/release-notes.rst
index 49c218326..f7578dcb8 100644
--- a/doc/references/release-notes.rst
+++ b/doc/references/release-notes.rst
@@ -11,6 +11,12 @@ Release Notes
.. To use the features already you have to install the ``master`` branch, e.g.
.. ``pip... | 1 | 1 | 0 | [{"id": "G0", "claim": "Uncomment the 'Upcoming Release' header and warning above the new release-notes entry.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyPSA__PyPSA__1143 | PyPSA/PyPSA | 1,143 | defect | 4e699826e05e088608a729f112f46000fa4fd4aa | 94d4867684f4c91945f8f16473d7105840c7f6c7 | fix(io): add optional 'quotechar' parameter to import_from_csv_folder() | ## Changes proposed in this Pull Request
Hello! I wanted to propose this small edit (`io` is the only module involved) because I faced an issue in importing a network (the one from [1, 2]) with `Network.import_from_csv_folder`.
I just added a `quotechar: str = '"'` argument to the `import_from_csv_folder` method ... | diff --git a/pypsa/io.py b/pypsa/io.py
index f50b64216..6f04badba 100644
--- a/pypsa/io.py
+++ b/pypsa/io.py
@@ -130,9 +130,12 @@ class Importer(ImpExper):
class ImporterCSV(Importer):
- def __init__(self, csv_folder_name: str | Path, encoding: str | None) -> None:
+ def __init__(
+ self, csv_folder_n... | 3 | 3 | 2 | [{"id": "G0", "claim": "Add the quotechar parameter to the CSV export function as well, since it was only added to the import side.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add a test covering the new quotechar argument.", "category": "testing", "v... | null |
PyPSA__PyPSA__1164 | PyPSA/PyPSA | 1,164 | defect | 96e96828340defcdea4e044daa7de565bec97633 | ba18c8fa5af7326b67167fb5a5e02e9c36fb6d25 | Xarray view 2 | * Use `as_xarray` function (potentially rename) instead of `ds` property
* adjust variables.py code
## Checklist
- [ ] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in `doc`.
- [ ] Unit tests for new features were added (if applicable).... | diff --git a/pypsa/components/abstract.py b/pypsa/components/abstract.py
index 3ca8c9f98..77c9ff89e 100644
--- a/pypsa/components/abstract.py
+++ b/pypsa/components/abstract.py
@@ -19,8 +19,15 @@
import xarray
from pyproj import CRS
-from pypsa.common import equals
-from pypsa.components.descriptors import get_acti... | 6 | 2 | 0 | [{"id": "G0", "claim": "Methods should be moved out of pypsa/components/abstract.py into later modules (like descriptors.py), keeping only properties in abstract.py, and everything used for ds/as_xarray should be internal so there is a single bottleneck.", "category": "design", "verdict": "supported", "priority": "P2",... | null |
PyPSA__PyPSA__1183 | PyPSA/PyPSA | 1,183 | defect | c5babed73be4a96636b2e65cab2a7ec0c159d933 | 9a1b3f151111ef5b0f1fc4c5babbd145a0fd1741 | feat: add system_cost method to calculate total system cost from capital and operational expenditures | ## Changes proposed in this Pull Request
Add statistic `n.statistics.system_cost()` that is the sum of `n.statistics.opex() + n.statistics.capex()`. Will be useful with #1156
## Checklist
- [x] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be give... | diff --git a/doc/references/release-notes.rst b/doc/references/release-notes.rst
index 9dddd874d..742f1b9c6 100644
--- a/doc/references/release-notes.rst
+++ b/doc/references/release-notes.rst
@@ -49,6 +49,8 @@ Minor improvements
* Added warning for consistent legend circle and semicirle sizes when combining plots o... | 2 | 2 | 1 | [{"id": "G0", "claim": "The system cost reported by the new system_cost method would also include start-up and shut-down costs, which the reviewer notes.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new system_cost method should be added to th... | null |
PyPSA__PyPSA__1189 | PyPSA/PyPSA | 1,189 | defect | 5de997ae406bd24334a399dc17586907ed89f872 | cf9fb120ae9c1c76fb84db123f0d64317ace7eb5 | Interactive Plotting | Closes #292
This PR introduces mirror of the recently added plotting library for interactive **chart** plots based on plotly.
The accessor is now chosen to follow
`n.statistics.energy_balance.iplot.x`
For map plots the iplot function in the maps.py would have to be updated.
## Changes proposed i... | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 2fb8bfe4b..7573164ce 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -79,13 +79,13 @@ jobs:
- name: Run unit tests # Also includes doctests
if: matrix.os != 'windows-latest' || matrix.python-version != '3.... | 7 | 3 | 1 | [{"id": "G0", "claim": "Removing the '--mpl-default-tolerance' flag in the workflow may lead to inconsistencies with the tests that expect a tolerance of 40; consider verifying that tests run consistently across environments or reintroducing the explicit tolerance if needed.", "category": "testing", "verdict": "uncerta... | null |
PyPSA__PyPSA__1236 | PyPSA/PyPSA | 1,236 | defect | 9088d37630fc8746686adc2e9992cee73272e957 | e955d49b2e64dcbf8b04b2e3f6f21f32a416f423 | Fix: dynamic expressions for assigned model with subset of snapshots | When trying to formulate dynamic expressions with the optimization module (energy_balance, opex, etc) on a network with a subset of snapshots in the model, we ran into errors. This fixes it.
## Checklist
- [x] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explan... | diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 0000000000..bbb18a49da
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,102 @@
+## Project Overview
+
+PyPSA (Python for Power System Analysis) is an open source toolbox for simulating and optimizing ... | 3 | 1 | 0 | [{"id": "G0", "claim": "The pattern of extracting the `snapshot` index and applying `.loc[sns]` is repeated across several expression methods; consider factoring it into a small helper to reduce duplication.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", ... | null |
PyPSA__PyPSA__1269 | PyPSA/PyPSA | 1,269 | defect | b75a8ecaf7798a725c29122fb0ac9e5ab8734698 | 8cdc683e48601c65e92ff8d13583b4054b7778c2 | Add additional MGA functionality and example | Introduces new functions in optimization/abstract.py to facilitate the analysis of trade-offs between multiple objectives/dimensions using near-optimal methods. Allows for solving a network in a direction given in the coordinate space of user-specified dimensions, and also introduces a parallelized function to solve in... | diff --git a/pypsa/optimization/abstract.py b/pypsa/optimization/abstract.py
index 47350ca61..cac179a16 100644
--- a/pypsa/optimization/abstract.py
+++ b/pypsa/optimization/abstract.py
@@ -4,16 +4,20 @@
from __future__ import annotations
+import copy
import gc
import logging
from itertools import product
+from ... | 10 | 10 | 1 | [{"id": "G0", "claim": "The MGA example/docs should eventually become a dedicated section in the user guide (via a change based on #1250) rather than only an example notebook, though this is fine for now.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "clai... | null |
PyPSA__PyPSA__1363 | PyPSA/PyPSA | 1,363 | defect | 338cf685f83f178956e49a2f1c6fda69bfae89ec | f53f508c81d462a3f92d8e71e06b32a011b020c1 | feat: new `n[..]` | Closes #1332
## Changes proposed in this Pull Request
Adds `n.get_collection`, `n.get_scenario` and `n.slice_network` and combines them all in `n[..]`.
@coroa You wrote the original `__getitem__` ages ago and it seems nobody knew about its existance. Could you review and confirm that this was never a "shallow" ... | diff --git a/doc/references/release-notes.rst b/doc/references/release-notes.rst
index 033b3bf37..68b6742e0 100644
--- a/doc/references/release-notes.rst
+++ b/doc/references/release-notes.rst
@@ -48,6 +48,8 @@ Features
* Add additional standard line types from pandapower.
+* New network indexing methods: ``n.get_... | 1 | 1 | 1 | [{"id": "G0", "claim": "Fancy datetime-based snapshot indexing such as n[\"2024-03\", :] would no longer work because slice_network resolves snapshots via self.snapshots[snapshots] instead of self.snapshots.get_indexer, and the reviewer asks to use the get_indexer-based lookup instead.", "category": "correctness", "ver... | null |
PyPSA__PyPSA__1386 | PyPSA/PyPSA | 1,386 | defect | 45ee4e4fd04c2f22f2d62b4b0f0a89e04706374d | d2d04f66051a0b7408b3983d0ef767f8fd9ea9d9 | fix(statistics): allow at_port to be specified manually | ## Changes proposed in this Pull Request
For retrieving statistics in respect to a specific port, we'd want the
`at_port` statistics argument be able to accept a single port or a list of
ports (as the type arguments already said they would).
This means that for links with an efficiency of 0.9, they could be acc... | diff --git a/pypsa/statistics/abstract.py b/pypsa/statistics/abstract.py
index d6cc4f3f7d..43a0eb1d9d 100644
--- a/pypsa/statistics/abstract.py
+++ b/pypsa/statistics/abstract.py
@@ -156,8 +156,23 @@ def _aggregate_components(
for col in n.c[c].static
if (match := RE_PORTS.search(str(c... | 14 | 9 | 4 | [{"id": "G0", "claim": "The `at_port` docstring line \"- False: Exclude first port (\\\"bus\\\"/\\\"bus0\\\")\" states the opposite of the behaviour and should read \"- False: Consider only first port (\\\"bus\\\"/\\\"bus0\\\")\".", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "pre_ex... | null |
PyPSA__PyPSA__1404 | PyPSA/PyPSA | 1,404 | defect | 6772f4bc47c5860183ffc394747e7e379314cec1 | 5c9114a362ccc4b2504f2cbca53fdb7b5f857b2e | Fix scenario getter | <!--
SPDX-FileCopyrightText: PyPSA Contributors
SPDX-License-Identifier: MIT
-->
Closes #1402
## Checklist
- [x] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in `docs`.
- [x] Unit tests for new features were added (if applicable).
... | diff --git a/docs/release-notes.md b/docs/release-notes.md
index 22cf13aec..544c84edf 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,11 @@ SPDX-License-Identifier: CC-BY-4.0
next update! If you would like to use these features in the meantime, you will need
to install the `master... | 2 | 2 | 0 | [{"id": "G0", "claim": "The Bug Fixes entry should link `get_scenario()` and `n['scenario']` via their cross-reference syntax instead of plain code formatting, and the Upcoming Release callout should be uncommented.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": ... | null |
PyPSA__PyPSA__1450 | PyPSA/PyPSA | 1,450 | defect | 1ce2b47018e9261ab73d2394b79101a4d12254f3 | 1b9f64da21a151b2a7d4915a67af653fe489dad9 | fix: using inactive generators in global carrier constraint | Closes #1449
## Checklist
- [x] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in `docs`.
- [x] Unit tests for new features were added (if applicable).
- [x] A note for the release notes `docs/release-notes.md` of the upcoming release is inc... | diff --git a/docs/release-notes.md b/docs/release-notes.md
index ead7a370a..9c3f548bc 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -5,13 +5,17 @@ SPDX-License-Identifier: CC-BY-4.0
-->
# Release Notes
-<!--## Upcoming Release
+## Upcoming Release
!!! info "Upcoming Release"
The featur... | 2 | 2 | 2 | [{"id": "G0", "claim": "The stores are missing in the active-asset filtering of the global carrier constraint's primary energy limit, so inactive stores are still counted.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The investment periods are not... | null |
PyPSA__PyPSA__1457 | PyPSA/PyPSA | 1,457 | defect | 693aefd40ce5d7a8b1b6e2be59b5e8cf93b571a1 | 85cc57015b7ab035698bb9a63bbc8908fb8aaa54 | fix: CVaR optimization fails if components have no marginal costs | Closes https://github.com/PyPSA/PyPSA/issues/1456 and adds related tests.
## Checklist
- [x] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in `docs`.
- [x] Unit tests for new features were added (if applicable).
- [x] A note for the rel... | diff --git a/docs/release-notes.md b/docs/release-notes.md
index ead7a370a..c1fabb2da 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,10 @@ SPDX-License-Identifier: CC-BY-4.0
next update! If you would like to use these features in the meantime, you will need
to install the `master`... | 1 | 1 | 0 | [{"id": "G0", "claim": "The empty-opex branch could be written more compactly by folding the condition into a single expression per scenario instead of the if/else block.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyPSA__PyPSA__1508 | PyPSA/PyPSA | 1,508 | defect | dce7e26bf43de9030a401fdf89019e6f559d23ab | 5d1561b79495ae991f695974816feba208701743 | feat: Add temporal clustering functionality | ## Changes proposed in this Pull Request
This PR implements temporal clustering functionality for PyPSA, enabling users to reduce the temporal resolution of networks while preserving total modeled hours through snapshot weighting adjustments. This is an upstream implementation based on patterns from PyPSA-EUR.
### Ne... | diff --git a/docs/release-notes.md b/docs/release-notes.md
index c592a9ceb..3b5057ff4 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -5,13 +5,30 @@ SPDX-License-Identifier: CC-BY-4.0
-->
# Release Notes
-<!--## Upcoming Release
+
+## Upcoming Release
!!! info "Upcoming Release"
The feat... | 27 | 25 | 6 | [{"id": "G0", "claim": "The clustering package/accessor should be renamed to SpatialClustering in the long term.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The yearly test fixture uses 8760 hours for leap year 2020, which has 8784 hours, and is not... | null |
PyPSA__PyPSA__1646 | PyPSA/PyPSA | 1,646 | defect | c06804b53046bacf7d548abf93db48c5bbbc9e73 | 0cef7da3388c2d6b0723fe091920b86f3d102902 | Apply investment_period_weightings to cost statistics | Closes #1287.
## Changes proposed in this Pull Request
For multi-investment-period networks, the statistics module did not apply `investment_period_weightings` to monetary results. This caused `capex`, `installed_capex`, and `opex` to report unweighted values per period, inconsistent with the optimization objecti... | diff --git a/docs/release-notes.md b/docs/release-notes.md
index 747fa803b..846b34108 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -16,6 +16,8 @@ SPDX-License-Identifier: CC-BY-4.0
### Features
+- Apply `investment_period_weightings["objective"]` to capex, installed capex, and opex statistics ... | 3 | 3 | 1 | [{"id": "G0", "claim": "The new release-notes entry is a bug fix rather than a feature, so it should be listed under Bug Fixes instead of Features.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `is_multi_indexed` flag is unclear about when it... | null |
PyPSA__PyPSA__1653 | PyPSA/PyPSA | 1,653 | defect | 50bcbb8c1ba6319167a8bf0059cf18114b2f2eac | b1283d95429e9fcc94b2760f2fd7dde20181d8ed | fix: allow groupby="name" in NetworkCollection statistics | Closes #1624 | diff --git a/docs/release-notes.md b/docs/release-notes.md
index 4004ba300..3fb1456ae 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -45,6 +45,8 @@ SPDX-License-Identifier: CC-BY-4.0
- Fix `NetworkCollection` statistic functions failing or returning wrong results when networks have different snaps... | 1 | 1 | 0 | [{"id": "G0", "claim": "The groupby-key construction in _aggregate_components_groupby is confusing because names kept via grouping_df columns also exist in the index, which keep_levels should control; FabianHofmann prefers the alternative form that filters keep_levels against vals.index.names and appends the grouping_d... | null |
PyPSA__PyPSA__1685 | PyPSA/PyPSA | 1,685 | defect | 3f3813e999d2d5b4400e8c66e1b4bdf2790e5249 | a57d2ca323c2b761c41b2d0c33d5f50f65e9a8f4 | include -1 * sign for loads in define_nodal_balance_constraint | Closes #1684 .
## Changes proposed in this Pull Request
Bugfix: Consider the sign of loads in optimization, not only lpf.
## Checklist
- [ ] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in `docs`.
- [x] Unit tests for new features were ... | diff --git a/docs/release-notes.md b/docs/release-notes.md
index fc6482c2a..04ff81a45 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -28,6 +28,8 @@ SPDX-License-Identifier: CC-BY-4.0
- Fix [`n.add(..., overwrite=True)`][pypsa.Network.add] leaving stale dynamic attributes from the previously existi... | 2 | 2 | 1 | [{"id": "G0", "claim": "The loads expression should be rewritten to compute the active mask once and apply it to the product, i.e. (-loads.da.p_set * loads.da.sign).where(active_mask), instead of the double-masked -1 * p_set.where(...) * sign.where(...) form.", "category": "maintainability", "verdict": "supported", "pr... | null |
PyPSA__PyPSA__521 | PyPSA/PyPSA | 521 | defect | 04d5e0d16c5315060489e113e7929f610a36f502 | 16a828ff8864128248932210a9edd5919def2277 | Add max_relative_growth as a carrier based global constraint | Extends the linopy implementation of the carrier's growth limit by an
additional linear term, so that one can allow an expansion growth by
1.5 times what was installed in the investment period before.
This is added directly to the max growth limit constraint so that it adds additional allowed capacity.
One diff... | diff --git a/pypsa/component_attrs/carriers.csv b/pypsa/component_attrs/carriers.csv
index 0d7f19e33..c35b10c0d 100644
--- a/pypsa/component_attrs/carriers.csv
+++ b/pypsa/component_attrs/carriers.csv
@@ -4,3 +4,4 @@ co2_emissions,float,tonnes/MWh,0,Emissions in CO2-tonnes-equivalent per MWh of p
color,string,n/a,n/a,... | 2 | 1 | 0 | [{"id": "G0", "claim": "Something is going on with the groupby functionality in CI (a failure already seen in #519), which the reviewer thinks has to do with the new xarray version.", "category": "correctness", "verdict": "opposed", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "The pull request sho... | null |
PyPSA__PyPSA__635 | PyPSA/PyPSA | 635 | defect | 51703d5d153e5d6014959e9138c2f68fb2831844 | 0d23f5fdb0c575b0e5947b5cf28220810987ccdd | Assign duals | Closes # (if applicable).
This PR should assign all dual variables to the pypsa network in case the name of the constraint follows the syntax ("`component-something`").
- if attribute "something" is not part of the `n.pnl(c)` it is added
- if component is "`GlobalConstraint`" and the attribute is not time-dependent,... | diff --git a/pypsa/optimization/common.py b/pypsa/optimization/common.py
index a4a9fc4ee..0466b9696 100644
--- a/pypsa/optimization/common.py
+++ b/pypsa/optimization/common.py
@@ -32,9 +32,7 @@ def set_from_frame(n, c, attr, df):
Update values in time-dependent attribute from new dataframe.
"""
pnl = n.... | 3 | 3 | 3 | [{"id": "G0", "claim": "The `keep_shadowprices` argument should be removed because it is misleading (the shadow prices are all available in `n.model` and the default behaviour cannot be altered anyway).", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The ... | null |
PyPSA__PyPSA__672 | PyPSA/PyPSA | 672 | defect | 8a5bd006b06860dba9720715b64c5d4e1a597e9c | 53da469db51a8d47ae6f4822b02e79d1ea1d4b17 | add frontend MGA function | Closes #487.
## Changes proposed in this Pull Request
New frontend function to run MGA on previously solved networks:
```py
weights = dict(Generator=dict(p_nom={"coal": 1}))
n.optimize.optimize_mga(slack=0.05, weights=weights)
```
## Test
```py
import pytest
import pypsa
from numpy.testing import... | diff --git a/doc/release_notes.rst b/doc/release_notes.rst
index 4079ec8b0..c429568e6 100644
--- a/doc/release_notes.rst
+++ b/doc/release_notes.rst
@@ -15,6 +15,10 @@ Upcoming Release
`stand_by_cost` was added to generators and links. The stand-by
cost is added to the objective function when calling
``n.optim... | 2 | 1 | 0 | [{"id": "G0", "claim": "The new method `capex_fixed` should be named `installed_capex` (\"installed\" instead of \"fixed\"), analogous to `installed_capacity`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The reviewer asks whether the budget c... | null |
PyPSA__PyPSA__755 | PyPSA/PyPSA | 755 | defect | 47f781c30cbe94e3ce39cd94672070c4d643df5e | 4ccfeb5be8e855bf2d1c041d58798bde18a2bfa2 | Add "Shape" component | closes #708
closes #759
closes #766
## Checklist
- [x] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in `doc`.
- [x] Unit tests for new features were added (if applicable).
- [x] Newly introduced dependencies are added to `environm... | diff --git a/doc/release_notes.rst b/doc/release_notes.rst
index 6a5527e06..0bf21380f 100644
--- a/doc/release_notes.rst
+++ b/doc/release_notes.rst
@@ -19,6 +19,8 @@ Upcoming Release
* The statistics functions now support single components in the ``comps`` argument.
+* The ``Network`` class has a new component ``... | 14 | 7 | 4 | [{"id": "G0", "claim": "Questions whether all six shape attributes really need to be marked 'Input (required)' or whether some of them are optional.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Asks whether there is any downside to making geopan... | null |
PyPSA__PyPSA__793 | PyPSA/PyPSA | 793 | defect | 8196a121655c07e7764533e0918d945294b7a0b1 | c5b10c7ee8a4fcd322b0ea5b57d80869c35f5274 | Fix stand_by_cost implementation in optimization | Closes #792.
## Changes proposed in this Pull Request
Uses the same approach applied when defining the other parts of the objective function (e.g. marginal cost) for stand_by_cost
## Checklist
- [x] Unit tests for new features were added (if applicable).
- [x] A note for the release notes `doc/release_notes.... | diff --git a/doc/release_notes.rst b/doc/release_notes.rst
index 96b3aa0c4..bebbf0fd1 100644
--- a/doc/release_notes.rst
+++ b/doc/release_notes.rst
@@ -28,6 +28,8 @@ Upcoming Release
* Enhancement: Allow optimising dispatch of only a subset of investment periods.
+* Bugfix: Fix stand-by-costs optimization, which ... | 1 | 1 | 0 | [{"id": "G0", "claim": "Revise the pyomo exclusion so it is implemented with an in-function check (`if api == \"pyomo\": return`) rather than by introducing a new SUPPORTED_APIS_STAND_BY_COST variable for the parametrize decorator.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}... | null |
PyThaiNLP__nlpo3__101 | PyThaiNLP/nlpo3 | 101 | defect | e4325c6c394d4de440f26fd74cc72280047956cd | 60c55ab8c70183dd4e58ba1603647afc1c8b55ab | fix(newmm): resolve exponential BFS path explosion in ambiguous tokenization | The newmm BFS graph traversal had O(2^n) worst-case behavior on highly ambiguous input — the same bug fixed in Python via [PyThaiNLP/pythainlp#1319](https://github.com/PyThaiNLP/pythainlp/pull/1319). Without a visited set, every neighbor is unconditionally re-enqueued, causing the queue to grow exponentially when the d... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 634f1734..d5e28a4e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,25 @@ conventions. Version numbers follow [Semantic Versioning](https://semver.org/).
## [Unreleased]
+### Fixed
+
+- `src/tokenizer/newmm.rs`: Resolved exponential BFS path explosion in
+ `... | 4 | 4 | 0 | [{"id": "G0", "claim": "The doc comment references `_bfs_paths_graph`, but the function in this module is named `bfs_paths_graph` (no leading underscore); updating the reference will avoid confusion when searching the codebase.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduce... | null |
PyThaiNLP__nlpo3__24 | PyThaiNLP/nlpo3 | 24 | defect | 7b0c0239c71d3962ed91c6a414657c454a41e2ec | f80c659af6934fb825c15af07157c2b8cd014a1a | Hotfix/thai number tokenization | I found a problem with Thai Number .
I compare correctness of o3_newmm with [py_newmm as of this commit](https://github.com/PyThaiNLP/pythainlp/commit/5d9587da839a40e3d91375b8d90f6f3dc8c2466b) by running through pynotebook and found that o3_newmm incorrectly tokenizes Thai numbers when followed with period symbol
... | diff --git a/Cargo.toml b/Cargo.toml
index ac998e74..5f28b924 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,6 +13,8 @@ repository = "https://github.com/PyThaiNLP/nlpo3/"
readme = "README.md"
exclude = [".gitignore", ".github/*", "build_tools/*", "tests/*"]
+
+
[lib]
path = "src/lib.rs"
# "cdylib" is necessary ... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new real-data test should also be given Thai-number test cases.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
PyThaiNLP__nlpo3__98 | PyThaiNLP/nlpo3 | 98 | defect | 3d91ab8abbb55b9c1b139017343ec76f8b6ab64b | 0772cb56ecdb89c171214445f4ee8a62c57ffef6 | Major 2.0.0: Rust 2024 edition, updated deps, code quality, and docs | Brings all packages to 2.0.0 with `edition = "2024"` and `rust-version = "1.88.0"`, applying 2024 edition features throughout, updating all dependencies off deprecated/beta versions, and aligning all documentation.
## Rust 2024 edition features
- **`let` chains**: `while match { true/false }` → `while let … && condit... | diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index f3e44913..6ec41119 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -14,7 +14,7 @@
- [ ] For significant changes, update the CHANGELOG.md file
to document the changes.
- [ ] Follow "Keep ... | 4 | 3 | 0 | [{"id": "G0", "claim": "Restoring from_utf8_unchecked in the prefix_lengths hot loop risks performance regressions; validate once at FST build time (or document/benchmark the expected overhead) instead of re-validating every key.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduce... | null |
Pylons__pyramid__1583 | Pylons/pyramid | 1,583 | defect | 6ea099ded65ff671c26753b9b30e4d19b3c47b81 | 780889f18d17b86fc12625166a245c7f9947cbe6 | remove the token from the ICacheBuster api | This exposes the QueryStringCacheBuster and PathSegmentCacheBuster
public APIs alongside the md5-variants. These should be more cleanly
subclassed by people wishing to extend their implementations.
Fixes #1582.
| diff --git a/docs/api/static.rst b/docs/api/static.rst
index 543e526ad9..b6b2791395 100644
--- a/docs/api/static.rst
+++ b/docs/api/static.rst
@@ -9,6 +9,12 @@
:members:
:inherited-members:
+ .. autoclass:: PathSegmentCacheBuster
+ :members:
+
+ .. autoclass:: QueryStringCacheBuster
+ :members:
... | 1 | 1 | 0 | [{"id": "G0", "claim": "The explicit parent __init__ calls in PathSegmentMd5CacheBuster should be replaced with a super(...) call, which would be less fragile.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
Pylons__pyramid__1823 | Pylons/pyramid | 1,823 | defect | a613f28670b8d5a63ad182507e3fb7634bb86560 | 608f955e20723723f33750211bb12debf613819b | Quick Tutorial Database: Logging configs for db script output + fix scoped session warning | --development.ini: adds additional logging configs necessary for output from db setup script
--databases.rst: updates script output user would see displayed from db setup script
--tests.py: remove self.session declaration (in setUp) and removal (in tearDown) in WikiFunctionalTests because the `app = get_app('developmen... | diff --git a/docs/quick_tutorial/databases.rst b/docs/quick_tutorial/databases.rst
index 5807741636..19dfd066df 100644
--- a/docs/quick_tutorial/databases.rst
+++ b/docs/quick_tutorial/databases.rst
@@ -90,17 +90,29 @@ Steps
.. code-block:: bash
$ $VENV/bin/initialize_tutorial_db development.ini
- 2013-09... | 2 | 2 | 0 | [{"id": "G0", "claim": "The `testing` module calls (`self.config = testing.setUp()` and `testing.tearDown()`) are no longer used in the functional test and should be removed from tests.py.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The PR ... | null |
Pylons__pyramid__1837 | Pylons/pyramid | 1,837 | defect | 2c3d653e0982eca137e58fe9ba0138469d862bf7 | 7dc81f082adba97effc3ce3726e453ec71e841b7 | handle conflicting project names gracefully, fixes: #1357 | - Check for importable packages/modules with the same
name as the package to be created
- Added --force-conflicting-name option to enforce the
use of a conflicting package
- Added appropriate tests
| diff --git a/pyramid/scaffolds/__init__.py b/pyramid/scaffolds/__init__.py
index c993ce5f98..4e811a42b6 100644
--- a/pyramid/scaffolds/__init__.py
+++ b/pyramid/scaffolds/__init__.py
@@ -18,10 +18,6 @@ def pre(self, command, output_dir, vars):
misnamings (such as naming a package "site" or naming a package
... | 4 | 3 | 0 | [{"id": "G0", "claim": "Use the existing pyramid.compat input_ helper instead of the ad-hoc sys.version_info check that aliases input/raw_input.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Print sorted(diff) instead of list(diff) when listing unavaila... | null |
Pylons__pyramid__2171 | Pylons/pyramid | 2,171 | defect | fd404c0dc268fe71d39875e74ea4ff5ee68489ef | 4d19b84cb8134a0e7f030064e5d944defaa6970a | config.add cache buster | Remove `cachebust=` from `config.add_static_view` and provide a `config.add_cache_buster` API. The cache busters are tied directly to raw asset paths instead of high-level specifications. For example:
``` python
config.add_static_view('static', 'myapp:static')
config.override_asset('myapp:static/', 'theme:static/')
d... | diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst
index 0f819570cb..0e3f6af116 100644
--- a/docs/narr/assets.rst
+++ b/docs/narr/assets.rst
@@ -366,8 +366,7 @@ resource and requests the asset, regardless of any caching policy set for the
resource's old URL.
:app:`Pyramid` can be configured to produce cache b... | 8 | 6 | 2 | [{"id": "G0", "claim": "The cache buster is invoked with only the real (low-level) asset spec, so add_cache_buster should also pass in the high-level spec so people can select which one they want to base their cache busting off of.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}... | null |
Pylons__pyramid__2399 | Pylons/pyramid | 2,399 | defect | 28c6df982212c1c36f8b071132ccb98c7cc62785 | 32c0c3d50fe193ed7e1ed102c4c898835ccc3b32 | Pass vars to logging.config.fileConfig | This allows one to set up a logging configuration that is parameterized based on variables specified on the command-line.
e.g.: the application .ini file could have:
``` ini
[logger_root]
level = %(LOGGING_LOGGER_ROOT_LEVEL)s
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = %(L... | diff --git a/pyramid/paster.py b/pyramid/paster.py
index 9675438496..f74065fbda 100644
--- a/pyramid/paster.py
+++ b/pyramid/paster.py
@@ -53,7 +53,7 @@ def get_appsettings(config_uri, name=None, options=None, appconfig=appconfig):
global_conf=options)
def setup_logging(config_uri, fileConfig=fileConfig,
- ... | 7 | 5 | 3 | [{"id": "G0", "claim": "The env-var feature only works for pserve and not for other PasteDeploy consumers like gunicorn or uwsgi, which limits its usefulness.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "unclear"}, {"id": "G1", "claim": "Injecting environment variables without namespacing... | null |
Pylons__pyramid__2435 | Pylons/pyramid | 2,435 | defect | 5238bb64abfebc085ca95df517535f61e27b7fc2 | a3db3cab713fecc0c83c742cfe3f0736b1d94a92 | separate viewderiver module | This is some work to move the view derivers into `pyramid.viewderivers`. This moves the implementations out into the `pyramid.viewderivers` package as they are not technically configuration. They are implementations used by the configurator as defaults. Similarly we should in a separate PR move the predicates out of th... | diff --git a/docs/api/viewderivers.rst b/docs/api/viewderivers.rst
new file mode 100644
index 0000000000..a4ec107b63
--- /dev/null
+++ b/docs/api/viewderivers.rst
@@ -0,0 +1,16 @@
+.. _viewderivers_module:
+
+:mod:`pyramid.viewderivers`
+---------------------------
+
+.. automodule:: pyramid.viewderivers
+
+ .. attri... | 3 | 2 | 1 | [{"id": "G0", "claim": "It still feels wrong that mapped_view - something specific to the view machinery that has to exist - is applied as a view deriver during the view derivation stage only because it happens to need to wrap the view.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "pre_exi... | null |
Pylons__pyramid__2501 | Pylons/pyramid | 2,501 | defect | 1799be9dd8666d10d6b4a04a9b75fc57f8626c6f | 815f001c2251a9c336802b222fb2331e705a05c0 | In addition to CSRF token, verify the origin too | Add an additional layer of protection against CSRF by verifying the actual origin of the request in addition to the CSRF token. We only do this check on sites hosted behind HTTPS because only HTTPS sites have evidence to show that the Referrer header is not being spuriously removed by random middleware boxes.
Note, to... | diff --git a/pyramid/exceptions.py b/pyramid/exceptions.py
index c1481ce9cf..a8a10f9278 100644
--- a/pyramid/exceptions.py
+++ b/pyramid/exceptions.py
@@ -9,6 +9,21 @@
CR = '\n'
+
+class BadCSRFOrigin(HTTPBadRequest):
+ """
+ This exception indicates the request has failed cross-site request forgery
+ ori... | 4 | 4 | 2 | [{"id": "G0", "claim": "The versionadded directive in the check_csrf_origin docstring needs one more space after the initial two periods, i.e. '.. versionadded::' instead of '..versionadded::'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The ne... | null |
Pylons__pyramid__2660 | Pylons/pyramid | 2,660 | defect | bcba92d1b23745d736bdcbc9b799929de382db7b | 35209e4ac53520e1159bd8a6b47128f38a75db18 | Exception-only option when registering views | I don't think that this work is fully done yet, but I'm creating a PR to start collaboration and discussion.
I think that code could use some re-factoring. I think that there's too much shared between the exception view registration and the not-found view and forbidden view registration. Probably it could be changed t... | diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index 5cb3f50991..e341922d39 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -213,6 +213,7 @@ def add_view(
match_param=None,
check_csrf=None,
require_csrf=None,
+ exception_only=False,
**view... | 10 | 7 | 4 | [{"id": "G0", "claim": "The add_exception_view docstring reads 'raises an the given exception'; remove the stray 'an' and rewrap the sentence.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The exception_view_config docstring should use double quo... | null |
Pylons__pyramid__2760 | Pylons/pyramid | 2,760 | defect | 44e0fca16dfa6e9e896a1dc254c85b79d2c8ae88 | b832c65a13f0ab2b1e46e6582b083da44e908065 | allow prepare/bootstrap to be used as a context manager | closes #1822
| diff --git a/pyramid/paster.py b/pyramid/paster.py
index 3916be8f09..1b7afb5dcb 100644
--- a/pyramid/paster.py
+++ b/pyramid/paster.py
@@ -129,8 +129,22 @@ def bootstrap(config_uri, request=None, options=None):
{'http_port': 8080} and then use %(http_port)s in the
config file.
+ This function may be used... | 1 | 1 | 0 | [{"id": "G0", "claim": "Add a comment explaining that the closer is called manually to clean up before being replaced with a testable closer, and instead have the new closer call the original closer.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
Pylons__pyramid__2811 | Pylons/pyramid | 2,811 | defect | 568ce319ef097f1e909398f9a5ec890e4de91601 | ece7e52ec48c8a0b41ba05d793f3fd803a654e9a | Mark more characters as safe in escaping generated path components | According to [RFC3986](https://tools.ietf.org/html/rfc3986) [1], the following characters are allowed to occur bare (that is, don't need percent encoding) in addition to alphanumeric characters:
`-` / `.` / `_` / `~` / `!` / `$` / `&` / `'` / `(` / `)` / `*` / `+` / `,` / `;` / `=` / `:` / `@`
But `route_url()` e... | diff --git a/pyramid/tests/test_urldispatch.py b/pyramid/tests/test_urldispatch.py
index 2d20b24c37..06f4ad793f 100644
--- a/pyramid/tests/test_urldispatch.py
+++ b/pyramid/tests/test_urldispatch.py
@@ -485,11 +485,15 @@ def test_generator_functional_notdynamic(self):
def test_generator_functional_newstyle(self):
... | 4 | 4 | 2 | [{"id": "G0", "claim": "The PR is not complete enough to merge: request.route_url/request.resource_url (pyramid.url._join_elements) and resource paths (pyramid.traversal._join_path_tuple) must also support the extra characters, and one shared pyramid.url.PATH_SAFE must be used in all pyramid locations.", "category": "c... | null |
Pylons__pyramid__2849 | Pylons/pyramid | 2,849 | defect | 0705eeaa820b32a4c3f2a05df21e99077586cf5e | b01a0233aa03b4b5a9ddd640a7a114f68d1c763d | Changed wiki tutorial to showcase passwrd hashing with bcrypt. | Relates to #2204
Since this tutorial does not store user data in a database I have just showcased how hashing works and explained more strongly that in real applications you are probably gong to store users in a database.
Would appreciate if someone would have read through and suggest corrections if something nee... | diff --git a/docs/tutorials/wiki/authorization.rst b/docs/tutorials/wiki/authorization.rst
index 44097b35bf..699e34355b 100644
--- a/docs/tutorials/wiki/authorization.rst
+++ b/docs/tutorials/wiki/authorization.rst
@@ -18,6 +18,7 @@ require permission, instead of a default "403 Forbidden" page.
We will implement the... | 5 | 4 | 2 | [{"id": "G0", "claim": "The wording 'loging-in' in the authorization.rst helper-methods paragraph should be changed to 'authenticating'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "hash_password returns bytes (and check_password expects an expe... | null |
Pylons__pyramid__2859 | Pylons/pyramid | 2,859 | defect | 8bc0f9a68c4f19533ccdf4486656f2a106a81827 | ba8362fb4eef896e8c62062030d57584c375a1b1 | Fix pluralization in default domain for non-germanic languages | This is a reimplementation of PR #2102 which is less invasive and tracks the bug to its original location.
When loading a new `.mo` file, Pyramid checks if the domain already exists, and if so it merges the new catalog into the old one. It does not update the `plural` function when this happens, as it's assumed that... | diff --git a/CHANGES.txt b/CHANGES.txt
index 65a1f15cd0..2dc80c0051 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -149,6 +149,11 @@ Bug Fixes
from previous orders have executed.
See https://github.com/Pylons/pyramid/pull/2757
+- Fix bug in i18n where the default domain would always use the Germanic plural
+ st... | 2 | 1 | 0 | [{"id": "G0", "claim": "mmerickel questions whether the tested behavior is correct, asking whether the system should choose the plural rule based on the selected language rather than keeping the first-loaded rule.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", ... | null |
Pylons__pyramid__3152 | Pylons/pyramid | 3,152 | defect | e83f2aa50917cf1ed07f8bcfb146a6c1b5759e5b | fcbc87b660eee3c233e363cbfc0c4458b37b1089 | Add a functional test for the static file | Static files were introduced in the quick tutorial step "[static assets](https://docs.pylonsproject.org/projects/pyramid/en/latest/quick_tutorial/static_assets.html)". As the tutorials emphasise to write tests, this PR adds a test for the static file `app.css` that was introduced with this tutorial step. This PR also u... | diff --git a/docs/quick_tutorial/static_assets.rst b/docs/quick_tutorial/static_assets.rst
index b8482492df..e768b70c3a 100644
--- a/docs/quick_tutorial/static_assets.rst
+++ b/docs/quick_tutorial/static_assets.rst
@@ -43,13 +43,18 @@ Steps
.. literalinclude:: static_assets/tutorial/static/app.css
:language: c... | 4 | 2 | 0 | [{"id": "G0", "claim": "The tutorial page should include only the added test method via :pyobject: TutorialFunctionalTests.test_css with :lineno-match: (and :language: python) instead of the entire tests.py with :linenos: or :lines: with :linenos:.", "category": "documentation", "verdict": "supported", "priority": "P2"... | null |
Pylons__pyramid__3318 | Pylons/pyramid | 3,318 | defect | 57a896f103c7378fb285f6594228578a5324d672 | a7a6b06a98019056477422e21c622c5039c1829f | enable the setup function in pshell to wrap the command lifecycle | The next step here is to decide whether to:
1. Integrate support directly into pshell for detecting `env['request'].tm` and doing "the right thing".
2. Add documentation in the command line chapter about how to handle transactions in pshell.
3. Add a setup function to each cookiecutter which does the right thi... | diff --git a/CHANGES.rst b/CHANGES.rst
index e09c3723c9..47738e29b8 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -41,6 +41,14 @@ Features
exception/response object for a HTTP 308 redirect.
See https://github.com/Pylons/pyramid/pull/3302
+- Within ``pshell``, allow the user-defined ``setup`` function to be a
+ ... | 3 | 2 | 0 | [{"id": "G0", "claim": "The setup function's usefulness in the starter cookiecutter, which lacks persistent storage, is unclear, and the author is asked whether a use case exists for it there.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "It is unclear ... | null |
Pylons__pyramid__3325 | Pylons/pyramid | 3,325 | defect | f997988c09cb6e5a7c27e41872b5e724a749e96e | eadf7a21fdab3a84c0e5dedd5f573d4cb8d323d3 | catch other pickle errors when loading content | Hypothetical: you have more pyramid projects than dummy secrets and the browser starts sending back signed-pickled session cookies from project A to the server for project B. In this case it passes all signature checks but fails to unpickle with a non-`ValueError` exception. | diff --git a/CHANGES.rst b/CHANGES.rst
index 6ccd69a472..9106c270f6 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -62,6 +62,12 @@ Bug Fixes
code. The old ``MIMEAccept`` has been deprecated. The new methods follow the
RFC's more closely. See https://github.com/Pylons/pyramid/pull/3251
+- Catch extra errors like ... | 1 | 1 | 1 | [{"id": "G0", "claim": "There are no direct unit tests for PickleSerializer, whose loads() behaviour this pull request changed.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.