-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
--pyargs cannot locate namespace packages installed in editable mode #1567
Comments
i think this might be duplicate of #478 do you agree? |
Yes, I actually just noticed that too. |
also note, that this is a bug in setuptools namespaces vs setup.py develop |
I cannot judge whether the difference in behavior between setuptools and |
Thank you, quite an interesting read. Would you mind if I give a look at |
Actually, the # Create fresh environment:
virtualenv --no-site-packages env
source env/bin/activate
# Get the sources:
mkdir src
git clone https://github.com/morepath/more.chameleon src/more.chameleon
git clone https://github.com/morepath/more.basicauth src/more.basicauth
git clone https://github.com/morepath/more.forwarded src/more.forwarded
# Install the libraries in "develop" mode:
for k in src/*; do (cd $k; python setup.py develop); done
# Install the test requirements:
pip install pytest WebTest pytest-cov
# verify that the libraries are installed
python -c 'import more.chameleon, more.basicauth, more.forwarded'
# Try to run py.test
py.test --pyargs more.chameleon That still fails with
|
i think the problem is finding namespace package path properly - py.test currently does not support that kind of discovery it needs active support and logic i think |
As far as I'm concerned, #1597 solves this issue, which I think it can now be closed. |
Oh yeah, thanks! |
I am still seeing this issue on Python 3.9 and pytest 7.1.3, probably #1597 has not addressed the full extent of the problem. We have a mix of namespace and "normal" Python modules in https://github.com/sagemath/sage
sort of errors, while
is really there. Is it because it tries to import the parent? (which is also a namespace package) ? |
Pytest is unaware of pep420, nobody fixed that so far |
If this was documented, it would have saved us unnecessary banging of heads on keyboard. |
@dimpase indeed we should have this documented somewhere, to avoid users wasting time on this. Perhaps we can improve the error message:
|
should there be an issue on making pytest PEP 420-aware? |
Created #10569. |
The
--pyargs
command-line switch cannot locate libraries within a namespace package that are installed in editable mode.How to reproduce
In a fresh virtual environment install the attached pinned requirements:
This will install three libraries (more.basicauth, more.chameleon, more.forwarded) in editable mode, together with their dependencies.
These libraries are all defined within the
more
namespace package.Run
$ py.test --pyargs more.chamaleon
This is the output I get:
Expected output
I expect that py.test invocation to produce similar output as
The text was updated successfully, but these errors were encountered: