mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 16:36:20 +00:00
use pkg_resources instead of _auto_deps.install_requires
This commit is contained in:
parent
b49ac06f30
commit
66c7ff7383
@ -10,7 +10,7 @@ __all__ = [
|
|||||||
"normalized_version",
|
"normalized_version",
|
||||||
]
|
]
|
||||||
|
|
||||||
import os, platform, re, subprocess, sys, traceback
|
import os, platform, re, subprocess, sys, traceback, pkg_resources
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
@ -71,18 +71,28 @@ def normalized_version(verstr, what=None):
|
|||||||
six.reraise(cls, new_exc, trace)
|
six.reraise(cls, new_exc, trace)
|
||||||
|
|
||||||
def _get_error_string(errors, debug=False):
|
def _get_error_string(errors, debug=False):
|
||||||
from allmydata._auto_deps import install_requires
|
install_requires = list(
|
||||||
|
str(req)
|
||||||
|
for req
|
||||||
|
in pkg_resources.get_distribution(__appname__).requires()
|
||||||
|
)
|
||||||
|
|
||||||
msg = "\n%s\n" % ("\n".join(errors),)
|
msg = "\n%s\n" % ("\n".join(errors),)
|
||||||
if debug:
|
if debug:
|
||||||
msg += ("\n"
|
msg += (
|
||||||
"For debugging purposes, the PYTHONPATH was\n"
|
"\n"
|
||||||
" %r\n"
|
"For debugging purposes, the PYTHONPATH was\n"
|
||||||
"install_requires was\n"
|
" %r\n"
|
||||||
" %r\n"
|
"install_requires was\n"
|
||||||
"sys.path after importing pkg_resources was\n"
|
" %r\n"
|
||||||
" %s\n"
|
"sys.path after importing pkg_resources was\n"
|
||||||
% (os.environ.get('PYTHONPATH'), install_requires, (os.pathsep+"\n ").join(sys.path)) )
|
" %s\n"
|
||||||
|
% (
|
||||||
|
os.environ.get('PYTHONPATH'),
|
||||||
|
install_requires,
|
||||||
|
(os.pathsep+"\n ").join(sys.path),
|
||||||
|
)
|
||||||
|
)
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def _cross_check(pkg_resources_vers_and_locs, imported_vers_and_locs_list):
|
def _cross_check(pkg_resources_vers_and_locs, imported_vers_and_locs_list):
|
||||||
@ -311,11 +321,16 @@ def _get_package_versions_and_locations():
|
|||||||
pkg_resources_vers_and_locs = dict()
|
pkg_resources_vers_and_locs = dict()
|
||||||
|
|
||||||
if not hasattr(sys, 'frozen'):
|
if not hasattr(sys, 'frozen'):
|
||||||
import pkg_resources
|
install_requires = list(
|
||||||
from _auto_deps import install_requires
|
str(req)
|
||||||
|
for req
|
||||||
pkg_resources_vers_and_locs = dict([(p.project_name.lower(), (str(p.version), p.location))
|
in pkg_resources.get_distribution(__appname__).requires()
|
||||||
for p in pkg_resources.require(install_requires)])
|
)
|
||||||
|
pkg_resources_vers_and_locs = {
|
||||||
|
p.project_name.lower(): (str(p.version), p.location)
|
||||||
|
for p
|
||||||
|
in pkg_resources.require(install_requires)
|
||||||
|
}
|
||||||
|
|
||||||
def get_version(module):
|
def get_version(module):
|
||||||
if hasattr(module, '__version__'):
|
if hasattr(module, '__version__'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user