Fix resource errors

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-11-11 18:49:44 -05:00
parent 8643a733c2
commit fe9d996f89
4 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ class Environment(object):
super(Environment, self).__init__()
self._modules = {'pkg_resources': pkg_resources, 'pipenv': pipenv}
self.base_working_set = base_working_set if base_working_set else BASE_WORKING_SET
self.is_venv = not os.path.samefile(os.path.abspath(prefix), sys.prefix)
self.is_venv = not os.samefile(os.path.abspath(prefix), sys.prefix)
if not sources:
sources = []
self.sources = sources
+2 -3
View File
@@ -3,12 +3,11 @@ __version__ = '1.2.6'
import logging
import warnings
warnings.filterwarnings("ignore", category=ResourceWarning)
from vistir.compat import ResourceWarning
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
warnings.filterwarnings("ignore", category=ResourceWarning)
from .models.requirements import Requirement
from .models.lockfile import Lockfile
+2
View File
@@ -1,6 +1,7 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import atexit
import copy
import hashlib
import json
@@ -197,6 +198,7 @@ class HashCache(SafeFileCache):
if not session:
import requests
session = requests.session()
atexit.register(session.close)
cache_dir = kwargs.pop('cache_dir', CACHE_DIR)
self.session = session
kwargs.setdefault('directory', os.path.join(cache_dir, 'hash-cache'))
+3
View File
@@ -1,5 +1,6 @@
# -*- coding=utf-8 -*-
import atexit
import contextlib
import copy
import functools
@@ -361,6 +362,7 @@ def get_dependencies_from_json(ireq):
return
session = requests.session()
atexit.register(session.close)
version = str(ireq.req.specifier).lstrip("=")
def gen(ireq):
@@ -575,6 +577,7 @@ def get_finder(sources=None, pip_command=None, pip_options=None):
if not pip_options:
pip_options = get_pip_options(sources=sources, pip_command=pip_command)
session = pip_command._build_session(pip_options)
atexit.register(session.close)
finder = pip_shims.shims.PackageFinder(
find_links=[],
index_urls=[s.get("url") for s in sources],