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

test fail with error "ImportError: cannot import name 'rlock' from 'fastrlock'" #8

Closed
hubutui opened this issue Nov 20, 2019 · 3 comments

Comments

@hubutui
Copy link

hubutui commented Nov 20, 2019

step to reproduce:

  1. python setup.py build
  2. PYTHONPATH="${PWD}/build/lib.linux-${CARCH}-3.8" pytest -v

The complete log:

==> Starting check()...
============================= test session starts ==============================
platform linux -- Python 3.8.0, pytest-5.2.4, py-1.8.0, pluggy-0.13.0 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /build/python-fastrlock/src/fastrlock-0.4
collecting ... collected 0 items / 1 errors

==================================== ERRORS ====================================
________________ ERROR collecting fastrlock/tests/test_rlock.py ________________
ImportError while importing test module '/build/python-fastrlock/src/fastrlock-0.4/fastrlock/tests/test_rlock.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
fastrlock/tests/test_rlock.py:14: in <module>
    from fastrlock import rlock
E   ImportError: cannot import name 'rlock' from 'fastrlock' (/build/python-fastrlock/src/fastrlock-0.4/fastrlock/__init__.py)
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.25s ===============================
==> ERROR: A failure occurred in check().
    Aborting...
==> ERROR: Build failed, check /var/lib/archbuild/extra-x86_64/hubutui/build
@scoder
Copy link
Owner

scoder commented Nov 26, 2019

Try python setup.py build --inplace if you want to test locally.

@scoder scoder closed this as completed Nov 26, 2019
@hubutui
Copy link
Author

hubutui commented Nov 26, 2019

I got error "option --inplace not recognized":

NOTE: generated sources not available, need Cython to build
building with Cython 0.29.14
Compiling fastrlock/rlock.pyx because it changed.
[1/1] Cythonizing fastrlock/rlock.pyx
/usr/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/hubutui/Projects/archlinuxcn-repo/archlinuxcn/python-fastrlock/fastrlock-0.4/fastrlock/rlock.pxd
  tree = Parsing.p_module(s, pxd, full_module_name)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --inplace not recognized

@scoder
Copy link
Owner

scoder commented Nov 26, 2019

Right, it's python setup.py build_ext --inplace

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