-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from chezou/black
Introduce black, isort, nox
- Loading branch information
Showing
17 changed files
with
509 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import nox | ||
|
||
|
||
@nox.session | ||
def lint(session): | ||
lint_tools = ["black", "isort", "flake8"] | ||
targets = ["tabula", "tests", "noxfile.py"] | ||
session.install(*lint_tools) | ||
session.run("flake8", *targets) | ||
session.run("black", "--diff", "--check", *targets) | ||
session.run("isort", "--check-only") | ||
|
||
|
||
@nox.session | ||
def tests(session): | ||
session.install(".[test]") | ||
session.run("pytest", "-v") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
[wheel] | ||
universal = 1 | ||
|
||
[flake8] | ||
ignore = F401 | ||
max-line-length = 200 | ||
ignore = E203, W503 | ||
max-line-length = 88 | ||
exclude = | ||
.git, | ||
__pycache__, | ||
build, | ||
dist, | ||
.venv, | ||
tabula/__init__.py | ||
|
||
[isort] | ||
line_length=88 | ||
multi_line_output=3 | ||
include_trailing_comma=True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,47 @@ | ||
from setuptools import setup | ||
from setuptools import find_packages | ||
import os | ||
|
||
from setuptools import find_packages, setup | ||
|
||
|
||
def read_file(filename): | ||
filepath = os.path.join( | ||
os.path.dirname(os.path.dirname(__file__)), filename) | ||
filepath = os.path.join(os.path.dirname(os.path.dirname(__file__)), filename) | ||
if os.path.exists(filepath): | ||
return open(filepath).read() | ||
else: | ||
return '' | ||
return "" | ||
|
||
|
||
about = {} | ||
with open(os.path.join(os.path.dirname(__file__), 'tabula', '__version__.py')) as f: | ||
with open(os.path.join(os.path.dirname(__file__), "tabula", "__version__.py")) as f: | ||
exec(f.read(), about) | ||
|
||
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f: | ||
about['__long_description__'] = f.read() | ||
with open(os.path.join(os.path.dirname(__file__), "README.md")) as f: | ||
about["__long_description__"] = f.read() | ||
|
||
|
||
setup( | ||
name=about['__title__'], | ||
version=about['__version__'], | ||
description=about['__description__'], | ||
long_description=about['__long_description__'], | ||
name=about["__title__"], | ||
version=about["__version__"], | ||
description=about["__description__"], | ||
long_description=about["__long_description__"], | ||
long_description_content_type="text/markdown", | ||
author=about['__author__'], | ||
author_email=about['__author_email__'], | ||
maintainer=about['__maintainer__'], | ||
maintainer_email=about['__maintainer_email__'], | ||
license=about['__license__'], | ||
url=about['__url__'], | ||
author=about["__author__"], | ||
author_email=about["__author_email__"], | ||
maintainer=about["__maintainer__"], | ||
maintainer_email=about["__maintainer_email__"], | ||
license=about["__license__"], | ||
url=about["__url__"], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Topic :: Text Processing :: General', | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.5', | ||
"Development Status :: 4 - Beta", | ||
"Topic :: Text Processing :: General", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.5", | ||
], | ||
include_package_data=True, | ||
packages=find_packages(), | ||
keywords=['data frame', 'pdf', 'table'], | ||
install_requires=[ | ||
'pandas', | ||
'numpy', | ||
'distro', | ||
], | ||
extras_require={ | ||
'dev': ['pytest', 'flake8', 'black', 'isort'] | ||
}, | ||
keywords=["data frame", "pdf", "table"], | ||
install_requires=["pandas", "numpy", "distro"], | ||
extras_require={"dev": ["pytest", "flake8", "black", "isort"], "test": ["pytest"]}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from .wrapper import read_pdf | ||
from .wrapper import read_pdf_with_template | ||
from .wrapper import convert_into | ||
from .wrapper import convert_into_by_batch | ||
from .util import environment_info | ||
from .__version__ import __version__ | ||
from .util import environment_info | ||
from .wrapper import ( | ||
convert_into, | ||
convert_into_by_batch, | ||
read_pdf, | ||
read_pdf_with_template, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
__title__ = 'tabula-py' | ||
__version__ = '1.3.1' | ||
__license__ = 'MIT License' | ||
__description__ = 'Simple wrapper for tabula-java, read tables from PDF into DataFrame' | ||
__author__ = 'Aki Ariga' | ||
__author_email__ = 'chezou@gmail.com' | ||
__maintainer__ = 'Aki Ariga' | ||
__maintainer_email__ = 'chezou@gmail.com' | ||
__url__ = 'https://github.com/chezou/tabula-py' | ||
__title__ = "tabula-py" | ||
__version__ = "1.3.1" | ||
__license__ = "MIT License" | ||
__description__ = "Simple wrapper for tabula-java, read tables from PDF into DataFrame" | ||
__author__ = "Aki Ariga" | ||
__author_email__ = "chezou@gmail.com" | ||
__maintainer__ = "Aki Ariga" | ||
__maintainer_email__ = "chezou@gmail.com" | ||
__url__ = "https://github.com/chezou/tabula-py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.