Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out ../dist
args: --profile release-py --strip --out ../dist
sccache: 'true'
manylinux: auto
working-directory: ${{ env.MODULE_DIR }}
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out ../dist -i python3.13t
args: --profile release-py --strip --out ../dist -i python3.13t
sccache: 'true'
manylinux: auto
working-directory: ${{ env.MODULE_DIR }}
Expand Down Expand Up @@ -109,15 +109,15 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out ../dist
args: --profile release-py --strip --out ../dist
sccache: 'true'
manylinux: musllinux_1_2
working-directory: ${{ env.MODULE_DIR }}
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out ../dist -i python3.13t
args: --profile release-py --strip --out ../dist -i python3.13t
sccache: 'true'
manylinux: musllinux_1_2
working-directory: ${{ env.MODULE_DIR }}
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out ../dist
args: --profile release-py --strip --out ../dist
sccache: 'true'
working-directory: ${{ env.MODULE_DIR }}
- name: Upload wheels
Expand Down Expand Up @@ -177,14 +177,14 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out ../dist --find-interpreter
args: --profile release-py --strip --out ../dist --find-interpreter
sccache: 'true'
working-directory: ${{ env.MODULE_DIR }}
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --strip --out ../dist -i python3.13t
args: --profile release-py --strip --out ../dist -i python3.13t
sccache: 'true'
working-directory: ${{ env.MODULE_DIR }}
- name: Upload wheels
Expand Down
10 changes: 5 additions & 5 deletions hugr-model/src/v0/ast/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl<'py> pyo3::FromPyObject<'py> for Term {
fn extract_bound(term: &Bound<'py, PyAny>) -> PyResult<Self> {
let name = term.get_type().name()?;

Ok(match name.to_str()? {
Ok(match name.to_cow()?.as_ref() {
"Wildcard" => Self::Wildcard,
"Var" => {
let name = term.getattr("name")?.extract()?;
Expand Down Expand Up @@ -43,7 +43,7 @@ impl<'py> pyo3::FromPyObject<'py> for Term {
_ => {
return Err(PyTypeError::new_err(format!(
"Unknown Term type: {}.",
name.to_str()?
name.to_cow()?
)));
}
})
Expand Down Expand Up @@ -94,7 +94,7 @@ impl<'py> pyo3::FromPyObject<'py> for SeqPart {
fn extract_bound(part: &Bound<'py, PyAny>) -> PyResult<Self> {
let name = part.get_type().name()?;

if name.to_str()? == "Splice" {
if name.to_cow()?.as_ref() == "Splice" {
let term = part.getattr("seq")?.extract()?;
Ok(Self::Splice(term))
} else {
Expand Down Expand Up @@ -143,7 +143,7 @@ impl<'py> pyo3::IntoPyObject<'py> for &Param {

impl<'py> pyo3::FromPyObject<'py> for Visibility {
fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
match ob.str()?.to_str()? {
match ob.str()?.to_cow()?.as_ref() {
"Public" => Ok(Visibility::Public),
"Private" => Ok(Visibility::Private),
s => Err(PyTypeError::new_err(format!(
Expand Down Expand Up @@ -245,7 +245,7 @@ impl<'py> pyo3::FromPyObject<'py> for Operation {
fn extract_bound(op: &Bound<'py, PyAny>) -> PyResult<Self> {
let name = op.get_type().name()?;

Ok(match name.to_str()? {
Ok(match name.to_cow()?.as_ref() {
"InvalidOp" => Self::Invalid,
"Dfg" => Self::Dfg,
"Cfg" => Self::Cfg,
Expand Down
Loading