File tree Expand file tree Collapse file tree 6 files changed +27
-20
lines changed
Expand file tree Collapse file tree 6 files changed +27
-20
lines changed Original file line number Diff line number Diff line change @@ -25,24 +25,24 @@ jobs:
2525 uses : actions/cache@v2
2626 with :
2727 path : ~/.cache/pip
28- key : ${{ runner.os }}-dev -${{ hashFiles('**/ setup.py ') }}
28+ key : ${{ runner.os }}-pip -${{ hashFiles('setup.cfg ') }}
2929 restore-keys : |
30- ${{ runner.os }}-dev -
30+ ${{ runner.os }}-pip -
3131
3232 - name : Install dependencies
3333 # We install the full dev requirements to make sure everything installs OK
3434 run : |
3535 python -m pip install pip
3636 pip install -e .[dev]
3737
38- - name : Analysing the code with Black
39- run : |
40- black --check .
41-
42- - name : Analysing the code with mypy
43- run : |
44- mypy --install-types --non-interactive ./mindee
38+ - name : Cache pre-commit
39+ uses : actions/cache@v2
40+ with :
41+ path : ~/.cache/pre-commit
42+ key : ${{ runner.os }}-prec-${{ hashFiles('.pre-commit-config.yaml') }}
43+ restore-keys : |
44+ ${{ runner.os }}-prec-
4545
46- - name : Analysing the code with pylint
46+ - name : Run all static analysis
4747 run : |
48- pylint ./mindee
48+ pre-commit run --all-files
Original file line number Diff line number Diff line change @@ -32,3 +32,14 @@ repos:
3232 args : [
3333 " -j2"
3434 ]
35+
36+ - repo : https://github.com/pre-commit/mirrors-mypy
37+ rev : v0.942
38+ hooks :
39+ - id : mypy
40+ additional_dependencies :
41+ - toml
42+ - pikepdf
43+ - types-pytz
44+ - types-requests
45+ - types-setuptools
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Here's the TL;DR of getting started.
66First, get an [ API Key] ( https://developers.mindee.com/docs/make-your-first-request#create-an-api-key )
77
88Then, install this library:
9- ``` shell script
9+ ``` shell
1010pip install mindee
1111```
1212
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ def doc_from_b64string(
319319 Load a document from a base64 encoded string.
320320
321321 :param input_string: Input to parse as base64 string
322- :param filename: The url_name of the file (without the path)
322+ :param filename: The name of the file (without the path)
323323 :param cut_pdf_mode: Number (between 1 and 3 incl.) of pages to reconstruct a pdf with.
324324
325325 * if 1: pages [0]
@@ -350,7 +350,7 @@ def doc_from_bytes(
350350 Load a document from raw bytes.
351351
352352 :param input_bytes: Raw byte input
353- :param filename: The url_name of the file (without the path)
353+ :param filename: The name of the file (without the path)
354354 :param cut_pdf_mode: Number (between 1 and 3 incl.) of pages to reconstruct a PDF with.
355355
356356 * if 1: pages [0]
Original file line number Diff line number Diff line change @@ -9,10 +9,6 @@ strict_equality = true
99disallow_any_unimported = true
1010disallow_untyped_calls = true
1111
12- [[tool .mypy .overrides ]]
13- module = [' pikepdf' ,]
14- ignore_missing_imports = true
15-
1612[tool .pylic ]
1713safe_licenses = [
1814 " Apache Software License" ,
Original file line number Diff line number Diff line change 66
77dir_path = os .path .dirname (os .path .realpath (__file__ ))
88version_file = os .path .join (dir_path , "mindee" , "version" )
9- with open (version_file , "r" , encoding = "utf-8" ) as version_file :
10- __version__ = version_file .read ().strip ()
9+ with open (version_file , "r" , encoding = "utf-8" ) as file_p :
10+ __version__ = file_p .read ().strip ()
1111
1212setup (
1313 version = __version__ ,
You can’t perform that action at this time.
0 commit comments