Skip to content

Commit

Permalink
use ruff upgrade and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
grizz committed Oct 18, 2024
1 parent 1b5da4d commit 0982fb4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ repos:
hooks:
- id: check-yaml
- id: trailing-whitespace
- repo: local
hooks:
- id: pyupgrade
name: pyupgrade
entry: uv run pyupgrade --py36-plus
language: python
types: [python]
pass_filenames: true
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
Expand Down
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ dependencies = [
"httpx>=0.24.1",
]

[project.scripts]
peeringdb = "peeringdb.cli:main"

[project.urls]
repository = "https://github.com/peeringdb/peeringdb-py"


[tool.uv]
dev-dependencies = [
"django_peeringdb>=3.1.0",
Expand All @@ -59,8 +61,12 @@ dev-dependencies = [
"twine>=3",
]

[project.scripts]
peeringdb = "peeringdb.cli:main"
[tool.ruff.lint]
extend-select = [
"I", # isort
"UP", # pyupgrade
]


[build-system]
requires = ["hatchling"]
Expand Down
2 changes: 1 addition & 1 deletion script/dump_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main(file, dumpfile=None):

def write(f):
for line in output:
f.write("%s\n" % line)
f.write(f"{str(line)}\n")

if dumpfile is None:
write(sys.stdout)
Expand Down
3 changes: 1 addition & 2 deletions src/peeringdb/_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
from datetime import datetime
from typing import List, Union

from peeringdb import get_backend
from peeringdb import config, get_backend
from peeringdb._sync import extract_relations, set_many_relations, set_single_relations
from peeringdb.fetch import Fetcher
from peeringdb.private import private_data_has_been_fetched
from peeringdb.util import group_fields, log_error
from peeringdb import config


class Updater:
Expand Down
1 change: 0 additions & 1 deletion src/peeringdb/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from peeringdb.util import load_failed_entries, save_failed_entries
from peeringdb.whois import WhoisFormat


_log = logging.getLogger(__name__)

_log = logging.getLogger(__name__)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import helper
import pytest
import json
import os

import helper
import pytest

import peeringdb
from peeringdb.client import Client
from peeringdb.resource import Network, Organization, all_resources
Expand Down

0 comments on commit 0982fb4

Please sign in to comment.