mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
new test, modifications to pip
Signed-off-by: Kenneth Reitz <me@kennethreitz.org> Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
@@ -49,13 +49,14 @@ def check_dist_requires_python(dist):
|
||||
requires_python = pkg_info_dict.get('Requires-Python')
|
||||
try:
|
||||
if not check_requires_python(requires_python):
|
||||
raise exceptions.UnsupportedPythonVersion(
|
||||
"%s requires Python '%s' but the running Python is %s" % (
|
||||
dist.project_name,
|
||||
requires_python,
|
||||
'{0}.{1}.{2}'.format(*sys.version_info[:3])
|
||||
)
|
||||
)
|
||||
# raise exceptions.UnsupportedPythonVersion(
|
||||
# "%s requires Python '%s' but the running Python is %s" % (
|
||||
# dist.project_name,
|
||||
# requires_python,
|
||||
# '{0}.{1}.{2}'.format(*sys.version_info[:3])
|
||||
# )
|
||||
# )
|
||||
return
|
||||
except specifiers.InvalidSpecifier as e:
|
||||
logger.warning(
|
||||
"Package %s has an invalid Requires-Python entry %s - %s" % (
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import os
|
||||
from flask import Flask, redirect, abort, render_template, send_file
|
||||
import requests
|
||||
from flask import Flask, redirect, abort, render_template, send_file, jsonify
|
||||
|
||||
PYPI_VENDOR_DIR = os.environ.get('PYPI_VENDOR_DIR', './pypi')
|
||||
PYPI_VENDOR_DIR = os.path.abspath(PYPI_VENDOR_DIR)
|
||||
|
||||
app = Flask(__name__)
|
||||
session = requests.Session()
|
||||
|
||||
packages = {}
|
||||
|
||||
@@ -76,6 +78,10 @@ def serve_package(package, release):
|
||||
|
||||
abort(404)
|
||||
|
||||
@app.route('/pypi/<package>/json')
|
||||
def json_for_package(package):
|
||||
r = session.get('https://pypi.org/pypi/{0}/json'.format(package))
|
||||
return jsonify(r.json())
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
|
||||
@@ -238,6 +238,17 @@ class TestPipenv:
|
||||
assert 'urllib3' in p.lockfile['default']
|
||||
assert 'certifi' in p.lockfile['default']
|
||||
|
||||
@pytest.mark.complex_lock
|
||||
def test_complex_lock(self, pypi):
|
||||
with PipenvInstance(pypi=pypi) as p:
|
||||
c = p.pipenv('install apscheduler')
|
||||
assert c.return_code == 0
|
||||
assert 'apscheduler' in p.pipfile['packages']
|
||||
import pprint
|
||||
pprint.pprint(p.lockfile)
|
||||
assert 'futures' in p.lockfile[u'default']
|
||||
assert 'funcsigs' in p.lockfile[u'default']
|
||||
|
||||
@pytest.mark.dev
|
||||
@pytest.mark.run
|
||||
@pytest.mark.install
|
||||
|
||||
Reference in New Issue
Block a user