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

install error from AUR #302

Closed
aleprovencio opened this issue Feb 20, 2018 · 10 comments
Closed

install error from AUR #302

aleprovencio opened this issue Feb 20, 2018 · 10 comments

Comments

@aleprovencio
Copy link

Hello, I'm getting an ImportError for tests.helpers while trying to install todoman from AUR with trizen.
Please let me know if I should post this on the package's AUR page.

Relevant output:

_____________________________ ERROR collecting tests/test_cli.py ______________________________
ImportError while importing test module '/tmp/trizen-aleprovencio/todoman/src/todoman-3.2.4/tests/test_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_cli.py:14: in <module>
    from tests.helpers import pyicu_sensitive
E   ModuleNotFoundError: No module named 'tests.helpers'
__________________________ ERROR collecting tests/test_formatter.py ___________________________
ImportError while importing test module '/tmp/trizen-aleprovencio/todoman/src/todoman-3.2.4/tests/test_formatter.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_formatter.py:7: in <module>
    from tests.helpers import pyicu_sensitive
E   ModuleNotFoundError: No module named 'tests.helpers'
@doronbehar
Copy link
Contributor

That also happens when running just py.test from the release of version 3.3.0.

@WhyNotHugo
Copy link
Member

@doronbehar v3.3.0 fails some tests due to some upstream changes.
I've pushed v3.4.0, which includes these fixes. I'll update AUR soon.

@aleprovencio Is this still an issue for you?

@doronbehar
Copy link
Contributor

I still experience the same issue with the latest git version which is identical at the moment to v3.4.0.

@aleprovencio
Copy link
Author

same here :/

@WhyNotHugo
Copy link
Member

That's really odd. Can you download the package and manually run makepkg (just to confirm that your AUR helper isn't doing anything funky)?

Thanks.

@doronbehar
Copy link
Contributor

Confirmed.

@WhyNotHugo
Copy link
Member

Can you add this into the check() function in the PKGBUILD, and tell me what the output is? I'm kind of at a loss:

python -c "import tests; print(tests.__path__)"

@aleprovencio
Copy link
Author

output;
['/home/aleprovencio/.local/lib/python3.6/site-packages/tests']

@doronbehar
Copy link
Contributor

@WhyNotHugo, I don't think it is a matter related to the way the AUR package is built. I get the same errors when I clone your repository fresh and I run py.test from it's root directory.

When I run the command you specified in your last comment, I got the following output:

['/usr/lib/python3.6/site-packages/tests']

Since I'm using Arch Linux, running pacman -Qoq /usr/lib/python3.6.site-packages/tests (I ask pacman to tell me what packages own this file / directory) Gives me:

python-gogs-client
python-pipenv

I believe that means the import tests statement is importing the wrong modules. I guess that if we'd remove these specific packages, the tests should pass just fine. But of course that's not a solution but a workaround. I think todoman should change the name of the tests/ directory perhaps to something like todoman_tests and update the rest of the tests' files accordingly.

@WhyNotHugo
Copy link
Member

What I find odd is that that tests is a namespace package for me; as expected:

$ python -c "import tests; print(tests.__path__)"
_NamespacePath(['/usr/lib/python3.6/site-packages/tests'])
$ pacman -Qo /usr/lib/python3.6/site-packages/tests
/usr/lib/python3.6/site-packages/tests/ is owned by python-pipenv 2018.05.18-1

I believe that means the import tests statement is importing the wrong modules. I guess that if we'd remove these specific packages, the tests should pass just fine. But of course that's not a solution but a workaround. I think todoman should change the name of the tests/ directory perhaps to something like todoman_tests and update the rest of the tests' files accordingly.

Nope, using tests as a package name is super common (I'd say most package with tests do that). The issue lies elsewhere. I'm confused why your python doesn't


Actually, I debugged this a bit. python-gogs-client includes /usr/lib/python3.6/site-packages/tests/__init__.py. This breaks tests as a namespace package. This will basically break any tests for any python app.

I've just reported this: https://aur.archlinux.org/packages/python-gogs-client/#comment-647241

There's not much else that can be done on our end.

@aleprovencio: I suggest you find out how /home/aleprovencio/.local/lib/python3.6/site-packages/tests/__init__.py ended up getting created, and report that upstream too (or you can delete that file).

As a workaround, you can delete the check() function from the PKGBUILD to skip the tests entirely.

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

3 participants