Skip to content

Commit

Permalink
prepend vendor package site into path
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Apr 23, 2020
1 parent f1f984a commit 8a7b5fb
Show file tree
Hide file tree
Showing 45 changed files with 158 additions and 124 deletions.
14 changes: 14 additions & 0 deletions poetry/core/__init__.py
Original file line number Diff line number Diff line change
@@ -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__)
Empty file removed poetry/core/_vendor/__init__.py
Empty file.
19 changes: 19 additions & 0 deletions poetry/core/_vendor/jsonschema/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 4 additions & 4 deletions poetry/core/_vendor/jsonschema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion poetry/core/_vendor/jsonschema/__main__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from poetry.core._vendor.jsonschema.cli import main
from jsonschema.cli import main
main()
4 changes: 2 additions & 2 deletions poetry/core/_vendor/jsonschema/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions poetry/core/_vendor/jsonschema/_legacy_validators.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion poetry/core/_vendor/jsonschema/_reflect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import sys

from poetry.core._vendor.jsonschema.compat import PY3
from jsonschema.compat import PY3


class _NoModuleFound(Exception):
Expand Down
8 changes: 4 additions & 4 deletions poetry/core/_vendor/jsonschema/_types.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion poetry/core/_vendor/jsonschema/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions poetry/core/_vendor/jsonschema/_validators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

from poetry.core._vendor.jsonschema._utils import (
from jsonschema._utils import (
ensure_list,
equal,
extras_msg,
Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions poetry/core/_vendor/jsonschema/benchmarks/issue232.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
6 changes: 3 additions & 3 deletions poetry/core/_vendor/jsonschema/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions poetry/core/_vendor/jsonschema/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
8 changes: 4 additions & 4 deletions poetry/core/_vendor/jsonschema/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion poetry/core/_vendor/packaging/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
Expand Down
6 changes: 3 additions & 3 deletions poetry/core/_vendor/packaging/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions poetry/core/_vendor/packaging/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions poetry/core/_vendor/pyparsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
(the :class:`'+'<ParserElement.__add__>` 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) + "!"
Expand Down Expand Up @@ -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:
Expand Down
28 changes: 14 additions & 14 deletions poetry/core/_vendor/pyrsistent/__init__.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
10 changes: 5 additions & 5 deletions poetry/core/_vendor/pyrsistent/_checked_types.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion poetry/core/_vendor/pyrsistent/_compat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from poetry.core._vendor.six import string_types
from six import string_types


# enum compat
Expand Down
8 changes: 4 additions & 4 deletions poetry/core/_vendor/pyrsistent/_field_common.py
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions poetry/core/_vendor/pyrsistent/_helpers.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion poetry/core/_vendor/pyrsistent/_immutable.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

from poetry.core._vendor import six
import six


def immutable(members='', name='Immutable', verbose=False):
Expand Down
2 changes: 1 addition & 1 deletion poetry/core/_vendor/pyrsistent/_pbag.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
Loading

0 comments on commit 8a7b5fb

Please sign in to comment.