Skip to content

Commit 8dd12de

Browse files
authored
ENH: Add isort pre-commit hooks
Author: Phillip Cloud <cpcloud@gmail.com> Closes ibis-project#1759 from cpcloud/isort-pre-commit and squashes the following commits: acd6ea1 [Phillip Cloud] Pass CIRCLECI envar through 388f450 [Phillip Cloud] Add isort pre-commit hooks
1 parent 80db366 commit 8dd12de

188 files changed

Lines changed: 675 additions & 895 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.

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test: &test
6262
- run:
6363
name: Execute Pytest
6464
command: |
65-
docker-compose run -e PYTHONHASHSEED=$PYTHONHASHSEED ibis \
65+
docker-compose run -e PYTHONHASHSEED=$PYTHONHASHSEED -e CIRCLECI=$CIRCLECI ibis \
6666
pytest ibis -m "not udf" \
6767
-ra \
6868
--numprocesses auto \

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
known_third_party = asv,click,clickhouse_driver,dateutil,google,graphviz,impala,jinja2,kudu,multipledispatch,numpy,pandas,pkg_resources,plumbum,psycopg2,pyarrow,pydata_google_auth,pymapd,pymysql,pytest,pytz,regex,requests,ruamel,setuptools,sphinx_rtd_theme,sqlalchemy,toolz

.pre-commit-config.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
2-
- repo: git://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.1.0
2+
- repo: https://github.com/asottile/seed-isort-config
3+
rev: v1.7.0
44
hooks:
5-
- id: flake8
6-
types:
7-
- python
8-
args: ['--config=setup.cfg']
9-
5+
- id: seed-isort-config
6+
- repo: https://github.com/pre-commit/mirrors-isort
7+
rev: v4.3.17
8+
hooks:
9+
- id: isort
1010
- repo: https://github.com/ambv/black
1111
# we need to use this commit or later, to pickup the fix that splits
1212
# trailing comma syntax into call vs def, both of which weren't implemented
@@ -15,9 +15,14 @@ repos:
1515
rev: cea13f498418784e22f8fbd78db3f9240a2bad11
1616
hooks:
1717
- id: black
18-
args: ['--config=pyproject.toml']
1918
# a side effect of black running exclude filters and then include
2019
# filters (the built-in black behavior) is that a command line such as
2120
# black --exclude foo.py foo.py will still format foo.py. We avoid this
2221
# in pre-commit by not passing staged files.
2322
pass_filenames: false
23+
- repo: git://github.com/pre-commit/pre-commit-hooks
24+
rev: v2.1.0
25+
hooks:
26+
- id: flake8
27+
types:
28+
- python

ci/asvconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env python
22

3-
import sys
4-
import asv
53
import json
64
import socket
5+
import sys
76

7+
import asv
88

99
if __name__ == '__main__':
1010
if len(sys.argv) > 1:

ci/datamgr.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
#!/usr/bin/env python
22

3-
import os
43
import json
54
import logging
6-
import zipfile
5+
import os
76
import tempfile
87
import warnings
8+
import zipfile
99
from pathlib import Path
1010

1111
import click
1212
import pandas as pd
1313
import sqlalchemy as sa
14-
from toolz import dissoc
1514
from plumbum import local
15+
from toolz import dissoc
1616

1717
import ibis
1818

19-
2019
SCRIPT_DIR = Path(__file__).parent.absolute()
2120
DATA_DIR_NAME = 'ibis-testing-data'
2221
DATA_DIR = Path(

ci/feedstock.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
import shutil
55
import sys
66
import tempfile
7-
87
from pathlib import Path
98

109
import click
1110
import ruamel.yaml
12-
1311
from jinja2 import Environment, FileSystemLoader
14-
from plumbum.cmd import git, conda
12+
from plumbum.cmd import conda, git
1513

1614
import ibis
1715

18-
1916
IBIS_DIR = Path(__file__).parent.parent.absolute()
2017

2118

ci/impalamgr.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@
33
import concurrent.futures
44
import itertools
55
import os
6-
76
from io import BytesIO
87
from pathlib import Path
98

109
import click
1110
import toolz
12-
13-
from plumbum import local, CommandNotFound
14-
from plumbum.cmd import make, cmake
11+
from plumbum import CommandNotFound, local
12+
from plumbum.cmd import cmake, make
1513

1614
import ibis
17-
1815
from ibis.common import IbisError
1916
from ibis.impala.tests.conftest import IbisTestEnv
2017

21-
2218
SCRIPT_DIR = Path(__file__).parent.absolute()
2319
DATA_DIR = Path(
2420
os.environ.get(

ci/requirements-3.5-dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ dependencies:
1313
- google-cloud-bigquery>=1.0.0
1414
- graphviz
1515
- impyla<0.14.2
16+
- isort
1617
- jinja2
1718
- lz4
1819
- multipledispatch>=0.6.0
1920
- mypy
2021
- numpy
2122
- pandas>=0.21
23+
- pip
2224
- plumbum
2325
- pre_commit
2426
- psycopg2
@@ -43,3 +45,5 @@ dependencies:
4345
- toolz
4446
- xorg-libxpm
4547
- xorg-libxrender
48+
- pip:
49+
- seed-isort-config

ci/requirements-3.6-dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ dependencies:
1111
- google-cloud-bigquery>=1.0.0
1212
- graphviz
1313
- impyla>=0.14.2
14+
- isort
1415
- jinja2
1516
- lz4
1617
- multipledispatch>=0.6.0
1718
- mypy
1819
- numpy
1920
- pandas>=0.21
21+
- pip
2022
- plumbum
2123
- pre_commit
2224
- psycopg2
@@ -41,3 +43,5 @@ dependencies:
4143
- toolz
4244
- xorg-libxpm
4345
- xorg-libxrender
46+
- pip:
47+
- seed-isort-config

ci/requirements-3.7-dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ dependencies:
1111
- google-cloud-bigquery>=1.0.0
1212
- graphviz
1313
- impyla>=0.14.2
14+
- isort
1415
- jinja2
1516
- lz4
1617
- multipledispatch>=0.6.0
1718
- mypy
1819
- numpy
1920
- pandas>=0.21
21+
- pip
2022
- plumbum
2123
- pre_commit
2224
- psycopg2
@@ -41,3 +43,5 @@ dependencies:
4143
- toolz
4244
- xorg-libxpm
4345
- xorg-libxrender
46+
- pip:
47+
- seed-isort-config

0 commit comments

Comments
 (0)