Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ms2rescore-rs to 0.4.0.post1 #49308

Closed
wants to merge 11 commits into from
Closed
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
16 changes: 4 additions & 12 deletions recipes/ms2rescore-rs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@
# -x = print every executed command
set -ex

# Add workaround for SSH-based Git connections from Rust/cargo. See https://github.com/rust-lang/cargo/issues/2078 for details.
# We set CARGO_HOME because we don't pass on HOME to conda-build, thus rendering the default "${HOME}/.cargo" defunct.
export CARGO_NET_GIT_FETCH_WITH_CLI=true CARGO_HOME="${BUILD_PREFIX}/.cargo"

# Use a custom temporary directory as home on macOS.
# (not sure why this is useful, but people use it in bioconda recipes)
if [ `uname` == Darwin ]; then
export HOME=`mktemp -d`
fi

# build statically linked binary with Rust
RUST_BACKTRACE=1
Comment on lines +7 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Address unused environment variable

The RUST_BACKTRACE=1 environment variable is set but not exported, making it ineffective for the subsequent commands.

Apply this fix:

-RUST_BACKTRACE=1
+export RUST_BACKTRACE=1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# build statically linked binary with Rust
RUST_BACKTRACE=1
# build statically linked binary with Rust
export RUST_BACKTRACE=1
🧰 Tools
🪛 Shellcheck

[warning] 8-8: RUST_BACKTRACE appears unused. Verify use (or export if used externally).

(SC2034)

# Build the package using maturin - should produce *.whl files.
maturin build --interpreter $PYTHON --release
maturin build --interpreter "${PYTHON}" -b pyo3 --release --strip

# Install *.whl files using pip
$PYTHON -m pip install target/wheels/*.whl --no-deps --ignore-installed -vv
$PYTHON -m pip install target/wheels/*.whl --no-deps --no-build-isolation --no-cache-dir -vvv
9 changes: 9 additions & 0 deletions recipes/ms2rescore-rs/manylinux.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/pyproject.toml b/pyproject.toml
index 61b4d10..c007322 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -18,3 +18,4 @@ test = ["pytest"]
[tool.maturin]
features = ["pyo3/extension-module"]
bindings = "pyo3"
+compatibility = "manylinux2014"
24 changes: 14 additions & 10 deletions recipes/ms2rescore-rs/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "ms2rescore-rs" %}
{% set version = "0.2.0" %}
{% set sha256 = "561ed92f58fd7ecccc78b3e4b1bc91ffa36d0f2e58d54f7ea317898f3ea55560" %}
{% set version = "0.4.0.post1" %}
{% set sha256 = "5453415180e3f58b9498897a34da174a2641500986b953dbc0f6034dc775e099" %}

package:
name: {{ name|lower }}
Expand All @@ -9,10 +9,13 @@ package:
source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/ms2rescore_rs-{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- setup.patch
- manylinux.patch # [linux]

build:
number: 1
skip: True # [py < 37]
number: 0
skip: True # [py < 38]
run_exports:
- {{ pin_subpackage(name|lower, max_pin="x.x") }}

Expand All @@ -22,27 +25,28 @@ requirements:
- {{ compiler('rust') }}
- make
- cmake
- sysroot_linux-64 =2.17 # [linux]
host:
- zlib
- python
- maturin >=1.5,<2.0
- pip
- sysroot_linux-64 =2.17 # [linux]
run:
- python
- sysroot_linux-64 =2.17 # [linux]

test:
imports:
- ms2rescore_rs
commands:
- pip check
requires:
- pip

about:
home: https://github.com/compomics/ms2rescore-rs
summary: "Rust functionality for the MS²Rescore package"
license: Apache-2.0
summary: "Rust functionality for the MS²Rescore package."
license: "Apache-2.0"
license_family: APACHE
license_file: LICENSE
dev_url: https://github.com/compomics/ms2rescore-rs

extra:
recipe-maintainers:
Expand Down
24 changes: 24 additions & 0 deletions recipes/ms2rescore-rs/setup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/pyproject.toml b/pyproject.toml
index 460b2bc..61b4d10 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,3 +17,4 @@ test = ["pytest"]

[tool.maturin]
features = ["pyo3/extension-module"]
+bindings = "pyo3"
diff --git a/Cargo.toml b/Cargo.toml
index 994665b..aa8e064 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,6 +14,9 @@ default = ["thermo"]
thermo = ["mzdata/thermo"]

[dependencies]
-pyo3 = "0.20.0"
mzdata = "0.33.0"
timsrust = "0.3.0"
+
+[dependencies.pyo3]
+version = "0.21.2"
+features = ["auto-initialize", "anyhow"]
Loading