From f28c217b72d57f0a6f2d49c0b958d9cd75387f62 Mon Sep 17 00:00:00 2001 From: Christopher Cave-Ayland Date: Tue, 3 Dec 2019 22:00:28 +0000 Subject: [PATCH] Fixed linting problems --- docs/docs/repositories.md | 6 +++--- poetry/installation/pip_installer.py | 1 - poetry/repositories/find_links_repository.py | 19 ++++++++++--------- tests/installation/test_pip_installer.py | 2 +- .../test_find_links_repository.py | 13 +++++++------ 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/docs/docs/repositories.md b/docs/docs/repositories.md index 878c7b3467b..4a612c29a6d 100644 --- a/docs/docs/repositories.md +++ b/docs/docs/repositories.md @@ -121,10 +121,10 @@ a custom certificate authority or client certificates, similarly refer to the ex `certificates` section. Poetry will use these values to authenticate to your private repository when downloading or looking for packages. -### Non-Pep 503 Repositories +### Non-Pep 503 Repositories A private repository may not follow the structure described in Pep 503. In this case you -can use the `find_links` keyword. The below provides the equivalent behaviour to `pip +can use the `find_links` keyword. The below provides the equivalent behaviour to `pip install --find-links https://foo.bar/index.html`. @@ -136,7 +136,7 @@ find_links = true ``` If `find_links` is used the url may return a html page containing links to python -archives, or may point directly to an installable artifact e.g. +archives, or may point directly to an installable artifact e.g. https://foo.bar/poetry-0.1.0-py3-none-any.whl. The use of `find_links` with local paths or file:// urls is not yet supported. diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index 6bd4756dd7e..edb5f3910f7 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -50,7 +50,6 @@ def install(self, package, update=False): ) args += ["--trusted-host", parsed.hostname] - if repository.cert: args += ["--cert", str(repository.cert)] diff --git a/poetry/repositories/find_links_repository.py b/poetry/repositories/find_links_repository.py index aa84e2bc066..fb51895b2f4 100644 --- a/poetry/repositories/find_links_repository.py +++ b/poetry/repositories/find_links_repository.py @@ -1,5 +1,15 @@ import re +from typing import Generator +from typing import Tuple +from typing import Union + +from poetry.packages.utils.link import Link + +from .legacy_repository import LegacyRepository +from .legacy_repository import Page + + try: import urllib.parse as urlparse except ImportError: @@ -15,15 +25,6 @@ unescape = HTMLParser().unescape -from typing import Generator -from typing import Tuple -from typing import Union - - -from poetry.packages.utils.link import Link - -from .legacy_repository import LegacyRepository, Page - def parse_url(url): # type: (str) -> Tuple[str, str] """Parse an url returning the base url for the repository and diff --git a/tests/installation/test_pip_installer.py b/tests/installation/test_pip_installer.py index f836d1f081b..d7c6ab6555e 100644 --- a/tests/installation/test_pip_installer.py +++ b/tests/installation/test_pip_installer.py @@ -3,8 +3,8 @@ from poetry.installation.pip_installer import PipInstaller from poetry.io.null_io import NullIO from poetry.packages.package import Package -from poetry.repositories.legacy_repository import LegacyRepository from poetry.repositories.find_links_repository import FindLinksRepository +from poetry.repositories.legacy_repository import LegacyRepository from poetry.repositories.pool import Pool from poetry.utils._compat import Path from poetry.utils.env import NullEnv diff --git a/tests/repositories/test_find_links_repository.py b/tests/repositories/test_find_links_repository.py index 638cc8dc424..0ffcdcf41eb 100644 --- a/tests/repositories/test_find_links_repository.py +++ b/tests/repositories/test_find_links_repository.py @@ -1,19 +1,20 @@ import shutil -try: - import urllib.parse as urlparse -except ImportError: - import urlparse - from poetry.packages.utils.link import Link -from poetry.repositories.find_links_repository import FindLinksRepository from poetry.repositories.find_links_repository import FilteredPage +from poetry.repositories.find_links_repository import FindLinksRepository from poetry.repositories.find_links_repository import SingleLink from poetry.utils._compat import Path from .test_legacy_repository import MockRepository as LegacyMockRepository +try: + import urllib.parse as urlparse +except ImportError: + import urlparse + + TEST_PACKAGES = ["isort", "futures"]