Skip to content

Commit

Permalink
WIP 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
KTAtkinson committed Jun 8, 2023
1 parent 549faab commit 60e2b42
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10"]

container:
image: python:${{ matrix.python-version }}
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/reddit/thrift-compiler:0.14.1 AS thrift
FROM ghcr.io/reddit/thrift-compiler:0.18.1 AS thrift

FROM python:3.9
FROM python:3.10

COPY --from=thrift /usr/local/bin/thrift /usr/local/bin/thrift

Expand All @@ -12,6 +12,7 @@ WORKDIR /src
ENV CASS_DRIVER_NO_EXTENSIONS theytaketoolongtobuild

COPY requirements*.txt ./

RUN pip install -r requirements.txt

RUN touch /baseplate-py-dev-docker-image
Expand Down
2 changes: 1 addition & 1 deletion baseplate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def from_upstream(
raise ValueError("invalid sampled value")

if flags is not None:
if not 0 <= flags < 2 ** 64:
if not 0 <= flags < 2**64:
raise ValueError("invalid flags value")

return cls(trace_id, parent_id, span_id, sampled, flags)
Expand Down
2 changes: 1 addition & 1 deletion baseplate/lib/prometheus_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
default_size_factor = 2
default_size_count = 20
default_size_buckets = [
default_size_start * default_size_factor ** i for i in range(default_size_count)
default_size_start * default_size_factor**i for i in range(default_size_count)
]


Expand Down
2 changes: 1 addition & 1 deletion baseplate/thrift/BaseplateService.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion baseplate/thrift/BaseplateServiceV2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion baseplate/thrift/constants.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion baseplate/thrift/ttypes.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions requirements-transitive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
# supported.
advocate==1.0.0
alabaster==0.7.12
amqp==2.6.1
amqp==5.1.1
appdirs==1.4.4
aspy.refactor-imports==2.1.1
astroid==2.12.14
attrs==20.3.0
Babel==2.9.1
beautifulsoup4==4.9.3
Expand All @@ -16,15 +17,15 @@ cassandra-driver==3.24.0
certifi==2022.12.7
cffi==1.14.5
chardet==4.0.0
click==7.1.2
confluent-kafka==1.6.0
click==8.0.0
confluent-kafka==2.1.1
coverage==5.4
cryptography==39.0.1
docutils==0.16
geomet==0.2.1.post1
gevent==21.1.2
gevent==22.10.2
graphviz==0.16
greenlet==1.0.0
greenlet==2.0.2
hupper==1.10.2
idna==2.10
imagesize==1.2.0
Expand All @@ -33,7 +34,7 @@ iniconfig==1.1.1
isort==5.7.0
Jinja2==2.11.3
kazoo==2.8.0
kombu==4.6.11
kombu==5.3.0
lazy-object-proxy==1.4.3
MarkupSafe==1.1.1
mccabe==0.7.0
Expand All @@ -50,7 +51,7 @@ plaster-pastedeploy==0.7
platformdirs==2.4.0
pluggy==0.13.1
posix-ipc==1.0.5
py==1.10.0
py==1.11.0
pyasn1==0.4.8
pycodestyle==2.9.1
pycparser==2.20
Expand Down Expand Up @@ -79,17 +80,17 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
SQLAlchemy==1.4.12
thrift==0.14.1
thrift==0.16.0
toml==0.10.2
tomli==1.2.2
translationstring==1.4
typing-extensions==3.10.0.2
urllib3==1.26.11
venusian==3.0.0
vine==1.3.0
vine==5.0.0
waitress==2.1.2
WebOb==1.8.6
wrapt==1.12.1
wrapt==1.14
zope.deprecation==4.4.0
zope.event==4.5.0
zope.interface==5.2.0
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
# See install_requires and extras_require in setup.py for the range of versions
# supported.
-r requirements-transitive.txt
black==21.10b0
black==22.10.0
boto3==1.21.20
flake8==5.0.4
lxml==4.9.1
mypy==0.910
prometheus-client==0.16.0
pydocstyle==5.1.1
pylint==2.15.3
pytest==6.2.2
pytest-cov==2.11.1
pylint==2.15.10
pytest==7.3.1
pytest-cov==4.1.0
pytz==2021.1
reorder-python-imports==2.4.0
sphinx==3.4.3
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"posix_ipc>=1.0.0,<2.0",
"python-json-logger>=2.0,<3.0",
"requests>=2.21.0,<3.0",
"thrift>=0.14.1,<1.0",
"thrift<1.0",
"gevent>=20.5.0",
"prometheus-client>=0.12.0",
],
Expand All @@ -70,9 +70,9 @@
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_thrift/TestService.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/integration/test_thrift/constants.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/integration/test_thrift/ttypes.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 16 additions & 28 deletions tests/unit/frameworks/queue_consumer/kombu_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,14 @@ def test_handle(self, ttl_delta, handled, context, span, baseplate, name, messag
message.ack.assert_not_called()
message.reject.assert_called_once()

assert (
REGISTRY.get_sample_value(
f"{AMQP_PROCESSING_TIME._name}_bucket",
{**prom_labels._asdict(), **{"amqp_success": "true", "le": "+Inf"}},
)
== (1 if handled else None)
)
assert (
REGISTRY.get_sample_value(
f"{AMQP_PROCESSED_TOTAL._name}_total",
{**prom_labels._asdict(), **{"amqp_success": "true"}},
)
== (1 if handled else None)
)
assert REGISTRY.get_sample_value(
f"{AMQP_PROCESSING_TIME._name}_bucket",
{**prom_labels._asdict(), **{"amqp_success": "true", "le": "+Inf"}},
) == (1 if handled else None)
assert REGISTRY.get_sample_value(
f"{AMQP_PROCESSED_TOTAL._name}_total",
{**prom_labels._asdict(), **{"amqp_success": "true"}},
) == (1 if handled else None)
assert (
REGISTRY.get_sample_value(
f"{AMQP_REPUBLISHED_TOTAL._name}_total",
Expand All @@ -153,13 +147,10 @@ def test_handle(self, ttl_delta, handled, context, span, baseplate, name, messag
)
is None
)
assert (
REGISTRY.get_sample_value(
f"{AMQP_REJECTED_TOTAL._name}_total",
{**prom_labels._asdict(), **{"reason_code": AMQP_REJECTED_REASON_TTL}},
)
== (None if handled else 1)
)
assert REGISTRY.get_sample_value(
f"{AMQP_REJECTED_TOTAL._name}_total",
{**prom_labels._asdict(), **{"reason_code": AMQP_REJECTED_REASON_TTL}},
) == (None if handled else 1)
assert REGISTRY.get_sample_value(
f"{AMQP_ACTIVE_MESSAGES._name}", prom_labels._asdict()
) == (0 if handled else None)
Expand Down Expand Up @@ -417,13 +408,10 @@ def handler_fn(ctx, body, msg):
)
== 0
)
assert (
REGISTRY.get_sample_value(
f"{AMQP_REPUBLISHED_TOTAL._name}_total",
{**prom_labels._asdict()},
)
== (1 if republished else None)
)
assert REGISTRY.get_sample_value(
f"{AMQP_REPUBLISHED_TOTAL._name}_total",
{**prom_labels._asdict()},
) == (1 if republished else None)
retry_reached_expectation = None
if attempt:
if attempt >= 5 or (limit and attempt >= limit):
Expand Down

0 comments on commit 60e2b42

Please sign in to comment.