-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move resolver to venv, remove host markers from lockfile
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
- Loading branch information
1 parent
dc75eb5
commit ecf7842
Showing
85 changed files
with
24,361 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Pipenv Resolveer. | ||
Usage: | ||
resolver.py <packages>... [--verbose] [--pre] [--clear] | ||
resolver.py (-h | --help) | ||
resolver.py --version | ||
Options: | ||
-h --help Show this screen. | ||
--version Show version. | ||
--clear Clear the cache. | ||
--verbose Display debug information to stderr. | ||
--pre Include pre-releases. | ||
""" | ||
|
||
import os | ||
import sys | ||
import json | ||
|
||
for _dir in ('vendor', 'patched', '..'): | ||
dirpath = os.path.sep.join([os.path.dirname(__file__), _dir]) | ||
sys.path.insert(0, dirpath) | ||
|
||
import pipenv.project | ||
import pipenv.core | ||
from pipenv.utils import * | ||
|
||
from docopt import docopt | ||
args = docopt(__doc__) | ||
|
||
is_verbose = args['--verbose'] | ||
do_pre = args['--pre'] | ||
do_clear = args['--clear'] | ||
packages = args['<packages>'] | ||
|
||
project = pipenv.core.project | ||
|
||
os.environ['PIP_PYTHON_PATH'] = sys.executable | ||
|
||
def which(*args, **kwargs): | ||
return sys.executable | ||
|
||
def resolve(packages, pre=do_pre, sources=project.sources, verbose=is_verbose, clear=do_clear): | ||
return pipenv.utils.resolve_deps(packages, which, project=project, pre=pre, sources=sources, clear=clear, verbose=verbose) | ||
|
||
if __name__ == '__main__': | ||
results = resolve(packages) | ||
print('XYZZY') | ||
if results: | ||
print(json.dumps(results)) | ||
else: | ||
print(json.dumps([])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# __ | ||
# /__) _ _ _ _ _/ _ | ||
# / ( (- (/ (/ (- _) / _) | ||
# / | ||
|
||
""" | ||
Requests HTTP library | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
Requests is an HTTP library, written in Python, for human beings. Basic GET | ||
usage: | ||
>>> import requests | ||
>>> r = requests.get('https://www.python.org') | ||
>>> r.status_code | ||
200 | ||
>>> 'Python is a programming language' in r.content | ||
True | ||
... or POST: | ||
>>> payload = dict(key1='value1', key2='value2') | ||
>>> r = requests.post('http://httpbin.org/post', data=payload) | ||
>>> print(r.text) | ||
{ | ||
... | ||
"form": { | ||
"key2": "value2", | ||
"key1": "value1" | ||
}, | ||
... | ||
} | ||
The other HTTP methods are supported - see `requests.api`. Full documentation | ||
is at <http://python-requests.org>. | ||
:copyright: (c) 2016 by Kenneth Reitz. | ||
:license: Apache 2.0, see LICENSE for more details. | ||
""" | ||
|
||
__title__ = 'requests' | ||
__version__ = '2.11.1' | ||
__build__ = 0x021101 | ||
__author__ = 'Kenneth Reitz' | ||
__license__ = 'Apache 2.0' | ||
__copyright__ = 'Copyright 2016 Kenneth Reitz' | ||
|
||
# Attempt to enable urllib3's SNI support, if possible | ||
# Note: Patched by pip to prevent using the PyOpenSSL module. On Windows this | ||
# prevents upgrading cryptography. | ||
# try: | ||
# from .packages.urllib3.contrib import pyopenssl | ||
# pyopenssl.inject_into_urllib3() | ||
# except ImportError: | ||
# pass | ||
|
||
import warnings | ||
|
||
# urllib3's DependencyWarnings should be silenced. | ||
from .packages.urllib3.exceptions import DependencyWarning | ||
warnings.simplefilter('ignore', DependencyWarning) | ||
|
||
from . import utils | ||
from .models import Request, Response, PreparedRequest | ||
from .api import request, get, head, post, patch, put, delete, options | ||
from .sessions import session, Session | ||
from .status_codes import codes | ||
from .exceptions import ( | ||
RequestException, Timeout, URLRequired, | ||
TooManyRedirects, HTTPError, ConnectionError, | ||
FileModeWarning, ConnectTimeout, ReadTimeout | ||
) | ||
|
||
# Set default logging handler to avoid "No handler found" warnings. | ||
import logging | ||
try: # Python 2.7+ | ||
from logging import NullHandler | ||
except ImportError: | ||
class NullHandler(logging.Handler): | ||
def emit(self, record): | ||
pass | ||
|
||
logging.getLogger(__name__).addHandler(NullHandler()) | ||
|
||
# FileModeWarnings go off per the default. | ||
warnings.simplefilter('default', FileModeWarning, append=True) |
Oops, something went wrong.
This resolves #753.