Skip to content

Commit

Permalink
Fix spelling of Python 3.5-specific requirements
Browse files Browse the repository at this point in the history
According to PEP 440, `~="3.5"` is equivalent to `>="3.5", =="3.*"` -
that is, any 3.x version from 3.5 on.  I don't think that's what was
intended in most of these cases, and the effect is that resolvers on
recent versions of Python end up pinning to the versions that work on
3.5, which is pretty excessive.

In most of these cases, `~="3.5.0"` is a better spelling, restricting
these pins to Python 3.5.x.  The exceptions seem to be `aiocontextvars`
and `contextvars`, which were needed in Python 3.5 and 3.6, but aren't
needed as of 3.7 since `contextvars` is in the standard library there; I
think `>="3.5"` plus `<"3.7"` and similar makes more sense for those
cases.  (Comments in `talisker.context` indicate that `aiocontextvars`
specifically requires at least 3.5.3.)
  • Loading branch information
cjwatson committed Jan 6, 2023
1 parent fc67382 commit 9b40b9c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@ packages = talisker
test_suite = tests
package_dir = talisker=talisker
install_requires =
Werkzeug~=1.0;python_version~="3.5"
Werkzeug~=1.0;python_version~="3.5.0"
Werkzeug<3;python_version>"3.6"
statsd~=3.3;python_version~="3.5"
statsd~=3.3;python_version~="3.5.0"
statsd<4;python_version>"3.6"
requests~=2.25;python_version~="3.5"
requests~=2.25;python_version~="3.5.0"
requests<3.0;python_version>"3.5"
future~=0.18
contextvars~=2.4;python_version~="3.5"
contextvars~=2.4;python_version>="3.5" and python_version<"3.7"

[options.extras_require]
gunicorn = gunicorn>=19.7.0
raven = raven>=6.4.0
celery =
celery~=4.4;python_version~="3.5"
celery~=4.4;python_version~="3.5.0"
celery>=4,<5.3;python_version>"3.5"
django =
django~=2.2;python_version~="3.5"
django~=2.2;python_version~="3.5.0"
django<4;python_version>"3.5"
prometheus =
prometheus-client~=0.7.0;python_version~="3.5"
prometheus-client~=0.7.0;python_version~="3.5.0"
prometheus-client<0.8;python_version>"3.5"
flask =
flask~=1.1;python_version~="3.5"
flask~=1.1;python_version~="3.5.0"
flask<3;python_version>"3.5"
blinker~=1.5;python_version~="3.5"
blinker~=1.5;python_version~="3.5.0"
blinker<2;python_version>"3.5"
dev =
logging_tree>=1.9
Expand All @@ -77,7 +77,7 @@ pg =
sqlparse>=0.4.2
psycopg2>=2.8,<3.0
asyncio =
aiocontextvars==0.2.2;python_version~="3.5"
aiocontextvars==0.2.2;python_version>="3.5.3" and python_version<"3.7"
gevent = gevent>=20.9.0

[options.package_data]
Expand Down
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@
),
extras_require=dict(
asyncio=[
'aiocontextvars==0.2.2;python_version~="3.5"',
'aiocontextvars==0.2.2;python_version>="3.5.3" and python_version<"3.7"',
],
celery=[
'celery~=4.4;python_version~="3.5"',
'celery~=4.4;python_version~="3.5.0"',
'celery>=4,<5.3;python_version>"3.5"',
],
dev=[
Expand All @@ -155,13 +155,13 @@
'objgraph>=3.5',
],
django=[
'django~=2.2;python_version~="3.5"',
'django~=2.2;python_version~="3.5.0"',
'django<4;python_version>"3.5"',
],
flask=[
'flask~=1.1;python_version~="3.5"',
'flask~=1.1;python_version~="3.5.0"',
'flask<3;python_version>"3.5"',
'blinker~=1.5;python_version~="3.5"',
'blinker~=1.5;python_version~="3.5.0"',
'blinker<2;python_version>"3.5"',
],
gevent=[
Expand All @@ -175,7 +175,7 @@
'psycopg2>=2.8,<3.0',
],
prometheus=[
'prometheus-client~=0.7.0;python_version~="3.5"',
'prometheus-client~=0.7.0;python_version~="3.5.0"',
'prometheus-client<0.8;python_version>"3.5"',
],
raven=[
Expand All @@ -184,14 +184,14 @@
),
include_package_data=True,
install_requires=[
'Werkzeug~=1.0;python_version~="3.5"',
'Werkzeug~=1.0;python_version~="3.5.0"',
'Werkzeug<3;python_version>"3.6"',
'statsd~=3.3;python_version~="3.5"',
'statsd~=3.3;python_version~="3.5.0"',
'statsd<4;python_version>"3.6"',
'requests~=2.25;python_version~="3.5"',
'requests~=2.25;python_version~="3.5.0"',
'requests<3.0;python_version>"3.5"',
'future~=0.18',
'contextvars~=2.4;python_version~="3.5"',
'contextvars~=2.4;python_version>="3.5" and python_version<"3.7"',
],
keywords=[
'talisker',
Expand Down

0 comments on commit 9b40b9c

Please sign in to comment.