mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
Don't fail if a package was not found
This commit is contained in:
parent
d25e07660e
commit
5e70843a73
13
doc/build.py
13
doc/build.py
@ -10,11 +10,14 @@ def pip_install(package, commit=None, **kwargs):
|
|||||||
"Install package using pip."
|
"Install package using pip."
|
||||||
min_version = kwargs.get('min_version')
|
min_version = kwargs.get('min_version')
|
||||||
if min_version:
|
if min_version:
|
||||||
from pkg_resources import get_distribution
|
from pkg_resources import get_distribution, DistributionNotFound
|
||||||
installed_version = get_distribution(os.path.basename(package)).version
|
try:
|
||||||
if LooseVersion(installed_version) >= min_version:
|
installed_version = get_distribution(os.path.basename(package)).version
|
||||||
print('{} {} already installed'.format(package, min_version))
|
if LooseVersion(installed_version) >= min_version:
|
||||||
return
|
print('{} {} already installed'.format(package, min_version))
|
||||||
|
return
|
||||||
|
except DistributionNotFound:
|
||||||
|
pass
|
||||||
if commit:
|
if commit:
|
||||||
package = 'git+git://github.com/{0}.git@{1}'.format(package, commit)
|
package = 'git+git://github.com/{0}.git@{1}'.format(package, commit)
|
||||||
print('Installing {}'.format(package))
|
print('Installing {}'.format(package))
|
||||||
|
Loading…
Reference in New Issue
Block a user