Skip to content

Commit

Permalink
Unpin constraint on packaging (#13500)
Browse files Browse the repository at this point in the history
* Unpin packaging

* Update to packaging==23.1

* Update test for valid version

* Add packaging_legacy

* Update pins

* Ignore typecheck
  • Loading branch information
di authored Apr 24, 2023
1 parent e1dc362 commit d618c7b
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 71 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module = [
"forcediphttpsadapter.*",
"IPython.*",
"mistune.*",
"packaging_legacy.*",
"paginate.*",
"paginate_sqlalchemy.*",
"premailer.*",
Expand Down
2 changes: 0 additions & 2 deletions requirements/deploy.in
Original file line number Diff line number Diff line change
@@ -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
14 changes: 4 additions & 10 deletions requirements/deploy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion requirements/docs/blog.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ mkdocs
mkdocs-material
mkdocs-blogging-plugin
mkdocs-rss-plugin
packaging<=21.3
pillow
cairosvg
14 changes: 4 additions & 10 deletions requirements/docs/blog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions requirements/docs/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ furo
Sphinx
sphinxcontrib-httpdomain
myst-parser
# Until resolved https://github.com/googleapis/python-bigquery/issues/1435
packaging<22.0
14 changes: 4 additions & 10 deletions requirements/docs/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion requirements/docs/user.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mkdocs
mkdocs-material
mkdocs-macros-plugin
packaging<=21.3
14 changes: 4 additions & 10 deletions requirements/docs/user.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions requirements/main.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ msgpack
natsort
orjson
packaging>=15.2
packaging_legacy
paginate>=0.5.2
paginate_sqlalchemy
passlib>=1.6.4
Expand Down Expand Up @@ -72,5 +73,3 @@ WTForms[email]>=2.0.0
yara-python
zope.sqlalchemy
zxcvbn
# Until resolved https://github.com/googleapis/python-bigquery/issues/1435
packaging<22.0
15 changes: 8 additions & 7 deletions requirements/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1122,13 +1122,18 @@ 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
# 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
Expand Down Expand Up @@ -1294,10 +1299,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
Expand Down
2 changes: 0 additions & 2 deletions requirements/tests.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 4 additions & 10 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions warehouse/forklift/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import packaging.specifiers
import packaging.utils
import packaging.version
import packaging_legacy.version
import pkg_resources
import requests
import wtforms
Expand Down Expand Up @@ -214,10 +215,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 '-'."
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit d618c7b

Please sign in to comment.