diff --git a/poetry/core/__init__.py b/poetry/core/__init__.py index 6d03f4671..91077e15e 100644 --- a/poetry/core/__init__.py +++ b/poetry/core/__init__.py @@ -1 +1,15 @@ +import sys + + +try: + from pathlib import Path +except ImportError: + # noinspection PyUnresolvedReferences + from pathlib2 import Path + __version__ = "1.0.0a5" + +__vendor_site__ = (Path(__file__).parent / "_vendor").as_posix() + +if __vendor_site__ not in sys.path: + sys.path.insert(0, __vendor_site__) diff --git a/poetry/core/_vendor/__init__.py b/poetry/core/_vendor/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/poetry/core/_vendor/jsonschema/LICENSE b/poetry/core/_vendor/jsonschema/LICENSE new file mode 100644 index 000000000..c28adbadd --- /dev/null +++ b/poetry/core/_vendor/jsonschema/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Julian Berman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/poetry/core/_vendor/jsonschema/__init__.py b/poetry/core/_vendor/jsonschema/__init__.py index b21b281dc..1791fe7fb 100644 --- a/poetry/core/_vendor/jsonschema/__init__.py +++ b/poetry/core/_vendor/jsonschema/__init__.py @@ -8,18 +8,18 @@ instance under a schema, and will create a validator for you. """ -from poetry.core._vendor.jsonschema.exceptions import ( +from jsonschema.exceptions import ( ErrorTree, FormatError, RefResolutionError, SchemaError, ValidationError ) -from poetry.core._vendor.jsonschema._format import ( +from jsonschema._format import ( FormatChecker, draft3_format_checker, draft4_format_checker, draft6_format_checker, draft7_format_checker, ) -from poetry.core._vendor.jsonschema._types import TypeChecker -from poetry.core._vendor.jsonschema.validators import ( +from jsonschema._types import TypeChecker +from jsonschema.validators import ( Draft3Validator, Draft4Validator, Draft6Validator, diff --git a/poetry/core/_vendor/jsonschema/__main__.py b/poetry/core/_vendor/jsonschema/__main__.py index 2d1a68a73..82c29fd39 100644 --- a/poetry/core/_vendor/jsonschema/__main__.py +++ b/poetry/core/_vendor/jsonschema/__main__.py @@ -1,2 +1,2 @@ -from poetry.core._vendor.jsonschema.cli import main +from jsonschema.cli import main main() diff --git a/poetry/core/_vendor/jsonschema/_format.py b/poetry/core/_vendor/jsonschema/_format.py index 7c7617c77..281a7cfcf 100644 --- a/poetry/core/_vendor/jsonschema/_format.py +++ b/poetry/core/_vendor/jsonschema/_format.py @@ -3,8 +3,8 @@ import socket import struct -from poetry.core._vendor.jsonschema.compat import str_types -from poetry.core._vendor.jsonschema.exceptions import FormatError +from jsonschema.compat import str_types +from jsonschema.exceptions import FormatError class FormatChecker(object): diff --git a/poetry/core/_vendor/jsonschema/_legacy_validators.py b/poetry/core/_vendor/jsonschema/_legacy_validators.py index 3b49c35f8..264ff7d71 100644 --- a/poetry/core/_vendor/jsonschema/_legacy_validators.py +++ b/poetry/core/_vendor/jsonschema/_legacy_validators.py @@ -1,6 +1,6 @@ -from poetry.core._vendor.jsonschema import _utils -from poetry.core._vendor.jsonschema.compat import iteritems -from poetry.core._vendor.jsonschema.exceptions import ValidationError +from jsonschema import _utils +from jsonschema.compat import iteritems +from jsonschema.exceptions import ValidationError def dependencies_draft3(validator, dependencies, instance, schema): diff --git a/poetry/core/_vendor/jsonschema/_reflect.py b/poetry/core/_vendor/jsonschema/_reflect.py index 63f672d3d..d09e38fbd 100644 --- a/poetry/core/_vendor/jsonschema/_reflect.py +++ b/poetry/core/_vendor/jsonschema/_reflect.py @@ -9,7 +9,7 @@ import sys -from poetry.core._vendor.jsonschema.compat import PY3 +from jsonschema.compat import PY3 class _NoModuleFound(Exception): diff --git a/poetry/core/_vendor/jsonschema/_types.py b/poetry/core/_vendor/jsonschema/_types.py index d2211d2d5..a71a4e34b 100644 --- a/poetry/core/_vendor/jsonschema/_types.py +++ b/poetry/core/_vendor/jsonschema/_types.py @@ -1,10 +1,10 @@ import numbers -from poetry.core._vendor.pyrsistent import pmap -from poetry.core._vendor import attr +from pyrsistent import pmap +import attr -from poetry.core._vendor.jsonschema.compat import int_types, str_types -from poetry.core._vendor.jsonschema.exceptions import UndefinedTypeCheck +from jsonschema.compat import int_types, str_types +from jsonschema.exceptions import UndefinedTypeCheck def is_array(checker, instance): diff --git a/poetry/core/_vendor/jsonschema/_utils.py b/poetry/core/_vendor/jsonschema/_utils.py index 59ebb3385..117eec24b 100644 --- a/poetry/core/_vendor/jsonschema/_utils.py +++ b/poetry/core/_vendor/jsonschema/_utils.py @@ -3,7 +3,7 @@ import os import re -from poetry.core._vendor.jsonschema.compat import MutableMapping, str_types, urlsplit +from jsonschema.compat import MutableMapping, str_types, urlsplit class URIDict(MutableMapping): diff --git a/poetry/core/_vendor/jsonschema/_validators.py b/poetry/core/_vendor/jsonschema/_validators.py index ea6b7f326..179fec09a 100644 --- a/poetry/core/_vendor/jsonschema/_validators.py +++ b/poetry/core/_vendor/jsonschema/_validators.py @@ -1,6 +1,6 @@ import re -from poetry.core._vendor.jsonschema._utils import ( +from jsonschema._utils import ( ensure_list, equal, extras_msg, @@ -9,8 +9,8 @@ unbool, uniq, ) -from poetry.core._vendor.jsonschema.exceptions import FormatError, ValidationError -from poetry.core._vendor.jsonschema.compat import iteritems +from jsonschema.exceptions import FormatError, ValidationError +from jsonschema.compat import iteritems def patternProperties(validator, patternProperties, instance, schema): diff --git a/poetry/core/_vendor/jsonschema/benchmarks/issue232.py b/poetry/core/_vendor/jsonschema/benchmarks/issue232.py index 316fe17d2..65e3aedf7 100644 --- a/poetry/core/_vendor/jsonschema/benchmarks/issue232.py +++ b/poetry/core/_vendor/jsonschema/benchmarks/issue232.py @@ -6,10 +6,10 @@ """ from twisted.python.filepath import FilePath from pyperf import Runner -from poetry.core._vendor.pyrsistent import m +from pyrsistent import m -from poetry.core._vendor.jsonschema.tests._suite import Version -from poetry.core._vendor import jsonschema +from jsonschema.tests._suite import Version +import jsonschema issue232 = Version( diff --git a/poetry/core/_vendor/jsonschema/benchmarks/json_schema_test_suite.py b/poetry/core/_vendor/jsonschema/benchmarks/json_schema_test_suite.py index 7f580c1b5..5add5051d 100644 --- a/poetry/core/_vendor/jsonschema/benchmarks/json_schema_test_suite.py +++ b/poetry/core/_vendor/jsonschema/benchmarks/json_schema_test_suite.py @@ -7,7 +7,7 @@ """ from pyperf import Runner -from poetry.core._vendor.jsonschema.tests._suite import Suite +from jsonschema.tests._suite import Suite if __name__ == "__main__": diff --git a/poetry/core/_vendor/jsonschema/cli.py b/poetry/core/_vendor/jsonschema/cli.py index ce3a5d309..ab3335b27 100644 --- a/poetry/core/_vendor/jsonschema/cli.py +++ b/poetry/core/_vendor/jsonschema/cli.py @@ -6,9 +6,9 @@ import json import sys -from poetry.core._vendor.jsonschema import __version__ -from poetry.core._vendor.jsonschema._reflect import namedAny -from poetry.core._vendor.jsonschema.validators import validator_for +from jsonschema import __version__ +from jsonschema._reflect import namedAny +from jsonschema.validators import validator_for def _namedAnyWithDefault(name): diff --git a/poetry/core/_vendor/jsonschema/exceptions.py b/poetry/core/_vendor/jsonschema/exceptions.py index 7bbf3ce2c..691dcffe6 100644 --- a/poetry/core/_vendor/jsonschema/exceptions.py +++ b/poetry/core/_vendor/jsonschema/exceptions.py @@ -6,10 +6,10 @@ import pprint import textwrap -from poetry.core._vendor import attr +import attr -from poetry.core._vendor.jsonschema import _utils -from poetry.core._vendor.jsonschema.compat import PY3, iteritems +from jsonschema import _utils +from jsonschema.compat import PY3, iteritems WEAK_MATCHES = frozenset(["anyOf", "oneOf"]) diff --git a/poetry/core/_vendor/jsonschema/validators.py b/poetry/core/_vendor/jsonschema/validators.py index feda69000..1dc420c70 100644 --- a/poetry/core/_vendor/jsonschema/validators.py +++ b/poetry/core/_vendor/jsonschema/validators.py @@ -8,16 +8,16 @@ import json import numbers -from poetry.core._vendor.six import add_metaclass +from six import add_metaclass -from poetry.core._vendor.jsonschema import ( +from jsonschema import ( _legacy_validators, _types, _utils, _validators, exceptions, ) -from poetry.core._vendor.jsonschema.compat import ( +from jsonschema.compat import ( Sequence, int_types, iteritems, @@ -33,7 +33,7 @@ # Sigh. https://gitlab.com/pycqa/flake8/issues/280 # https://github.com/pyga/ebb-lint/issues/7 # Imported for backwards compatibility. -from poetry.core._vendor.jsonschema.exceptions import ErrorTree +from jsonschema.exceptions import ErrorTree ErrorTree diff --git a/poetry/core/_vendor/packaging/_typing.py b/poetry/core/_vendor/packaging/_typing.py index 9df017596..dc6dfce7a 100644 --- a/poetry/core/_vendor/packaging/_typing.py +++ b/poetry/core/_vendor/packaging/_typing.py @@ -18,7 +18,7 @@ In packaging, all static-typing related imports should be guarded as follows: - from poetry.core._vendor.packaging._typing import MYPY_CHECK_RUNNING + from packaging._typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import ... diff --git a/poetry/core/_vendor/packaging/markers.py b/poetry/core/_vendor/packaging/markers.py index 1cca2f9b7..f01747113 100644 --- a/poetry/core/_vendor/packaging/markers.py +++ b/poetry/core/_vendor/packaging/markers.py @@ -8,9 +8,9 @@ import platform import sys -from poetry.core._vendor.pyparsing import ParseException, ParseResults, stringStart, stringEnd -from poetry.core._vendor.pyparsing import ZeroOrMore, Group, Forward, QuotedString -from poetry.core._vendor.pyparsing import Literal as L # noqa +from pyparsing import ParseException, ParseResults, stringStart, stringEnd +from pyparsing import ZeroOrMore, Group, Forward, QuotedString +from pyparsing import Literal as L # noqa from ._compat import string_types from ._typing import MYPY_CHECK_RUNNING diff --git a/poetry/core/_vendor/packaging/requirements.py b/poetry/core/_vendor/packaging/requirements.py index eae087bcc..1b547927d 100644 --- a/poetry/core/_vendor/packaging/requirements.py +++ b/poetry/core/_vendor/packaging/requirements.py @@ -6,10 +6,10 @@ import string import re -from poetry.core._vendor.pyparsing import stringStart, stringEnd, originalTextFor, ParseException -from poetry.core._vendor.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine -from poetry.core._vendor.pyparsing import Literal as L # noqa -from poetry.core._vendor.six.moves.urllib import parse as urlparse +from pyparsing import stringStart, stringEnd, originalTextFor, ParseException +from pyparsing import ZeroOrMore, Word, Optional, Regex, Combine +from pyparsing import Literal as L # noqa +from six.moves.urllib import parse as urlparse from ._typing import MYPY_CHECK_RUNNING from .markers import MARKER_EXPR, Marker diff --git a/poetry/core/_vendor/pyparsing.py b/poetry/core/_vendor/pyparsing.py index d5dd35c1e..4d2f98e46 100644 --- a/poetry/core/_vendor/pyparsing.py +++ b/poetry/core/_vendor/pyparsing.py @@ -41,7 +41,7 @@ (the :class:`'+'` operators create :class:`And` expressions, and the strings are auto-converted to :class:`Literal` expressions):: - from poetry.core._vendor.pyparsing import Word, alphas + from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" @@ -1881,7 +1881,7 @@ def enablePackrat(cache_size_limit=128): Example:: - from poetry.core._vendor import pyparsing + import pyparsing pyparsing.ParserElement.enablePackrat() """ if not ParserElement._packratEnabled: diff --git a/poetry/core/_vendor/pyrsistent/__init__.py b/poetry/core/_vendor/pyrsistent/__init__.py index 635aad184..be299658f 100644 --- a/poetry/core/_vendor/pyrsistent/__init__.py +++ b/poetry/core/_vendor/pyrsistent/__init__.py @@ -1,35 +1,35 @@ # -*- coding: utf-8 -*- -from poetry.core._vendor.pyrsistent._pmap import pmap, m, PMap +from pyrsistent._pmap import pmap, m, PMap -from poetry.core._vendor.pyrsistent._pvector import pvector, v, PVector +from pyrsistent._pvector import pvector, v, PVector -from poetry.core._vendor.pyrsistent._pset import pset, s, PSet +from pyrsistent._pset import pset, s, PSet -from poetry.core._vendor.pyrsistent._pbag import pbag, b, PBag +from pyrsistent._pbag import pbag, b, PBag -from poetry.core._vendor.pyrsistent._plist import plist, l, PList +from pyrsistent._plist import plist, l, PList -from poetry.core._vendor.pyrsistent._pdeque import pdeque, dq, PDeque +from pyrsistent._pdeque import pdeque, dq, PDeque -from poetry.core._vendor.pyrsistent._checked_types import ( +from pyrsistent._checked_types import ( CheckedPMap, CheckedPVector, CheckedPSet, InvariantException, CheckedKeyTypeError, CheckedValueTypeError, CheckedType, optional) -from poetry.core._vendor.pyrsistent._field_common import ( +from pyrsistent._field_common import ( field, PTypeError, pset_field, pmap_field, pvector_field) -from poetry.core._vendor.pyrsistent._precord import PRecord +from pyrsistent._precord import PRecord -from poetry.core._vendor.pyrsistent._pclass import PClass, PClassMeta +from pyrsistent._pclass import PClass, PClassMeta -from poetry.core._vendor.pyrsistent._immutable import immutable +from pyrsistent._immutable import immutable -from poetry.core._vendor.pyrsistent._helpers import freeze, thaw, mutant +from pyrsistent._helpers import freeze, thaw, mutant -from poetry.core._vendor.pyrsistent._transformations import inc, discard, rex, ny +from pyrsistent._transformations import inc, discard, rex, ny -from poetry.core._vendor.pyrsistent._toolz import get_in +from pyrsistent._toolz import get_in __all__ = ('pmap', 'm', 'PMap', diff --git a/poetry/core/_vendor/pyrsistent/_checked_types.py b/poetry/core/_vendor/pyrsistent/_checked_types.py index 97f968bce..293d989f1 100644 --- a/poetry/core/_vendor/pyrsistent/_checked_types.py +++ b/poetry/core/_vendor/pyrsistent/_checked_types.py @@ -1,10 +1,10 @@ from ._compat import Iterable -from poetry.core._vendor import six +import six -from poetry.core._vendor.pyrsistent._compat import Enum, string_types -from poetry.core._vendor.pyrsistent._pmap import PMap, pmap -from poetry.core._vendor.pyrsistent._pset import PSet, pset -from poetry.core._vendor.pyrsistent._pvector import PythonPVector, python_pvector +from pyrsistent._compat import Enum, string_types +from pyrsistent._pmap import PMap, pmap +from pyrsistent._pset import PSet, pset +from pyrsistent._pvector import PythonPVector, python_pvector class CheckedType(object): diff --git a/poetry/core/_vendor/pyrsistent/_compat.py b/poetry/core/_vendor/pyrsistent/_compat.py index 829a76284..e728586af 100644 --- a/poetry/core/_vendor/pyrsistent/_compat.py +++ b/poetry/core/_vendor/pyrsistent/_compat.py @@ -1,4 +1,4 @@ -from poetry.core._vendor.six import string_types +from six import string_types # enum compat diff --git a/poetry/core/_vendor/pyrsistent/_field_common.py b/poetry/core/_vendor/pyrsistent/_field_common.py index 64f2386c9..ca1cccd43 100644 --- a/poetry/core/_vendor/pyrsistent/_field_common.py +++ b/poetry/core/_vendor/pyrsistent/_field_common.py @@ -1,7 +1,7 @@ -from poetry.core._vendor import six +import six import sys -from poetry.core._vendor.pyrsistent._checked_types import ( +from pyrsistent._checked_types import ( CheckedPMap, CheckedPSet, CheckedPVector, @@ -12,8 +12,8 @@ maybe_parse_user_type, maybe_parse_many_user_types, ) -from poetry.core._vendor.pyrsistent._checked_types import optional as optional_type -from poetry.core._vendor.pyrsistent._checked_types import wrap_invariant +from pyrsistent._checked_types import optional as optional_type +from pyrsistent._checked_types import wrap_invariant import inspect PY2 = sys.version_info[0] < 3 diff --git a/poetry/core/_vendor/pyrsistent/_helpers.py b/poetry/core/_vendor/pyrsistent/_helpers.py index 0359a6ef4..c9c58feac 100644 --- a/poetry/core/_vendor/pyrsistent/_helpers.py +++ b/poetry/core/_vendor/pyrsistent/_helpers.py @@ -1,8 +1,8 @@ from functools import wraps -from poetry.core._vendor import six -from poetry.core._vendor.pyrsistent._pmap import PMap, pmap -from poetry.core._vendor.pyrsistent._pset import PSet, pset -from poetry.core._vendor.pyrsistent._pvector import PVector, pvector +import six +from pyrsistent._pmap import PMap, pmap +from pyrsistent._pset import PSet, pset +from pyrsistent._pvector import PVector, pvector def freeze(o): diff --git a/poetry/core/_vendor/pyrsistent/_immutable.py b/poetry/core/_vendor/pyrsistent/_immutable.py index 19c200a36..a89bd7552 100644 --- a/poetry/core/_vendor/pyrsistent/_immutable.py +++ b/poetry/core/_vendor/pyrsistent/_immutable.py @@ -1,6 +1,6 @@ import sys -from poetry.core._vendor import six +import six def immutable(members='', name='Immutable', verbose=False): diff --git a/poetry/core/_vendor/pyrsistent/_pbag.py b/poetry/core/_vendor/pyrsistent/_pbag.py index 9af7f1adf..9905e9a6e 100644 --- a/poetry/core/_vendor/pyrsistent/_pbag.py +++ b/poetry/core/_vendor/pyrsistent/_pbag.py @@ -1,6 +1,6 @@ from ._compat import Container, Iterable, Sized, Hashable from functools import reduce -from poetry.core._vendor.pyrsistent._pmap import pmap +from pyrsistent._pmap import pmap def _add_to_counters(counters, element): diff --git a/poetry/core/_vendor/pyrsistent/_pclass.py b/poetry/core/_vendor/pyrsistent/_pclass.py index 608f1c3c3..a437f7164 100644 --- a/poetry/core/_vendor/pyrsistent/_pclass.py +++ b/poetry/core/_vendor/pyrsistent/_pclass.py @@ -1,9 +1,9 @@ -from poetry.core._vendor import six -from poetry.core._vendor.pyrsistent._checked_types import (InvariantException, CheckedType, _restore_pickle, store_invariants) -from poetry.core._vendor.pyrsistent._field_common import ( +import six +from pyrsistent._checked_types import (InvariantException, CheckedType, _restore_pickle, store_invariants) +from pyrsistent._field_common import ( set_fields, check_type, is_field_ignore_extra_complaint, PFIELD_NO_INITIAL, serialize, check_global_invariants ) -from poetry.core._vendor.pyrsistent._transformations import transform +from pyrsistent._transformations import transform def _is_pclass(bases): diff --git a/poetry/core/_vendor/pyrsistent/_pdeque.py b/poetry/core/_vendor/pyrsistent/_pdeque.py index 8727e435b..5147b3fa6 100644 --- a/poetry/core/_vendor/pyrsistent/_pdeque.py +++ b/poetry/core/_vendor/pyrsistent/_pdeque.py @@ -1,7 +1,7 @@ from ._compat import Sequence, Hashable from itertools import islice, chain from numbers import Integral -from poetry.core._vendor.pyrsistent._plist import plist +from pyrsistent._plist import plist class PDeque(object): diff --git a/poetry/core/_vendor/pyrsistent/_pmap.py b/poetry/core/_vendor/pyrsistent/_pmap.py index 98136b14a..e8a0ec53f 100644 --- a/poetry/core/_vendor/pyrsistent/_pmap.py +++ b/poetry/core/_vendor/pyrsistent/_pmap.py @@ -1,8 +1,8 @@ from ._compat import Mapping, Hashable from itertools import chain -from poetry.core._vendor import six -from poetry.core._vendor.pyrsistent._pvector import pvector -from poetry.core._vendor.pyrsistent._transformations import transform +import six +from pyrsistent._pvector import pvector +from pyrsistent._transformations import transform class PMap(object): diff --git a/poetry/core/_vendor/pyrsistent/_precord.py b/poetry/core/_vendor/pyrsistent/_precord.py index 0ce9240b4..ec8d32c3d 100644 --- a/poetry/core/_vendor/pyrsistent/_precord.py +++ b/poetry/core/_vendor/pyrsistent/_precord.py @@ -1,9 +1,9 @@ -from poetry.core._vendor import six -from poetry.core._vendor.pyrsistent._checked_types import CheckedType, _restore_pickle, InvariantException, store_invariants -from poetry.core._vendor.pyrsistent._field_common import ( +import six +from pyrsistent._checked_types import CheckedType, _restore_pickle, InvariantException, store_invariants +from pyrsistent._field_common import ( set_fields, check_type, is_field_ignore_extra_complaint, PFIELD_NO_INITIAL, serialize, check_global_invariants ) -from poetry.core._vendor.pyrsistent._pmap import PMap, pmap +from pyrsistent._pmap import PMap, pmap class _PRecordMeta(type): diff --git a/poetry/core/_vendor/pyrsistent/_pset.py b/poetry/core/_vendor/pyrsistent/_pset.py index c9d989f69..a972ec533 100644 --- a/poetry/core/_vendor/pyrsistent/_pset.py +++ b/poetry/core/_vendor/pyrsistent/_pset.py @@ -1,6 +1,6 @@ from ._compat import Set, Hashable import sys -from poetry.core._vendor.pyrsistent._pmap import pmap +from pyrsistent._pmap import pmap PY2 = sys.version_info[0] < 3 diff --git a/poetry/core/_vendor/pyrsistent/_pvector.py b/poetry/core/_vendor/pyrsistent/_pvector.py index 35725f2e9..82232782b 100644 --- a/poetry/core/_vendor/pyrsistent/_pvector.py +++ b/poetry/core/_vendor/pyrsistent/_pvector.py @@ -2,8 +2,8 @@ from ._compat import Sequence, Hashable from numbers import Integral import operator -from poetry.core._vendor import six -from poetry.core._vendor.pyrsistent._transformations import transform +import six +from pyrsistent._transformations import transform def _bitcount(val): diff --git a/poetry/core/_vendor/pyrsistent/_toolz.py b/poetry/core/_vendor/pyrsistent/_toolz.py index c0e75353c..6643ee860 100644 --- a/poetry/core/_vendor/pyrsistent/_toolz.py +++ b/poetry/core/_vendor/pyrsistent/_toolz.py @@ -39,7 +39,7 @@ DAMAGE. """ import operator -from poetry.core._vendor.six.moves import reduce +from six.moves import reduce def get_in(keys, coll, default=None, no_default=False): diff --git a/poetry/core/_vendor/pyrsistent/_transformations.py b/poetry/core/_vendor/pyrsistent/_transformations.py index 4b66c0e7b..612098969 100644 --- a/poetry/core/_vendor/pyrsistent/_transformations.py +++ b/poetry/core/_vendor/pyrsistent/_transformations.py @@ -1,5 +1,5 @@ import re -from poetry.core._vendor import six +import six try: from inspect import Parameter, signature except ImportError: @@ -121,7 +121,7 @@ def _get_arity(f): def _update_structure(structure, kvs, path, command): - from poetry.core._vendor.pyrsistent._pmap import pmap + from pyrsistent._pmap import pmap e = structure.evolver() if not path and command is discard: # Do this in reverse to avoid index problems with vectors. See #92. diff --git a/poetry/core/_vendor/pyrsistent/typing.py b/poetry/core/_vendor/pyrsistent/typing.py index 3a4efe0d5..6a86c831b 100644 --- a/poetry/core/_vendor/pyrsistent/typing.py +++ b/poetry/core/_vendor/pyrsistent/typing.py @@ -5,8 +5,8 @@ For example, - from poetry.core._vendor.pyrsistent import pvector - from poetry.core._vendor.pyrsistent.typing import PVector + from pyrsistent import pvector + from pyrsistent.typing import PVector myvector: PVector[str] = pvector(['a', 'b', 'c']) diff --git a/poetry/core/json/__init__.py b/poetry/core/json/__init__.py index e970a1700..83ecab77c 100644 --- a/poetry/core/json/__init__.py +++ b/poetry/core/json/__init__.py @@ -4,7 +4,7 @@ from io import open from typing import List -from poetry.core._vendor.jsonschema import Draft7Validator +from jsonschema import Draft7Validator SCHEMA_DIR = os.path.join(os.path.dirname(__file__), "schemas") diff --git a/poetry/core/masonry/builders/wheel.py b/poetry/core/masonry/builders/wheel.py index e7d11bacb..257ac67f5 100644 --- a/poetry/core/masonry/builders/wheel.py +++ b/poetry/core/masonry/builders/wheel.py @@ -14,8 +14,7 @@ from base64 import urlsafe_b64encode from io import StringIO -from poetry.core._vendor.packaging.tags import sys_tags - +from packaging.tags import sys_tags from poetry.core import __version__ from poetry.core.semver import parse_constraint from poetry.core.utils._compat import decode diff --git a/poetry/core/packages/utils/utils.py b/poetry/core/packages/utils/utils.py index c0fed5388..bbfed85c2 100644 --- a/poetry/core/packages/utils/utils.py +++ b/poetry/core/packages/utils/utils.py @@ -5,10 +5,6 @@ from typing import Union -from poetry.core._vendor.six.moves.urllib.parse import unquote # noqa -from poetry.core._vendor.six.moves.urllib.parse import urlsplit # noqa -from poetry.core._vendor.six.moves.urllib.request import url2pathname # noqa - from poetry.core.packages.constraints.constraint import Constraint from poetry.core.packages.constraints.multi_constraint import MultiConstraint from poetry.core.packages.constraints.union_constraint import UnionConstraint @@ -23,6 +19,9 @@ from poetry.core.version.markers import MarkerUnion from poetry.core.version.markers import MultiMarker from poetry.core.version.markers import SingleMarker +from six.moves.urllib.parse import unquote # noqa +from six.moves.urllib.parse import urlsplit # noqa +from six.moves.urllib.request import url2pathname # noqa BZ2_EXTENSIONS = (".tar.bz2", ".tbz") diff --git a/poetry/core/utils/_compat.py b/poetry/core/utils/_compat.py index 4dfb42e22..2c61c4e55 100644 --- a/poetry/core/utils/_compat.py +++ b/poetry/core/utils/_compat.py @@ -1,6 +1,6 @@ import sys -import poetry.core._vendor.six.moves.urllib.parse as urllib_parse +import six.moves.urllib.parse as urllib_parse urlparse = urllib_parse diff --git a/poetry/core/utils/toml_file.py b/poetry/core/utils/toml_file.py index 5c327e7ed..648defa2a 100644 --- a/poetry/core/utils/toml_file.py +++ b/poetry/core/utils/toml_file.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from typing import Union -from poetry.core._vendor.tomlkit.toml_file import TOMLFile as BaseTOMLFile +from tomlkit.toml_file import TOMLFile as BaseTOMLFile from ._compat import Path diff --git a/poetry/core/version/markers.py b/poetry/core/version/markers.py index 22edf0f4c..1283145c0 100644 --- a/poetry/core/version/markers.py +++ b/poetry/core/version/markers.py @@ -5,14 +5,14 @@ from typing import Iterator from typing import List -from poetry.core._vendor.pyparsing import Forward -from poetry.core._vendor.pyparsing import Group -from poetry.core._vendor.pyparsing import Literal as L # noqa -from poetry.core._vendor.pyparsing import ParseResults -from poetry.core._vendor.pyparsing import QuotedString -from poetry.core._vendor.pyparsing import ZeroOrMore -from poetry.core._vendor.pyparsing import stringEnd -from poetry.core._vendor.pyparsing import stringStart +from pyparsing import Forward +from pyparsing import Group +from pyparsing import Literal as L # noqa +from pyparsing import ParseResults +from pyparsing import QuotedString +from pyparsing import ZeroOrMore +from pyparsing import stringEnd +from pyparsing import stringStart class InvalidMarker(ValueError): diff --git a/poetry/core/version/requirements.py b/poetry/core/version/requirements.py index 8b70b7860..60b8f7546 100644 --- a/poetry/core/version/requirements.py +++ b/poetry/core/version/requirements.py @@ -8,18 +8,17 @@ import re import string -from poetry.core._vendor.pyparsing import Combine -from poetry.core._vendor.pyparsing import Literal as L # noqa -from poetry.core._vendor.pyparsing import Optional -from poetry.core._vendor.pyparsing import ParseException -from poetry.core._vendor.pyparsing import Regex -from poetry.core._vendor.pyparsing import Word -from poetry.core._vendor.pyparsing import ZeroOrMore -from poetry.core._vendor.pyparsing import originalTextFor -from poetry.core._vendor.pyparsing import stringEnd -from poetry.core._vendor.pyparsing import stringStart - from poetry.core.semver import parse_constraint +from pyparsing import Combine +from pyparsing import Literal as L # noqa +from pyparsing import Optional +from pyparsing import ParseException +from pyparsing import Regex +from pyparsing import Word +from pyparsing import ZeroOrMore +from pyparsing import originalTextFor +from pyparsing import stringEnd +from pyparsing import stringStart from .markers import MARKER_EXPR from .markers import parse_marker diff --git a/pyproject.toml b/pyproject.toml index 52e1a7c5b..d02f19a91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,10 @@ classifiers = [ packages = [ {include = "poetry"}, ] +exclude = [ + "**/*.pyc", + "**/*.pyi", +] [tool.poetry.dependencies] python = "~2.7 || ^3.5" @@ -87,7 +91,7 @@ known_third_party = ["poetry.core._vendor"] [tool.vendoring] destination = "poetry/core/_vendor/" requirements = "poetry/core/_vendor/vendor.txt" -namespace = "poetry.core._vendor" +namespace = "" protected-files = ["__init__.py", "README.md", "vendor.txt"] patches-dir = "vendors/patches" diff --git a/vendors/patches/jsonschema.patch b/vendors/patches/jsonschema.patch index f56a4e7b7..423e641d3 100644 --- a/vendors/patches/jsonschema.patch +++ b/vendors/patches/jsonschema.patch @@ -2,7 +2,7 @@ diff --git a/poetry/core/_vendor/jsonschema/__init__.py b/poetry/core/_vendor/js index 7dd3598..c604eed 100644 --- a/poetry/core/_vendor/jsonschema/__init__.py +++ b/poetry/core/_vendor/jsonschema/__init__.py -@@ -27,8 +27,5 @@ from poetry_core._vendor.jsonschema.validators import ( +@@ -27,8 +27,5 @@ from jsonschema.validators import ( RefResolver, validate, ) @@ -24,7 +24,7 @@ index 8fb8593..368474a 100644 +import os import re - from poetry.core._vendor.jsonschema.compat import MutableMapping, str_types, urlsplit + from jsonschema.compat import MutableMapping, str_types, urlsplit @@ -50,9 +50,12 @@ def load_schema(name): """ Load a schema from ./schemas/``name``.json and return it.