scoder / fastrlock

A fast RLock implementation for CPython
MIT License
23 stars 10 forks source link

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

Closed hubutui closed 4 years ago

hubutui commented 4 years ago

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 commented 4 years ago

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

hubutui commented 4 years ago

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 commented 4 years ago

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