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

cargo test fails #12

Closed
nrempel opened this issue Apr 22, 2021 · 2 comments
Closed

cargo test fails #12

nrempel opened this issue Apr 22, 2021 · 2 comments

Comments

@nrempel
Copy link

nrempel commented Apr 22, 2021

cargo test

dyld: Symbol not found: _PyBaseObject_Type
  Referenced from: /Users/nbrempel/Projects/instant-segment/target/debug/deps/instant_segment-9a57e3ec25b687df
  Expected in: flat namespace
 in /Users/nbrempel/Projects/instant-segment/target/debug/deps/instant_segment-9a57e3ec25b687df
error: test failed, to rerun pass '-p instant-segment-py --lib'

Seems related to PyO3/pyo3#340

I am able to get tests to pass by adding #[cfg(not(test))] wherever we use #[pymethods]:

#[cfg(not(test))]
#[pymethods]
impl Search {
    /// Initialize an empty search buffer
    #[new]
    fn new() -> Self {
        Self {
            inner: instant_segment::Search::default(),
            cur: None,
        }
    }
}
@djc
Copy link
Owner

djc commented Apr 22, 2021

Yup, that's indeed the PyO3 issue. I don't think annotating all the impls with #[cfg(not(test))] is a good solution, so we'll need something else. For now, you can run make test-python to run the Python tests or cargo t -p instant-segment --all-features to run the Rust tests.

@nrempel
Copy link
Author

nrempel commented Apr 22, 2021

Perfect, thanks. I'll add this to the documentation.

@nrempel nrempel closed this as completed Apr 22, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants