From c19f2bb678efe6bf14425a76d7f7746b83e2681b Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 24 Apr 2023 17:31:10 +0000 Subject: [PATCH 1/6] Unpin packaging --- requirements/deploy.in | 2 -- requirements/docs/dev.in | 2 -- requirements/main.in | 2 -- requirements/tests.in | 2 -- 4 files changed, 8 deletions(-) diff --git a/requirements/deploy.in b/requirements/deploy.in index 2bef7ac19733..d0775bc572b0 100644 --- a/requirements/deploy.in +++ b/requirements/deploy.in @@ -1,4 +1,2 @@ gunicorn==20.1.0 ddtrace==1.10.2 -# Until resolved https://github.com/googleapis/python-bigquery/issues/1435 -packaging<22.0 diff --git a/requirements/docs/dev.in b/requirements/docs/dev.in index 38dec771e33b..11a449425456 100644 --- a/requirements/docs/dev.in +++ b/requirements/docs/dev.in @@ -2,5 +2,3 @@ furo Sphinx sphinxcontrib-httpdomain myst-parser -# Until resolved https://github.com/googleapis/python-bigquery/issues/1435 -packaging<22.0 diff --git a/requirements/main.in b/requirements/main.in index 369ab4dd165f..e87c8de9b511 100644 --- a/requirements/main.in +++ b/requirements/main.in @@ -72,5 +72,3 @@ WTForms[email]>=2.0.0 yara-python zope.sqlalchemy zxcvbn -# Until resolved https://github.com/googleapis/python-bigquery/issues/1435 -packaging<22.0 diff --git a/requirements/tests.in b/requirements/tests.in index 8df94bcd0f49..3e0284fdf45b 100644 --- a/requirements/tests.in +++ b/requirements/tests.in @@ -7,5 +7,3 @@ pytest-postgresql>=3.1.3,<4.0.0 pytest-socket responses>=0.5.1 webtest -# Until resolved https://github.com/googleapis/python-bigquery/issues/1435 -packaging<22.0 From ce471d32ca6d1fc408a441c1c99942a1612d0839 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 24 Apr 2023 17:37:02 +0000 Subject: [PATCH 2/6] Update to packaging==23.1 --- requirements/deploy.txt | 14 ++++---------- requirements/docs/dev.txt | 14 ++++---------- requirements/main.txt | 10 +++------- requirements/tests.txt | 14 ++++---------- 4 files changed, 15 insertions(+), 37 deletions(-) diff --git a/requirements/deploy.txt b/requirements/deploy.txt index 659f9ae3508d..e0cea987a707 100644 --- a/requirements/deploy.txt +++ b/requirements/deploy.txt @@ -106,12 +106,10 @@ jsonschema==4.17.3 \ --hash=sha256:0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d \ --hash=sha256:a870ad254da1a8ca84b6a2905cac29d265f805acc57af304784962a2aa6508f6 # via ddtrace -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements/deploy.in - # ddtrace +packaging==23.1 \ + --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ + --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f + # via ddtrace protobuf==4.22.3 \ --hash=sha256:13233ee2b9d3bd9a5f216c1fa2c321cd564b93d8f2e4f521a85b585447747997 \ --hash=sha256:23452f2fdea754a8251d0fc88c0317735ae47217e0d27bf330a30eec2848811a \ @@ -129,10 +127,6 @@ protobuf==4.22.3 \ # via # ddsketch # ddtrace -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging pyrsistent==0.19.3 \ --hash=sha256:016ad1afadf318eb7911baa24b049909f7f3bb2c5b1ed7b6a8f21db21ea3faa8 \ --hash=sha256:1a2994773706bbb4995c31a97bc94f1418314923bd1048c6d964837040376440 \ diff --git a/requirements/docs/dev.txt b/requirements/docs/dev.txt index 987fbe3a156f..239f2e569594 100644 --- a/requirements/docs/dev.txt +++ b/requirements/docs/dev.txt @@ -204,22 +204,16 @@ myst-parser==0.19.1 \ --hash=sha256:356b38aef29ed09144285ad222e5c3cb7a8e7fae8015d53dba40dbb8b9f73e2c \ --hash=sha256:f2dc168ed380e01d77973ad22a64fff1377cc72a3d1ac4bced423f28258d0a42 # via -r requirements/docs/dev.in -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements/docs/dev.in - # sphinx +packaging==23.1 \ + --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ + --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f + # via sphinx pygments==2.14.0 \ --hash=sha256:b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297 \ --hash=sha256:fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717 # via # furo # sphinx -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging pyyaml==6.0 \ --hash=sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf \ --hash=sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293 \ diff --git a/requirements/main.txt b/requirements/main.txt index b7746112d3bb..552edffaeb43 100644 --- a/requirements/main.txt +++ b/requirements/main.txt @@ -1122,9 +1122,9 @@ orjson==3.8.10 \ --hash=sha256:f7e85d4682f3ed7321d36846cad0503e944ea9579ef435d4c162e1b73ead8ac9 \ --hash=sha256:faee89e885796a9cc493c930013fa5cfcec9bfaee431ddf00f0fbfb57166a8b3 # via -r requirements/main.in -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 +packaging==23.1 \ + --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ + --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f # via # -r requirements/main.in # google-cloud-bigquery @@ -1294,10 +1294,6 @@ pyopenssl==23.1.1 \ --hash=sha256:841498b9bec61623b1b6c47ebbc02367c07d60e0e195f19790817f10cc8db0b7 \ --hash=sha256:9e0c526404a210df9d2b18cd33364beadb0dc858a739b885677bc65e105d4a4c # via webauthn -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging pyqrcode==1.2.1 \ --hash=sha256:1b2812775fa6ff5c527977c4cd2ccb07051ca7d0bc0aecf937a43864abe5eff6 \ --hash=sha256:fdbf7634733e56b72e27f9bce46e4550b75a3a2c420414035cae9d9d26b234d5 diff --git a/requirements/tests.txt b/requirements/tests.txt index e9cc7e52f9f0..faa0d77f6515 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -183,12 +183,10 @@ mirakuru==2.5.1 \ --hash=sha256:0a16f897841741f8cd784f790e54d74e61456ba36be9cb9de731b49e2e7a45dc \ --hash=sha256:5a60d641fa92c8bfcd383f6e52f7a0bf3f081da0467fc6e3e6a3f6b3e3e47a7b # via pytest-postgresql -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements/tests.in - # pytest +packaging==23.1 \ + --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ + --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f + # via pytest pluggy==1.0.0 \ --hash=sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159 \ --hash=sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3 @@ -217,10 +215,6 @@ psutil==5.9.4 \ --hash=sha256:efeae04f9516907be44904cc7ce08defb6b665128992a56957abc9b61dca94b7 \ --hash=sha256:fd8522436a6ada7b4aad6638662966de0d61d241cb821239b2ae7013d41a43d4 # via mirakuru -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging pytest==7.2.2 \ --hash=sha256:130328f552dcfac0b1cec75c12e3f005619dc5f874f0a06e8ff7263f0ee6225e \ --hash=sha256:c99ab0c73aceb050f68929bc93af19ab6db0558791c6a0715723abe9d0ade9d4 From 70bcf6fe328909c5794fd8bbe0a17a0da7692d7b Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 24 Apr 2023 18:00:25 +0000 Subject: [PATCH 3/6] Update test for valid version --- warehouse/forklift/legacy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/warehouse/forklift/legacy.py b/warehouse/forklift/legacy.py index a74adbc49862..83405e8390fb 100644 --- a/warehouse/forklift/legacy.py +++ b/warehouse/forklift/legacy.py @@ -214,10 +214,10 @@ def _exc_with_message(exc, message, **kwargs): def _validate_pep440_version(form, field): - parsed = packaging.version.parse(field.data) - # Check that this version is a valid PEP 440 version at all. - if not isinstance(parsed, packaging.version.Version): + try: + parsed = packaging.version.parse(field.data) + except packaging.version.InvalidVersion: raise wtforms.validators.ValidationError( "Start and end with a letter or numeral containing only " "ASCII numeric and '.', '_' and '-'." From b31fc3ef6e69600003f12577dc450b3115e9bd49 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 24 Apr 2023 19:10:04 +0000 Subject: [PATCH 4/6] Add packaging_legacy --- requirements/main.in | 1 + requirements/main.txt | 5 +++++ warehouse/forklift/legacy.py | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/requirements/main.in b/requirements/main.in index e87c8de9b511..5f2a9284ade8 100644 --- a/requirements/main.in +++ b/requirements/main.in @@ -31,6 +31,7 @@ msgpack natsort orjson packaging>=15.2 +packaging_legacy paginate>=0.5.2 paginate_sqlalchemy passlib>=1.6.4 diff --git a/requirements/main.txt b/requirements/main.txt index 552edffaeb43..d4feb221715d 100644 --- a/requirements/main.txt +++ b/requirements/main.txt @@ -1129,6 +1129,11 @@ packaging==23.1 \ # -r requirements/main.in # google-cloud-bigquery # limits + # packaging-legacy +packaging-legacy==23.0 \ + --hash=sha256:7013a4aec35163f76c1d7b55340b0602b2fbe6628b4bb0948ac71c607f454260 \ + --hash=sha256:e1a20ece340845c11d384c27e456eaf76be05dbdb4073469019aabcbbd7b99de + # via -r requirements/main.in paginate==0.5.6 \ --hash=sha256:5e6007b6a9398177a7e1648d04fdd9f8c9766a1a945bceac82f1929e8c78af2d # via diff --git a/warehouse/forklift/legacy.py b/warehouse/forklift/legacy.py index 83405e8390fb..b0d27483c6b4 100644 --- a/warehouse/forklift/legacy.py +++ b/warehouse/forklift/legacy.py @@ -25,6 +25,7 @@ import packaging.specifiers import packaging.utils import packaging.version +import packaging_legacy.version import pkg_resources import requests import wtforms @@ -1163,7 +1164,7 @@ def file_upload(request): .all() ) for i, r in enumerate( - sorted(releases, key=lambda x: packaging.version.parse(x.version)) + sorted(releases, key=lambda x: packaging_legacy.version.parse(x.version)) ): r._pypi_ordering = i From 4f4c0f1b9c648629ae931174ec670f9226580bb9 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 24 Apr 2023 19:25:21 +0000 Subject: [PATCH 5/6] Update pins --- requirements/docs/blog.in | 1 - requirements/docs/blog.txt | 14 ++++---------- requirements/docs/user.in | 1 - requirements/docs/user.txt | 14 ++++---------- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/requirements/docs/blog.in b/requirements/docs/blog.in index 026dd3ec28e5..43e203663c6c 100644 --- a/requirements/docs/blog.in +++ b/requirements/docs/blog.in @@ -2,6 +2,5 @@ mkdocs mkdocs-material mkdocs-blogging-plugin mkdocs-rss-plugin -packaging<=21.3 pillow cairosvg diff --git a/requirements/docs/blog.txt b/requirements/docs/blog.txt index e093e1dde8e0..1167d2de4482 100644 --- a/requirements/docs/blog.txt +++ b/requirements/docs/blog.txt @@ -303,12 +303,10 @@ mkdocs-rss-plugin==1.6.0 \ --hash=sha256:7e7f08e7ea947d98042b9c05885d93c0f26b236865fc5b36a2261bb112a5d766 \ --hash=sha256:93644af3b9800842a5849ed5481e225f443bf0cda74843c9e81f6a62f6d14113 # via -r requirements/docs/blog.in -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements/docs/blog.in - # mkdocs +packaging==23.1 \ + --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ + --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f + # via mkdocs pillow==9.4.0 \ --hash=sha256:013016af6b3a12a2f40b704677f8b51f72cb007dac785a9933d5c86a72a7fe33 \ --hash=sha256:0845adc64fe9886db00f5ab68c4a8cd933ab749a87747555cec1c95acea64b0b \ @@ -402,10 +400,6 @@ pymdown-extensions==9.9.2 \ --hash=sha256:c3d804eb4a42b85bafb5f36436342a5ad38df03878bb24db8855a4aa8b08b765 \ --hash=sha256:ebb33069bafcb64d5f5988043331d4ea4929325dc678a6bcf247ddfcf96499f8 # via mkdocs-material -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 diff --git a/requirements/docs/user.in b/requirements/docs/user.in index 2e9c217eec36..c5f6e240080f 100644 --- a/requirements/docs/user.in +++ b/requirements/docs/user.in @@ -1,4 +1,3 @@ mkdocs mkdocs-material mkdocs-macros-plugin -packaging<=21.3 diff --git a/requirements/docs/user.txt b/requirements/docs/user.txt index 01e0f63bd459..7bf748cb0b09 100644 --- a/requirements/docs/user.txt +++ b/requirements/docs/user.txt @@ -203,12 +203,10 @@ mkdocs-material-extensions==1.1.1 \ --hash=sha256:9c003da71e2cc2493d910237448c672e00cefc800d3d6ae93d2fc69979e3bd93 \ --hash=sha256:e41d9f38e4798b6617ad98ca8f7f1157b1e4385ac1459ca1e4ea219b556df945 # via mkdocs-material -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements/docs/user.in - # mkdocs +packaging==23.1 \ + --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ + --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f + # via mkdocs pygments==2.14.0 \ --hash=sha256:b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297 \ --hash=sha256:fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717 @@ -217,10 +215,6 @@ pymdown-extensions==9.9.2 \ --hash=sha256:c3d804eb4a42b85bafb5f36436342a5ad38df03878bb24db8855a4aa8b08b765 \ --hash=sha256:ebb33069bafcb64d5f5988043331d4ea4929325dc678a6bcf247ddfcf96499f8 # via mkdocs-material -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 From da93b00ae162c235c45698b47f20970ee7e9918d Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 24 Apr 2023 19:33:12 +0000 Subject: [PATCH 6/6] Ignore typecheck --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c64c2952e196..740d1b8bec62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ module = [ "forcediphttpsadapter.*", "IPython.*", "mistune.*", + "packaging_legacy.*", "paginate.*", "paginate_sqlalchemy.*", "premailer.*",