Skip to content

Commit dfdb892

Browse files
authored
Merge pull request #601 from splitgraph/readd-isort
Readd isort
2 parents 4cc7603 + 3c1bd4f commit dfdb892

107 files changed

Lines changed: 169 additions & 54 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_and_test_and_release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
key: pip_cache
3131
- name: "Run pre-commit hooks (typechecks and the formatter)"
3232
run: |
33+
pip install -U pip
3334
pip install pre-commit
3435
# NB this uses mypy in .pre-commit-config.yaml
3536
pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ repos:
2020
- types-tabulate
2121
- types-PyYAML
2222
exclude: "^(examples|test|docs)/"
23-
#
24-
# - repo: https://github.com/pycqa/isort
25-
# rev: 5.9.3
26-
# hooks:
27-
# - id: isort
28-
# args: ["--profile", "black", "--filter-files"]
23+
24+
- repo: local
25+
hooks:
26+
- id: isort
27+
name: isort
28+
entry: isort
29+
require_serial: true
30+
language: python
31+
language_version: python3
32+
types_or: [cython, pyi, python]
33+
args: ["--profile", "black", "--filter-files"]
34+
minimum_pre_commit_version: '2.9.2'
35+
additional_dependencies: ['isort==5.10.1']

docs/generate_reference.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,46 @@
99

1010
import splitgraph.commandline as cmd
1111
from splitgraph.commandline.cloud import (
12-
register_c,
13-
login_c,
12+
add_c,
1413
curl_c,
15-
login_api_c,
16-
sql_c as cloud_sql_c,
17-
readme_c,
1814
description_c,
19-
metadata_c,
20-
search_c,
21-
load_c,
15+
download_c,
2216
dump_c,
23-
add_c,
24-
token_c,
25-
status_c,
17+
load_c,
18+
login_api_c,
19+
login_c,
2620
logs_c,
27-
upload_c,
21+
metadata_c,
22+
plugins_c,
23+
readme_c,
24+
register_c,
25+
search_c,
2826
seed_c,
29-
validate_c,
27+
)
28+
from splitgraph.commandline.cloud import sql_c as cloud_sql_c
29+
from splitgraph.commandline.cloud import (
30+
status_c,
3031
stub_c,
31-
plugins_c,
3232
sync_c,
33-
download_c,
33+
token_c,
34+
upload_c,
35+
validate_c,
3436
)
3537
from splitgraph.commandline.engine import (
3638
add_engine_c,
39+
configure_engine_c,
3740
delete_engine_c,
3841
list_engines_c,
42+
log_engine_c,
3943
start_engine_c,
4044
stop_engine_c,
41-
log_engine_c,
42-
configure_engine_c,
4345
upgrade_engine_c,
4446
version_engine_c,
4547
)
4648
from splitgraph.commandline.ingestion import csv_export, csv_import
4749

4850
# Map category to Click commands -- maybe eventually we'll read this dynamically...
49-
from splitgraph.config.keys import KEYS, KEY_DOCS, DEFAULTS
51+
from splitgraph.config.keys import DEFAULTS, KEY_DOCS, KEYS
5052
from splitgraph.ingestion.singer.commandline import singer_target
5153

5254
STRUCTURE = [

examples/custom_fdw/src/hn_fdw/fdw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import requests
55

66
try:
7-
from multicorn import ForeignDataWrapper, ANY
7+
from multicorn import ANY, ForeignDataWrapper
88
except ImportError:
99
# Multicorn not installed (don't crash the import in this case if we want to unit test this.).
1010
ForeignDataWrapper = object

examples/custom_fdw/src/hn_fdw/mount.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
from typing import Dict, Optional
22

3-
from splitgraph.core.types import (
4-
TableColumn,
5-
TableInfo,
6-
IntrospectionResult,
7-
)
3+
from splitgraph.core.types import IntrospectionResult, TableColumn, TableInfo
84

95
# Define the schema of the foreign table we wish to create
106
# We're only going to be fetching stories, so limit the columns to the ones that

examples/dbt_adapter/dbt/adapters/splitgraph/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from dbt.adapters.base import AdapterPlugin
2-
32
from dbt.adapters.splitgraph.connections import SplitgraphCredentials
43
from dbt.adapters.splitgraph.impl import SplitgraphAdapter
54
from dbt.include import splitgraph

examples/dbt_adapter/dbt/adapters/splitgraph/connections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
from dbt.adapters.postgres import PostgresConnectionManager, PostgresCredentials
77
from psycopg2.pool import AbstractConnectionPool
88

9+
from splitgraph.core.image_mounting import ImageMapper
910
from splitgraph.core.repository import Repository
1011
from splitgraph.engine import switch_engine
1112
from splitgraph.engine.postgres.engine import PostgresEngine
12-
from splitgraph.core.image_mounting import ImageMapper
1313

1414

1515
@dataclass

examples/dbt_adapter/dbt/adapters/splitgraph/impl.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from dbt.adapters.postgres.impl import PostgresAdapter
2-
32
from dbt.adapters.splitgraph import SplitgraphConnectionManager
43

54

examples/dbt_adapter/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
2-
from setuptools import find_namespace_packages
3-
from setuptools import setup
2+
from setuptools import find_namespace_packages, setup
43

54
package_name = "dbt-splitgraph"
65
package_version = "0.0.1"

examples/example_to_md.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
import json
33
import re
4-
from typing import List, Dict, Any
4+
from typing import Any, Dict, List
55

66
import click
77

0 commit comments

Comments
 (0)