Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ repos:
- id: detect-private-key
- id: check-yaml

- repo: https://github.com/psf/black
rev: 24.4.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.10
hooks:
- id: black
- id: ruff
- id: ruff-format
1 change: 0 additions & 1 deletion src/openstack_billing_db/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from datetime import datetime
from dataclasses import dataclass
from decimal import Decimal, ROUND_HALF_UP
import json
import math
import os

Expand Down
2 changes: 0 additions & 2 deletions src/openstack_billing_db/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import subprocess

import boto3
import requests
from requests.auth import HTTPBasicAuth

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/openstack_billing_db/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def main():

if not dump_file:
raise Exception(
"Must provide either --sql_dump_file" "or --download_dump_from_s3."
"Must provide either --sql_dump_fileor --download_dump_from_s3."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not requesting a change to this PR, but it's funny that the linter caught a typo here. Feel free to make another PR to fix this typo

@KelvinLinBU KelvinLinBU May 28, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter is paying dividends already haha. I'll make a pr to fix the small typo once this is merged.

)

if args.use_nerc_rates:
Expand Down
4 changes: 2 additions & 2 deletions src/openstack_billing_db/tests/unit/test_billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from openstack_billing_db import billing
from openstack_billing_db.model import Instance, InstanceEvent
from openstack_billing_db.tests.unit.utils import FLAVORS, MINUTE, HOUR, DAY, MONTH
from openstack_billing_db.tests.unit.utils import FLAVORS, HOUR, DAY


def test_instance_simple_runtime():
Expand Down Expand Up @@ -46,5 +46,5 @@ def test_billing_add_su_hours():
invoice = billing.set_invoice_su_hours(invoice, "gpu_a100", 48)
assert invoice.gpu_a100_su_hours == 48

with pytest.raises(Exception) as e:
with pytest.raises(Exception):
invoice = billing.set_invoice_su_hours(invoice, "gpu_fake", 72)
2 changes: 1 addition & 1 deletion src/openstack_billing_db/tests/unit/test_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime, timedelta

from openstack_billing_db.model import Instance, InstanceEvent, Database
from openstack_billing_db.tests.unit.utils import FLAVORS, MINUTE, HOUR, DAY, MONTH
from openstack_billing_db.tests.unit.utils import FLAVORS, MINUTE, DAY, MONTH


def test_instance_simple_runtime():
Expand Down