Skip to content

Commit

Permalink
rewrite imports
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Nov 11, 2021
1 parent 1122940 commit 2d2a0fa
Show file tree
Hide file tree
Showing 166 changed files with 465 additions and 453 deletions.
2 changes: 1 addition & 1 deletion pipenv/patched/notpip/_internal/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ def is_wheel_installed():
Return whether the wheel package is installed.
"""
try:
import wheel # noqa: F401
import pipenv.vendor.wheel as wheel # noqa: F401
except ImportError:
return False

Expand Down
4 changes: 2 additions & 2 deletions pipenv/patched/notpip/_vendor/pep517/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def read_json(path):


if sys.version_info < (3, 6):
from toml import load as toml_load # noqa: F401
from toml import TomlDecodeError as TOMLDecodeError # noqa: F401
from pipenv.vendor.toml import load as toml_load # noqa: F401
from pipenv.vendor.toml import TomlDecodeError as TOMLDecodeError # noqa: F401
else:
from pipenv.patched.notpip._vendor.tomli import load as toml_load # noqa: F401
from pipenv.patched.notpip._vendor.tomli import TOMLDecodeError # noqa: F401
4 changes: 2 additions & 2 deletions pipenv/patched/notpip/_vendor/pep517/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
try:
import importlib.metadata as imp_meta
except ImportError:
import importlib_metadata as imp_meta
import pipenv.vendor.importlib_metadata as imp_meta

try:
from zipfile import Path
except ImportError:
from zipp import Path
from pipenv.vendor.zipp import Path

from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller, quiet_subprocess_runner
Expand Down
4 changes: 2 additions & 2 deletions pipenv/patched/pipfile/api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import toml
import pipenv.vendor.toml as toml

import codecs
import json
import hashlib
import platform
import six
import pipenv.vendor.six as six
import sys
import os

Expand Down
2 changes: 1 addition & 1 deletion pipenv/patched/safety/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ def insert_pipenv_dirs():
yaml_lib = "pipenv.patched.yaml{0}".format(sys.version_info[0])
locals()[yaml_lib] = __import__(yaml_lib)
sys.modules["yaml"] = sys.modules[yaml_lib]
from safety.cli import cli
from pipenv.patched.safety.cli import cli
cli(prog_name="safety")
12 changes: 6 additions & 6 deletions pipenv/patched/safety/cli.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import click
from safety import __version__
from safety import safety
from safety.formatter import report, license_report
import pipenv.vendor.click as click
from pipenv.patched.safety import __version__
from pipenv.patched.safety import safety
from pipenv.patched.safety.formatter import report, license_report
import itertools
from safety.util import read_requirements, read_vulnerabilities, get_proxy_dict, get_packages_licenses
from safety.errors import DatabaseFetchError, DatabaseFileNotFoundError, InvalidKeyError, TooManyRequestsError
from pipenv.patched.safety.util import read_requirements, read_vulnerabilities, get_proxy_dict, get_packages_licenses
from pipenv.patched.safety.errors import DatabaseFetchError, DatabaseFileNotFoundError, InvalidKeyError, TooManyRequestsError

try:
from json.decoder import JSONDecodeError
Expand Down
4 changes: 2 additions & 2 deletions pipenv/patched/safety/safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import time
from collections import namedtuple

import requests
from packaging.specifiers import SpecifierSet
import pipenv.vendor.requests as requests
from pipenv.vendor.packaging.specifiers import SpecifierSet

from .constants import (API_MIRRORS, CACHE_FILE, CACHE_LICENSES_VALID_SECONDS,
CACHE_VALID_SECONDS, OPEN_MIRRORS, REQUEST_TIMEOUT)
Expand Down
6 changes: 3 additions & 3 deletions pipenv/patched/safety/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dparse.parser import setuptools_parse_requirements_backport as _parse_requirements
from pipenv.vendor.dparse.parser import setuptools_parse_requirements_backport as _parse_requirements
from collections import namedtuple
from packaging.version import parse as parse_version
import click
from pipenv.vendor.packaging.version import parse as parse_version
import pipenv.vendor.click as click
import sys
import json
import os
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/attr/_next_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from functools import partial

from attr.exceptions import UnannotatedAttributeError
from pipenv.vendor.attr.exceptions import UnannotatedAttributeError

from . import setters
from ._make import NOTHING, _frozen_setattrs, attrib, attrs
Expand Down
6 changes: 3 additions & 3 deletions pipenv/vendor/cerberus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

from pkg_resources import get_distribution, DistributionNotFound

from cerberus.validator import DocumentError, Validator
from cerberus.schema import rules_set_registry, schema_registry, SchemaError
from cerberus.utils import TypeDefinition
from pipenv.vendor.cerberus.validator import DocumentError, Validator
from pipenv.vendor.cerberus.schema import rules_set_registry, schema_registry, SchemaError
from pipenv.vendor.cerberus.utils import TypeDefinition


try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

from pytest import mark

from cerberus import rules_set_registry, schema_registry, TypeDefinition, Validator
from cerberus.benchmarks import DOCUMENTS_PATH
from pipenv.vendor.cerberus import rules_set_registry, schema_registry, TypeDefinition, Validator
from pipenv.vendor.cerberus.benchmarks import DOCUMENTS_PATH


rules_set_registry.add("path_rules", {"coerce": Path, "type": "path"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from pytest import mark

from cerberus import Validator
from cerberus.benchmarks.schemas.overalll_schema_2 import product_schema
from cerberus.benchmarks import DOCUMENTS_PATH
from pipenv.vendor.cerberus import Validator
from pipenv.vendor.cerberus.benchmarks.schemas.overalll_schema_2 import product_schema
from pipenv.vendor.cerberus.benchmarks import DOCUMENTS_PATH


def init_validator():
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/cerberus/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from functools import wraps
from pprint import pformat

from cerberus.platform import PYTHON_VERSION, MutableMapping
from cerberus.utils import compare_paths_lt, quote_string
from pipenv.vendor.cerberus.platform import PYTHON_VERSION, MutableMapping
from pipenv.vendor.cerberus.utils import compare_paths_lt, quote_string


ErrorDefinition = namedtuple('ErrorDefinition', 'code, rule')
Expand Down
6 changes: 3 additions & 3 deletions pipenv/vendor/cerberus/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

from warnings import warn

from cerberus import errors
from cerberus.platform import (
from pipenv.vendor.cerberus import errors
from pipenv.vendor.cerberus.platform import (
_str_type,
Callable,
Hashable,
Mapping,
MutableMapping,
Sequence,
)
from cerberus.utils import (
from pipenv.vendor.cerberus.utils import (
get_Validator_class,
validator_factory,
mapping_hash,
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/cerberus/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import pytest

from cerberus import errors, Validator, SchemaError, DocumentError
from cerberus.tests.conftest import sample_schema
from pipenv.vendor.cerberus import errors, Validator, SchemaError, DocumentError
from pipenv.vendor.cerberus.tests.conftest import sample_schema


def assert_exception(exception, document={}, schema=None, validator=None, msg=None):
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/cerberus/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from cerberus import Validator
from pipenv.vendor.cerberus import Validator


@pytest.fixture
Expand Down
10 changes: 5 additions & 5 deletions pipenv/vendor/cerberus/tests/test_assorted.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

from pytest import mark

from cerberus import TypeDefinition, Validator
from cerberus.tests import assert_fail, assert_success
from cerberus.utils import validator_factory
from cerberus.validator import BareValidator
from cerberus.platform import PYTHON_VERSION
from pipenv.vendor.cerberus import TypeDefinition, Validator
from pipenv.vendor.cerberus.tests import assert_fail, assert_success
from pipenv.vendor.cerberus.utils import validator_factory
from pipenv.vendor.cerberus.validator import BareValidator
from pipenv.vendor.cerberus.platform import PYTHON_VERSION


if PYTHON_VERSION > 3 and PYTHON_VERSION < 3.4:
Expand Down
6 changes: 3 additions & 3 deletions pipenv/vendor/cerberus/tests/test_customization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from pytest import mark

import cerberus
from cerberus.tests import assert_fail, assert_success
from cerberus.tests.conftest import sample_schema
import pipenv.vendor.cerberus as cerberus
from pipenv.vendor.cerberus.tests import assert_fail, assert_success
from pipenv.vendor.cerberus.tests.conftest import sample_schema


def test_contextual_data_preservation():
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/cerberus/tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from cerberus import Validator, errors
from cerberus.tests import assert_fail
from pipenv.vendor.cerberus import Validator, errors
from pipenv.vendor.cerberus.tests import assert_fail


ValidationError = errors.ValidationError
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/cerberus/tests/test_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from pytest import mark

from cerberus import Validator, errors
from cerberus.tests import (
from pipenv.vendor.cerberus import Validator, errors
from pipenv.vendor.cerberus.tests import (
assert_fail,
assert_has_error,
assert_normalized,
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/cerberus/tests/test_registries.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from cerberus import schema_registry, rules_set_registry, Validator
from cerberus.tests import (
from pipenv.vendor.cerberus import schema_registry, rules_set_registry, Validator
from pipenv.vendor.cerberus.tests import (
assert_fail,
assert_normalized,
assert_schema_error,
Expand Down
6 changes: 3 additions & 3 deletions pipenv/vendor/cerberus/tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest

from cerberus import Validator, errors, SchemaError
from cerberus.schema import UnvalidatedSchema
from cerberus.tests import assert_schema_error
from pipenv.vendor.cerberus import Validator, errors, SchemaError
from pipenv.vendor.cerberus.schema import UnvalidatedSchema
from pipenv.vendor.cerberus.tests import assert_schema_error


def test_empty_schema():
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/cerberus/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cerberus.utils import compare_paths_lt
from pipenv.vendor.cerberus.utils import compare_paths_lt


def test_compare_paths():
Expand Down
6 changes: 3 additions & 3 deletions pipenv/vendor/cerberus/tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

from pytest import mark

from cerberus import errors, Validator
from cerberus.tests import (
from pipenv.vendor.cerberus import errors, Validator
from pipenv.vendor.cerberus.tests import (
assert_bad_type,
assert_document_error,
assert_fail,
assert_has_error,
assert_not_has_error,
assert_success,
)
from cerberus.tests.conftest import sample_schema
from pipenv.vendor.cerberus.tests.conftest import sample_schema


def test_empty_document():
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/cerberus/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections import namedtuple

from cerberus.platform import _int_types, _str_type, Mapping, Sequence, Set
from pipenv.vendor.cerberus.platform import _int_types, _str_type, Mapping, Sequence, Set


TypeDefinition = namedtuple('TypeDefinition', 'name,included_types,excluded_types')
Expand Down Expand Up @@ -50,7 +50,7 @@ def drop_item_from_tuple(t, i):
def get_Validator_class():
global Validator
if 'Validator' not in globals():
from cerberus.validator import Validator
from pipenv.vendor.cerberus.validator import Validator
return Validator


Expand Down
8 changes: 4 additions & 4 deletions pipenv/vendor/cerberus/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import re
from warnings import warn

from cerberus import errors
from cerberus.platform import (
from pipenv.vendor.cerberus import errors
from pipenv.vendor.cerberus.platform import (
_int_types,
_str_type,
Container,
Expand All @@ -27,13 +27,13 @@
Sequence,
Sized,
)
from cerberus.schema import (
from pipenv.vendor.cerberus.schema import (
schema_registry,
rules_set_registry,
DefinitionSchema,
SchemaError,
)
from cerberus.utils import drop_item_from_tuple, readonly_classproperty, TypeDefinition
from pipenv.vendor.cerberus.utils import drop_item_from_tuple, readonly_classproperty, TypeDefinition

toy_error_handler = errors.ToyErrorHandler()

Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/certifi/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse

from certifi import contents, where
from pipenv.vendor.certifi import contents, where

parser = argparse.ArgumentParser()
parser.add_argument("-c", "--contents", action="store_true")
Expand Down
6 changes: 3 additions & 3 deletions pipenv/vendor/chardet/cli/chardetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import argparse
import sys

from chardet import __version__
from chardet.compat import PY2
from chardet.universaldetector import UniversalDetector
from pipenv.vendor.chardet import __version__
from pipenv.vendor.chardet.compat import PY2
from pipenv.vendor.chardet.universaldetector import UniversalDetector


def description_of(lines, name='stdin'):
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/chardet/langbulgarianmodel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from chardet.sbcharsetprober import SingleByteCharSetModel
from pipenv.vendor.chardet.sbcharsetprober import SingleByteCharSetModel


# 3: Positive
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/chardet/langgreekmodel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from chardet.sbcharsetprober import SingleByteCharSetModel
from pipenv.vendor.chardet.sbcharsetprober import SingleByteCharSetModel


# 3: Positive
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/chardet/langhebrewmodel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from chardet.sbcharsetprober import SingleByteCharSetModel
from pipenv.vendor.chardet.sbcharsetprober import SingleByteCharSetModel


# 3: Positive
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/chardet/langhungarianmodel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from chardet.sbcharsetprober import SingleByteCharSetModel
from pipenv.vendor.chardet.sbcharsetprober import SingleByteCharSetModel


# 3: Positive
Expand Down
Loading

0 comments on commit 2d2a0fa

Please sign in to comment.