mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 14:50:16 +00:00
Fix windows test failure and leaky session from xmlrpc call
Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
@@ -161,7 +161,7 @@ def test_include_editable_packages(PipenvInstance, testsroot, pathlib_tmpdir):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
with tarfile.open(source_path, "r:gz") as tarinfo:
|
||||
tarinfo.extractall(path=str(pathlib_tmpdir))
|
||||
c = p.pipenv('install -e {}'.format(package))
|
||||
c = p.pipenv('install -e {0!r}'.format(package))
|
||||
assert c.return_code == 0
|
||||
project = Project()
|
||||
assert "requests" in [
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
import os
|
||||
import json
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, print_function
|
||||
import contextlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
from tarfile import is_tarfile
|
||||
from zipfile import is_zipfile
|
||||
|
||||
import requests
|
||||
|
||||
from flask import Flask, redirect, abort, render_template, send_file, jsonify
|
||||
|
||||
if sys.version_info[:2] >= (3, 0):
|
||||
from xmlrpc.client import ServerProxy
|
||||
else:
|
||||
from xmlrpclib import ServerProxy
|
||||
|
||||
from zipfile import is_zipfile
|
||||
from tarfile import is_tarfile
|
||||
|
||||
import requests
|
||||
from flask import Flask, redirect, abort, render_template, send_file, jsonify
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
session = requests.Session()
|
||||
|
||||
@@ -22,9 +25,20 @@ packages = {}
|
||||
ARTIFACTS = {}
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def xml_pypi_server(server):
|
||||
session = requests.Session()
|
||||
client = ServerProxy(server, session)
|
||||
try:
|
||||
yield client
|
||||
finally:
|
||||
session.close()
|
||||
|
||||
|
||||
def get_pypi_package_names():
|
||||
client = ServerProxy("https://pypi.org/pypi")
|
||||
pypi_packages = set(client.list_packages())
|
||||
pypi_packages = set()
|
||||
with xml_pypi_server("https://pypi.org/pypi") as client:
|
||||
pypi_packages = set(client.list_packages())
|
||||
return pypi_packages
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user