Skip to content

Commit

Permalink
Merge pull request #25 from spreadshirt/update-python
Browse files Browse the repository at this point in the history
Update Python version to 3.12
  • Loading branch information
heyLu authored Feb 26, 2024
2 parents 87bf99b + 136a859 commit 641c996
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10
FROM python:3.12

WORKDIR /app

Expand Down
4 changes: 2 additions & 2 deletions es_stream_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ async def aggregation_svg(es, request: Request, query: Query):
bucket_data['sub_buckets'].insert(0, {
'key': f"no value for {query.aggregation_terms}",
'count': amount,
'percentage': f"{(amount/max_count) * 100:.2f}%",
'percentage': f"{(amount / max_count) * 100:.2f}%",
'height': int((amount / max_count) * 100),
'offset_y': offset_y - int((amount / max_count) * 100),
'color': '#dddddd',
Expand All @@ -418,7 +418,7 @@ async def aggregation_svg(es, request: Request, query: Query):
continue
pos_y = 100 - scale_percentile.map(value)
if width_scale:
percentile_lines[percentile] += f" {width_scale.map(bucket_data['pos_x']+bucket_width/2)},{pos_y/100 * height}"
percentile_lines[percentile] += f" {width_scale.map(bucket_data['pos_x'] + bucket_width / 2)},{pos_y / 100 * height}"

percentile = float(percentile)
pretty_percentile = int(percentile) if percentile.is_integer() else percentile
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ click==8.1.3
elastic-transport==8.4.0
elasticsearch==8.6.1
fastapi==0.109.2
frozenlist==1.3.3
frozenlist==1.4.1
h11==0.14.0
httptools==0.5.0
httptools==0.6.1
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.3
Expand All @@ -26,8 +26,8 @@ sniffio==1.3.0
starlette==0.36.3
typing_extensions==4.9.0
urllib3==1.26.18
uvicorn==0.20.0
uvloop==0.17.0
uvicorn==0.27.1
uvloop==0.19.0
websockets==10.4
Werkzeug==3.0.1
yarl==1.8.2
yarl==1.9.4
2 changes: 1 addition & 1 deletion tinygraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ def pretty_duration(duration_s: int):
elif duration_s < 24 * HOUR:
fmt = f"{duration_s // HOUR}h"
else:
fmt = f"{duration_s // (24*HOUR)}d"
fmt = f"{duration_s // (24 * HOUR)}d"
return fmt

0 comments on commit 641c996

Please sign in to comment.