-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add uv as develop backend command #2015
Conversation
✅ Deploy Preview for maturin-guide ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
159be56
to
0c2c007
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting this!
Can you check where this hello-world comes from with |
So, # develop_hello_world_uv
#[test]
fn develop_hello_world_uv() {
handle_result(develop::test_develop(
"test-crates/hello-world",
None,
"develop-hello-world-uv",
false,
true,
));
} > virtualenv venv
created virtual environment CPython3.8.10.final.0-64 in 102ms
creator CPython3Posix(dest=/home/david/oss/maturin/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/david/.local/share/virtualenv)
added seed packages: pip==24.0, setuptools==69.1.1, wheel==0.42.0 > cargo test develop_hello_world_uv (no venv activated)
running 1 test
test develop_hello_world_uv ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 56 filtered out; finished in 3.48s > source venv/bin/activate
> pip install cffi
cargo test develop_hello_world_uv
Errors with:
---- develop_hello_world_uv stdout ----
🔗 Found bin bindings
📡 Using build options bindings from pyproject.toml
🎯 Found 2 Cargo targets in `Cargo.toml`: hello-world, foo
📦 Built wheel to /tmp/.tmpgHeVhr/hello_world-0.1.0-py3-none-linux_x86_64.whl
✏️ Setting installed package as editable
🛠 Installed hello-world-0.1.0
Cause: Check install fail: exit status: 1
--- Stdout:
--- Stderr:
Traceback (most recent call last):
File "test-crates/hello-world/check_installed/check_installed.py", line 16, in <module>
main()
File "test-crates/hello-world/check_installed/check_installed.py", line 5, in main
output = check_output(["hello-world"]).decode("utf-8").strip()
File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'hello-world'
thread 'develop_hello_world_uv' panicked at tests/common/mod.rs:88:13:
Check install fail: exit status: 1
--- Stdout:
--- Stderr:
Traceback (most recent call last):
File "test-crates/hello-world/check_installed/check_installed.py", line 16, in <module>
main()
File "test-crates/hello-world/check_installed/check_installed.py", line 5, in main
output = check_output(["hello-world"]).decode("utf-8").strip()
File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'hello-world'
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
develop_hello_world_uv
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 56 filtered out; finished in 7.91s
error: test failed, to rerun pass `--test run` Then, with the > pip list
Package Version
----------- -------
cffi 1.16.0
hello-world 0.1.0
pip 24.0
pycparser 2.22
setuptools 69.1.1
wheel 0.42.0 > hello-world
Hello, world!
> which hello-world
/home/david/oss/maturin/venv/bin/hello-world But if I change #[test]
fn develop_hello_world_uv() {
handle_result(develop::test_develop(
"test-crates/hello-world",
None,
"develop-hello-world-uv",
false,
false,
));
} > cargo test develop_hello_world_uv
running 1 test
test develop_hello_world_uv ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 56 filtered out; finished in 3.60s then > pip list
Package Version
---------- -------
cffi 1.16.0
pip 24.0
pycparser 2.22
setuptools 69.1.1
wheel 0.42.0
Doesnt show |
I have also updated the code to reflect the changes @konstin . Thanks for your review! :) |
This might be an existing issue, I do remember encountering similar issue in that past. Usually I just install |
Yeah, addressed your comments @messense. Yeah, and I guess just installing Finally, before I add the |
Sounds reasonable to me. |
rstest is a great addition! For the test suite performance, i'd keep only running the develop test with uv, maybe we can eventually even switch the other tests to uv. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we should probably also support uv
other installations not from pypi, but it doesn't need to block merging this.
I'm a bit confused why CI passes without |
Hi, I'm outside my PC for the day, but it's think it's because I added |
I missed that, thanks for pointing it out! |
https://build.opensuse.org/request/show/1178629 by user mia + anag+factory - Update to 1.6.0 * Add pypi name validation gh#PyO3/maturin#2007 * Add JSON schema generation gh#PyO3/maturin#2005 * Detect compiling from Linux gnu to Linux musl as cross compiling gh#PyO3/maturin#2010 * Upgrade uniffi to 0.27.0 gh#PyO3/maturin#2021 * Add instrumentation support for develop gh#PyO3/maturin#2019 * Make tracing-subscriber mandatory gh#PyO3/maturin#2022 * Import hook upgrade gh#PyO3/maturin#2024 * Add uv as develop backend command gh#PyO3/maturin#2015 * Also try uv in PATH in develop --uv gh#PyO3/maturin#2026 * docs: update pyo3 to match tutorial gh#PyO3/maturin#2029 * Add support for AIX gh#PyO3/maturin#2030 * Remove rust-cpython from project init/new template gh#PyO3/maturin#2034 * Only run uv tests
Hi,
This should close #1959. However, I would like some feedback/help before I imagine this is ready to merge. I plan on adding more tests to see that it works accross crates etc, but got into a weird test error loop, that I hope someone can help me here.
Basically about making the
develop_hello_world_uv
test pass. If I activate myvenv
then test fails withno-such file or directory hello-world
. If I dont activate it, then it passes. Sadly, if Ideactivate
then the other tests dont pass as I needcffi
to have my tests pass, what gives?Doing a
/target/debug/maturin develop --uv
on 3-4 crates fromtest-crates
worked fine, thus not sure whats with the test harness that doenst make it happy.If anyone else more experienced can help me out, it would be great. Maybe not the best place for long comment here but didnt know where else :). Thanks for your time