Skip to content

Commit

Permalink
Use a namespaced package (poetry.core) instead of poetry-core
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed Mar 27, 2020
1 parent eb228f8 commit 3ccd963
Show file tree
Hide file tree
Showing 263 changed files with 403 additions and 3,574 deletions.
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ repos:
rev: stable
hooks:
- id: black
exclude: ^poetry_core/_vendor
exclude: ^poetry/core/_vendor

- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
hooks:
- id: flake8
exclude: |
(?x)(
^poetry_core/utils/_typing.py$
| ^poetry_core/utils/_compat.py$
| ^poetry_core/_vendor
^poetry/core/utils/_typing.py$
| ^poetry/core/utils/_compat.py$
| ^poetry/core/_vendor
)
- repo: https://github.com/pre-commit/mirrors-isort
Expand All @@ -24,7 +24,7 @@ repos:
exclude: |
(?x)(
^.*/?setup\.py$
| ^poetry_core/_vendor
| ^poetry/core/_vendor
)
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -34,13 +34,13 @@ repos:
exclude: |
(?x)(
^tests/.*/fixtures/.*
| ^poetry_core/_vendor
| ^poetry/core/_vendor
)
- id: end-of-file-fixer
exclude: |
(?x)(
^tests/.*/fixtures/.*
| ^poetry_core/_vendor
| ^poetry/core/_vendor
)
- id: debug-statements
exclude: ^poetry_core/_vendor
exclude: ^poetry/core/_vendor
4 changes: 4 additions & 0 deletions poetry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from pkgutil import extend_path


__path__ = extend_path(__path__, __name__)
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions poetry/core/_vendor/_pyrsistent_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.16.0'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@
import sys
import warnings

from poetry_core._vendor.backports.configparser.helpers import OrderedDict as _default_dict
from poetry_core._vendor.backports.configparser.helpers import ChainMap as _ChainMap
from poetry_core._vendor.backports.configparser.helpers import from_none, open, str, PY2
from poetry_core._vendor.backports.configparser.helpers import PathLike, fspath
from poetry_core._vendor.backports.configparser.helpers import MutableMapping
from poetry.core._vendor.backports.configparser.helpers import OrderedDict as _default_dict
from poetry.core._vendor.backports.configparser.helpers import ChainMap as _ChainMap
from poetry.core._vendor.backports.configparser.helpers import from_none, open, str, PY2
from poetry.core._vendor.backports.configparser.helpers import PathLike, fspath
from poetry.core._vendor.backports.configparser.helpers import MutableMapping

__all__ = [
"NoSectionError",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from __future__ import print_function
from __future__ import unicode_literals

from poetry_core._vendor.backports.configparser import (
from poetry.core._vendor.backports.configparser import (
RawConfigParser,
ConfigParser,
SafeConfigParser,
Expand All @@ -32,7 +32,7 @@
MAX_INTERPOLATION_DEPTH,
)

from poetry_core._vendor.backports.configparser import Error, _UNSET, _default_dict, _ChainMap # noqa: F401
from poetry.core._vendor.backports.configparser import Error, _UNSET, _default_dict, _ChainMap # noqa: F401

__all__ = [
"NoSectionError",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import abc
import csv
import sys
from poetry_core._vendor import zipp
from poetry.core._vendor import zipp
import operator
import functools
import itertools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

if sys.version_info > (3,): # pragma: nocover
import builtins
from poetry_core._vendor.configparser import ConfigParser
from poetry.core._vendor.configparser import ConfigParser
from contextlib import suppress
FileNotFoundError = builtins.FileNotFoundError
IsADirectoryError = builtins.IsADirectoryError
NotADirectoryError = builtins.NotADirectoryError
PermissionError = builtins.PermissionError
map = builtins.map
else: # pragma: nocover
from poetry_core._vendor.backports.configparser import ConfigParser
from poetry.core._vendor.backports.configparser import ConfigParser
from itertools import imap as map # type: ignore
from poetry_core._vendor.contextlib2 import suppress # noqa
from poetry.core._vendor.contextlib2 import suppress # noqa
FileNotFoundError = IOError, OSError
IsADirectoryError = IOError, OSError
NotADirectoryError = IOError, OSError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
try:
from contextlib import ExitStack
except ImportError:
from poetry_core._vendor.contextlib2 import ExitStack
from poetry.core._vendor.contextlib2 import ExitStack

try:
import pathlib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import textwrap
import unittest
import importlib
from poetry_core._vendor import importlib_metadata
from poetry.core._vendor import importlib_metadata

from . import fixtures
from .. import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
try:
from contextlib import ExitStack
except ImportError:
from poetry_core._vendor.contextlib2 import ExitStack
from poetry.core._vendor.contextlib2 import ExitStack


class TestZip(unittest.TestCase):
Expand Down
File renamed without changes.
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 poetry.core._vendor.jsonschema.exceptions import (
ErrorTree, FormatError, RefResolutionError, SchemaError, ValidationError
)
from poetry_core._vendor.jsonschema._format import (
from poetry.core._vendor.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 poetry.core._vendor.jsonschema._types import TypeChecker
from poetry.core._vendor.jsonschema.validators import (
Draft3Validator,
Draft4Validator,
Draft6Validator,
Expand Down
2 changes: 2 additions & 0 deletions poetry/core/_vendor/jsonschema/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from poetry.core._vendor.jsonschema.cli import main
main()
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 poetry.core._vendor.jsonschema.compat import str_types
from poetry.core._vendor.jsonschema.exceptions import FormatError


class FormatChecker(object):
Expand Down
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 poetry.core._vendor.jsonschema import _utils
from poetry.core._vendor.jsonschema.compat import iteritems
from poetry.core._vendor.jsonschema.exceptions import ValidationError


def dependencies_draft3(validator, dependencies, instance, schema):
Expand Down
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 poetry.core._vendor.jsonschema.compat import PY3


class _NoModuleFound(Exception):
Expand Down
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 poetry.core._vendor.pyrsistent import pmap
from poetry.core._vendor import attr

from poetry_core._vendor.jsonschema.compat import int_types, str_types
from poetry_core._vendor.jsonschema.exceptions import UndefinedTypeCheck
from poetry.core._vendor.jsonschema.compat import int_types, str_types
from poetry.core._vendor.jsonschema.exceptions import UndefinedTypeCheck


def is_array(checker, instance):
Expand Down
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 poetry.core._vendor.jsonschema.compat import MutableMapping, str_types, urlsplit


class URIDict(MutableMapping):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

from poetry_core._vendor.jsonschema._utils import (
from poetry.core._vendor.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 poetry.core._vendor.jsonschema.exceptions import FormatError, ValidationError
from poetry.core._vendor.jsonschema.compat import iteritems


def patternProperties(validator, patternProperties, instance, schema):
Expand Down
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 poetry.core._vendor.pyrsistent import m

from poetry_core._vendor.jsonschema.tests._suite import Version
from poetry_core._vendor import jsonschema
from poetry.core._vendor.jsonschema.tests._suite import Version
from poetry.core._vendor 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 poetry.core._vendor.jsonschema.tests._suite import Suite


if __name__ == "__main__":
Expand Down
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 poetry.core._vendor.jsonschema import __version__
from poetry.core._vendor.jsonschema._reflect import namedAny
from poetry.core._vendor.jsonschema.validators import validator_for


def _namedAnyWithDefault(name):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def urlopen(*args, **kwargs):
int_types = int, long
iteritems = operator.methodcaller("iteritems")

from poetry_core._vendor.functools32 import lru_cache
from poetry.core._vendor.functools32 import lru_cache


def urldefrag(url):
Expand Down
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
from poetry.core._vendor import attr

from poetry_core._vendor.jsonschema import _utils
from poetry_core._vendor.jsonschema.compat import PY3, iteritems
from poetry.core._vendor.jsonschema import _utils
from poetry.core._vendor.jsonschema.compat import PY3, iteritems


WEAK_MATCHES = frozenset(["anyOf", "oneOf"])
Expand Down
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 poetry.core._vendor.six import add_metaclass

from poetry_core._vendor.jsonschema import (
from poetry.core._vendor.jsonschema import (
_legacy_validators,
_types,
_utils,
_validators,
exceptions,
)
from poetry_core._vendor.jsonschema.compat import (
from poetry.core._vendor.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 poetry.core._vendor.jsonschema.exceptions import ErrorTree
ErrorTree


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 poetry.core._vendor.packaging._typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import ...
Expand Down
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 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 ._compat import string_types
from ._typing import MYPY_CHECK_RUNNING
Expand Down
File renamed without changes.
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 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 ._typing import MYPY_CHECK_RUNNING
from .markers import MARKER_EXPR, Marker
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import posixpath
import re
from poetry_core._vendor import six
from poetry.core._vendor import six
import sys

from errno import EINVAL, ENOENT, ENOTDIR, EBADF
Expand Down Expand Up @@ -49,7 +49,7 @@
try:
from os import scandir as os_scandir
except ImportError:
from poetry_core._vendor.scandir import scandir as os_scandir
from poetry.core._vendor.scandir import scandir as os_scandir

__all__ = [
"PurePath", "PurePosixPath", "PureWindowsPath",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
of the package.
"""
try:
from poetry_core._vendor.configparser import ConfigParser
from poetry.core._vendor.configparser import ConfigParser
except ImportError: # pragma: NO COVER
from ConfigParser import ConfigParser
from collections import OrderedDict
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

2 comments on commit 3ccd963

@ClementWalter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious to learn more about this strategy and their benefit. What is the purpose of doing so?

@abn
Copy link
Member

@abn abn commented on 3ccd963 Apr 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ClementWalter this might not be the best place to comment on this; especially since this commit was made around a year ago. Perhaps raise a discussion?

Please sign in to comment.