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

pytest fails to resolve version when built but not installed #874

Closed
jonassmedegaard opened this issue Sep 22, 2018 · 3 comments
Closed

Comments

@jonassmedegaard
Copy link

For packaging Radicale for Debian, my build routines include running the testsuite after building the package, by running this command:

mkdir -p debian/python-module-stampdir
HOME="/build/radicale-2.1.10" py.test-3

..but at some point after 2.1.8 (probably commit 062e853) above fails like this:

_________________ ERROR collecting radicale/tests/test_auth.py _________________
/usr/lib/python3/dist-packages/py/_path/local.py:668: in pyimport
import(modname)
radicale/init.py:57: in
VERSION = pkg_resources.get_distribution('radicale').version
/usr/lib/python3/dist-packages/pkg_resources/init.py:476: in get_distribution
dist = get_provider(dist)
/usr/lib/python3/dist-packages/pkg_resources/init.py:352: in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
/usr/lib/python3/dist-packages/pkg_resources/init.py:895: in require
needed = self.resolve(parse_requirements(requirements))
/usr/lib/python3/dist-packages/pkg_resources/init.py:781: in resolve
raise DistributionNotFound(req, requirers)
E pkg_resources.DistributionNotFound: The 'radicale' distribution was not found and is required by the application

@gx42
Copy link

gx42 commented Jun 12, 2020

I'm encountering the same exception with 3.0.3. When I clone the repository and try to run Radicale, I get:

[user@comms Radicale]$ python3 radicale.py --config ../config/g42_config
Traceback (most recent call last):
  File "radicale.py", line 13, in <module>
    runpy.run_module("radicale", run_name="__main__")
  File "/usr/lib64/python3.7/runpy.py", line 201, in run_module
    mod_name, mod_spec, code = _get_module_details(mod_name)
  File "/usr/lib64/python3.7/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib64/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/user/Radicale/three/Radicale/radicale/__init__.py", line 33, in <module>
    from radicale import config, log
  File "/home/user/Radicale/three/Radicale/radicale/config.py", line 35, in <module>
    from radicale import auth, rights, storage, web
  File "/home/user/Radicale/three/Radicale/radicale/storage/__init__.py", line 40, in <module>
    for pkg in CACHE_DEPS) + ";").encode()
  File "/home/user/Radicale/three/Radicale/radicale/storage/__init__.py", line 40, in <genexpr>
    for pkg in CACHE_DEPS) + ";").encode()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 481, in get_distribution
    dist = get_provider(dist)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 357, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'radicale' distribution was not found and is required by the application

Installing Radicale via PIP is not an option, as I'm running 1.1.4 alongside while I attempt to upgrade.

@henning-schild
Copy link

@Unrud
Copy link
Collaborator

Unrud commented Jul 2, 2022

Metadata for the Radicale package must be installed. This means that Radicale*.dist-info or Radicale*.egg-info must exist in Python's site-packages directory. The metadata is used to query our own version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants