From 2f26aa9f46290a77739b825acec2758e85302118 Mon Sep 17 00:00:00 2001 From: iamkroot Date: Mon, 14 Jun 2021 10:54:53 +0530 Subject: [PATCH] Fix poetry install failing for urlmatch This error is happening because poetry cannot identify legacy versions in sdist names, and it tries to install a macos-specific package that doesn't contain a setup.py or setup.cfg file. The workaround is to blacklist the macos package file by corrupting its hash value in the lock file, so poetry will be forced to install from the other file. Needs poetry v1.2 or higher to actually respect the missing hash. Lower versions simply ignore hash mismatch, and install the package anyway. --- poetry.lock | 14 +++++++++++++- pyproject.toml | 1 - 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 90f17f1..ec2f793 100644 --- a/poetry.lock +++ b/poetry.lock @@ -226,6 +226,14 @@ brotli = ["brotlipy (>=0.6.0)"] secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +[[package]] +name = "urlmatch" +version = "1.0.1" +description = "Python library for matching URLs." +category = "main" +optional = false +python-versions = "*" + [[package]] name = "win10toast" version = "0.9" @@ -243,7 +251,7 @@ socks = ["pysocks"] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "040067a857dc2a43cf95e87f27fde4583b4b7c48c846db17830fdd0ef78ab6f6" +content-hash = "6bc8dbba75361a0dd85a4f66b9ad2acbef701dd92b26d0561f3d86ff8f0a8dfb" [metadata.files] appdirs = [ @@ -369,6 +377,10 @@ urllib3 = [ {file = "urllib3-1.26.5-py2.py3-none-any.whl", hash = "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c"}, {file = "urllib3-1.26.5.tar.gz", hash = "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098"}, ] +urlmatch = [ + {file = "urlmatch-1.0.1.macosx-10.12-x86_64.tar.gz", hash = "NOT_ALLOWED"}, + {file = "urlmatch-1.0.1.tar.gz", hash = "sha256:3f0c3529f03f3b31efc4547ce44e6512ff5714bf61f7f6ac355b1636ad16eb2d"}, +] win10toast = [ {file = "win10toast-0.9-py2.py3-none-any.whl", hash = "sha256:44e5afa1001de88a0ee533872231521fa67c7d144f39974089af242d9c4620a4"}, ] diff --git a/pyproject.toml b/pyproject.toml index 89f0966..79c50ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,6 @@ cleo = "^0.8.1" confuse = "^1.4.0" pysocks = {version = "^1.7.1", optional = true} jeepney = {version = "^0.6", platform = "linux"} - urlmatch = "^1.0.1" [tool.poetry.dev-dependencies]