Skip to content

Commit

Permalink
Merge pull request #1003 from NickCrews/black
Browse files Browse the repository at this point in the history
Format with Black
  • Loading branch information
fgregg committed May 4, 2022
2 parents 1275f5e + 748a861 commit 9e01ccf
Show file tree
Hide file tree
Showing 45 changed files with 1,891 additions and 1,698 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,32 @@ name: tests
on: [push, pull_request]

jobs:
format:
# We want all subsequent steps of CI to refer to the fresh version of code,
# so run this before anything else.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Black
run: pip install black
- name: Run black --check .
run: black --check .
- name: If needed, commit black changes to the pull request
if: failure()
run: |
black .
git config --global user.name 'autoblack'
git config --global user.email 'cclauss@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git commit -am "fixup: Format Python code with Black"
git push
test:
needs: format
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
Expand Down
1 change: 1 addition & 0 deletions dedupe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)

from dedupe._init import * # noqa
7 changes: 6 additions & 1 deletion dedupe/_init.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from dedupe.api import StaticDedupe, Dedupe # noqa: F401
from dedupe.api import StaticRecordLink, RecordLink # noqa: F401
from dedupe.api import StaticGazetteer, Gazetteer # noqa: F401
from dedupe.convenience import console_label, training_data_dedupe, training_data_link, canonicalize # noqa: F401
from dedupe.convenience import ( # noqa: F401
console_label,
training_data_dedupe,
training_data_link,
canonicalize,
)
13 changes: 3 additions & 10 deletions dedupe/_typing.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import numpy
import sys

from typing import (Iterator,
Tuple,
Mapping,
Union,
Iterable,
List,
Any)
from typing import Iterator, Tuple, Mapping, Union, Iterable, List, Any

if sys.version_info >= (3, 8):
from typing import TypedDict, Protocol, Literal
Expand All @@ -25,10 +19,9 @@
Clusters = Iterable[Cluster]
Data = Mapping[RecordID, RecordDict]
TrainingExample = Tuple[RecordDict, RecordDict]
Links = Iterable[Union[numpy.ndarray,
Tuple[Tuple[RecordID, RecordID], float]]]
Links = Iterable[Union[numpy.ndarray, Tuple[Tuple[RecordID, RecordID], float]]]
LookupResults = Iterable[Tuple[RecordID, Tuple[Tuple[RecordID, float], ...]]]
JoinConstraint = Literal['one-to-one', 'many-to-one', 'many-to-many']
JoinConstraint = Literal["one-to-one", "many-to-one", "many-to-many"]


class TrainingData(TypedDict):
Expand Down

0 comments on commit 9e01ccf

Please sign in to comment.