Skip to content

Commit

Permalink
chore(deps): update pyo3 requirement from 0.21.1 to 0.22.2 in the pyo…
Browse files Browse the repository at this point in the history
…3 group (#73)

Updates the requirements on [pyo3](https://github.com/pyo3/pyo3) to
permit the latest version.
Updates `pyo3` to 0.21.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pyo3/pyo3/releases">pyo3's
releases</a>.</em></p>
<blockquote>
<h2>PyO3 0.21.2</h2>
<p>This release contains some fixes to compile-time edge cases for the
PyO3 0.21 series:</p>
<ul>
<li>A missing deprecation warning for the GIL Ref constructor
<code>PySet::empty</code> has now been added.</li>
<li><code>#[pymodule]</code> functions will no longer trigger
<code>missing_docs</code> lints on their generated code.</li>
<li>Incorrect implementations of <code>__traverse__</code> in
<code>#[pymethods]</code> will now emit a better error.</li>
<li>Extension modules on AIX will now link to
<code>libpython</code>.</li>
</ul>
<p>This release also fixes some compile errors for the
<code>experimental-async</code> and
<code>experimental-declarative-modules</code> features, and corrects
some documentation typos.</p>
<p>Thank you to the following users for the improvements:</p>
<p><a
href="https://github.com/adamreichold"><code>@​adamreichold</code></a>
<a href="https://github.com/blmarket"><code>@​blmarket</code></a>
<a href="https://github.com/davidhewitt"><code>@​davidhewitt</code></a>
<a href="https://github.com/Icxolu"><code>@​Icxolu</code></a>
<a href="https://github.com/lfn3"><code>@​lfn3</code></a>
<a href="https://github.com/messense"><code>@​messense</code></a>
<a href="https://github.com/wyfo"><code>@​wyfo</code></a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md">pyo3's
changelog</a>.</em></p>
<blockquote>
<h2>[0.21.2] - 2024-04-16</h2>
<h3>Changed</h3>
<ul>
<li>Deprecate the <code>PySet::empty()</code> gil-ref constructor. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4082">#4082</a></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fix compile error for <code>async fn</code> in
<code>#[pymethods]</code> with a <code>&amp;self</code> receiver and
more than one additional argument. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4035">#4035</a></li>
<li>Improve error message for wrong receiver type in
<code>__traverse__</code>. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4045">#4045</a></li>
<li>Fix compile error when exporting a <code>#[pyclass]</code> living in
a different Rust module using the
<code>experimental-declarative-modules</code> feature. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4054">#4054</a></li>
<li>Fix <code>missing_docs</code> lint triggering on documented
<code>#[pymodule]</code> functions. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4067">#4067</a></li>
<li>Fix undefined symbol errors for extension modules on AIX (by linking
<code>libpython</code>). <a
href="https://redirect.github.com/PyO3/pyo3/pull/4073">#4073</a></li>
</ul>
<h2>[0.21.1] - 2024-04-01</h2>
<h3>Added</h3>
<ul>
<li>Implement <code>Send</code> and <code>Sync</code> for
<code>PyBackedStr</code> and <code>PyBackedBytes</code>. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4007">#4007</a></li>
<li>Implement <code>Clone</code>, <code>Debug</code>,
<code>PartialEq</code>, <code>Eq</code>, <code>PartialOrd</code>,
<code>Ord</code> and <code>Hash</code> implementation for
<code>PyBackedBytes</code> and <code>PyBackedStr</code>, and
<code>Display</code> for <code>PyBackedStr</code>. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4020">#4020</a></li>
<li>Add <code>import_exception_bound!</code> macro to import exception
types without generating GIL Ref functionality for them. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4027">#4027</a></li>
</ul>
<h3>Changed</h3>
<ul>
<li>Emit deprecation warning for uses of GIL Refs as
<code>#[setter]</code> function arguments. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3998">#3998</a></li>
<li>Add <code>#[inline]</code> hints on many <code>Bound</code> and
<code>Borrowed</code> methods. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4024">#4024</a></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Handle <code>#[pyo3(from_py_with = &quot;&quot;)]</code> in
<code>#[setter]</code> methods <a
href="https://redirect.github.com/PyO3/pyo3/pull/3995">#3995</a></li>
<li>Allow extraction of <code>&amp;Bound</code> in
<code>#[setter]</code> methods. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3998">#3998</a></li>
<li>Fix some uncovered code blocks emitted by <code>#[pymodule]</code>,
<code>#[pyfunction]</code> and <code>#[pyclass]</code> macros. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4009">#4009</a></li>
<li>Fix typo in the panic message when a class referenced in
<code>pyo3::import_exception!</code> does not exist. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4012">#4012</a></li>
<li>Fix compile error when using an async <code>#[pymethod]</code> with
a receiver and additional arguments. <a
href="https://redirect.github.com/PyO3/pyo3/pull/4015">#4015</a></li>
</ul>
<h2>[0.21.0] - 2024-03-25</h2>
<h3>Added</h3>
<ul>
<li>Add support for GraalPy (24.0 and up). <a
href="https://redirect.github.com/PyO3/pyo3/pull/3247">#3247</a></li>
<li>Add <code>PyMemoryView</code> type. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3514">#3514</a></li>
<li>Allow <code>async fn</code> in for <code>#[pyfunction]</code> and
<code>#[pymethods]</code>, with the <code>experimental-async</code>
feature. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3540">#3540</a> <a
href="https://redirect.github.com/PyO3/pyo3/pull/3588">#3588</a> <a
href="https://redirect.github.com/PyO3/pyo3/pull/3599">#3599</a> <a
href="https://redirect.github.com/PyO3/pyo3/pull/3931">#3931</a></li>
<li>Implement <code>PyTypeInfo</code> for <code>PyEllipsis</code>,
<code>PyNone</code> and <code>PyNotImplemented</code>. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3577">#3577</a></li>
<li>Support <code>#[pyclass]</code> on enums that have non-unit
variants. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3582">#3582</a></li>
<li>Support <code>chrono</code> feature with <code>abi3</code> feature.
<a href="https://redirect.github.com/PyO3/pyo3/pull/3664">#3664</a></li>
<li><code>FromPyObject</code>, <code>IntoPy&lt;PyObject&gt;</code> and
<code>ToPyObject</code> are implemented on
<code>std::duration::Duration</code> <a
href="https://redirect.github.com/PyO3/pyo3/pull/3670">#3670</a></li>
<li>Add <code>PyString::to_cow</code>. Add
<code>Py&lt;PyString&gt;::to_str</code>,
<code>Py&lt;PyString&gt;::to_cow</code>, and
<code>Py&lt;PyString&gt;::to_string_lossy</code>, as ways to access
Python string data safely beyond the GIL lifetime. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3677">#3677</a></li>
<li>Add <code>Bound&lt;T&gt;</code> and <code>Borrowed&lt;T&gt;</code>
smart pointers as a new API for accessing Python objects. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3686">#3686</a></li>
<li>Add <code>PyNativeType::as_borrowed</code> to convert &quot;GIL
refs&quot; to the new <code>Bound</code> smart pointer. <a
href="https://redirect.github.com/PyO3/pyo3/pull/3692">#3692</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/PyO3/pyo3/commit/a646a820fd3fc6211c52291de8b23a61f7ae7c22"><code>a646a82</code></a>
release: 0.21.2</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/bd15f92a56d443c81003268993834d03646314bc"><code>bd15f92</code></a>
Deprecate the <code>PySet::empty</code> gil-ref constructor (<a
href="https://redirect.github.com/pyo3/pyo3/issues/4082">#4082</a>)</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/4f7c7065c287962e530e9a0ab4f518451c72f579"><code>4f7c706</code></a>
Suppress non_local_definitions lint as we often want the non-local
effects in...</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/3f6faf00ffc9999e5f02301e7eb516825476335d"><code>3f6faf0</code></a>
Extend guide on interaction between method receivers and lifetime
elision. (#...</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/4e13c0eae89dfb921fe8893127ff39e7a93ba28f"><code>4e13c0e</code></a>
Link libpython for AIX target (<a
href="https://redirect.github.com/pyo3/pyo3/issues/4073">#4073</a>)</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/e5013775871d47e330beb29b06dd5467488041b0"><code>e501377</code></a>
fix declarative-modules compile error (<a
href="https://redirect.github.com/pyo3/pyo3/issues/4054">#4054</a>)</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/fd18955da8f4b768b9b626a6e0ccc48bde7b85ab"><code>fd18955</code></a>
add <code>#[doc(hidden)]</code> to the Rust module created by
<code>#[pymodule]</code> (<a
href="https://redirect.github.com/pyo3/pyo3/issues/4067">#4067</a>)</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/e174a04bb3288e6880007651262c589122309dc3"><code>e174a04</code></a>
Minor: Fix a typo in Contributing.md (<a
href="https://redirect.github.com/pyo3/pyo3/issues/4066">#4066</a>)</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/a8abe508ba0a0d1728a73330ef70cc8445b0dac7"><code>a8abe50</code></a>
build(deps): bump peaceiris/actions-gh-pages from 3 to 4 (<a
href="https://redirect.github.com/pyo3/pyo3/issues/4062">#4062</a>)</li>
<li><a
href="https://github.com/PyO3/pyo3/commit/68d19738e76aba0f0dd8b5fc10d416eb21f5e26c"><code>68d1973</code></a>
Fix typo (<a
href="https://redirect.github.com/pyo3/pyo3/issues/4052">#4052</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pyo3/pyo3/compare/v0.21.1...v0.21.2">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Agustin Borgna <[email protected]>
  • Loading branch information
dependabot[bot] and aborgna-q authored Aug 12, 2024
1 parent 001ecf6 commit e88f93e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ name = "integration"
path = "tests/lib.rs"

[workspace.dependencies]
pyo3 = "0.21.1"
pythonize = "0.21.1"
pyo3 = "0.22.2"
pythonize = "0.22.0"
rstest = "0.22.0"
serde = "1.0"
serde_json = "1.0"
Expand Down
16 changes: 1 addition & 15 deletions src/optype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
#[cfg(feature = "pyo3")]
use pyo3::prelude::*;
#[cfg(feature = "pyo3")]
use pyo3::{exceptions::PyNotImplementedError, pyclass::CompareOp};
use serde::{Deserialize, Serialize};
use strum::EnumString;

/// Operation types in a quantum circuit.
#[cfg_attr(feature = "pyo3", pyclass(name = "RsOpType"))]
#[cfg_attr(feature = "pyo3", pyclass(name = "RsOpType", eq, eq_int))]
#[derive(Deserialize, Serialize, Clone, Debug, Default, PartialEq, Eq, Hash, EnumString)]
#[non_exhaustive]
pub enum OpType {
Expand Down Expand Up @@ -550,15 +548,3 @@ pub enum OpType {
/// [`DiagonalBox`]: crate::opbox::OpBox::DiagonalBox
DiagonalBox,
}

#[cfg(feature = "pyo3")]
#[pymethods]
impl OpType {
fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult<bool> {
match op {
CompareOp::Eq => Ok(self == other),
CompareOp::Ne => Ok(self != other),
_ => Err(PyNotImplementedError::new_err("Unsupported comparison.")),
}
}
}
4 changes: 2 additions & 2 deletions src/pytket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
use crate::circuit_json::SerialCircuit;
use pyo3::prelude::*;
use pythonize::{depythonize_bound, pythonize};
use pythonize::{depythonize, pythonize};

impl SerialCircuit {
/// Create a new `SerialCircuit` from a `pytket.Circuit`.
pub fn from_tket1(circ: &Bound<PyAny>) -> PyResult<Self> {
let circ = depythonize_bound(circ.call_method0("to_dict").unwrap())?;
let circ = depythonize(&circ.call_method0("to_dict").unwrap())?;
Ok(circ)
}

Expand Down

0 comments on commit e88f93e

Please sign in to comment.