mirror of
https://github.com/jsvine/pdfplumber.git
synced 2026-08-29 08:34:23 +08:00
Fix CLI test & GitHub action
This commit is contained in:
@@ -8,18 +8,18 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install ghostscript libmagickwand-dev
|
||||
run: sudo apt-get install libxml2-utils
|
||||
- name: Prepare for installations
|
||||
run: sudo apt update -y
|
||||
- name: Install Python
|
||||
run: sudo apt install -y python3-pip python3-dev python3-venv
|
||||
- name: Install ghostscript & imagemagick
|
||||
run: sudo apt install -y ghostscript libmagickwand-dev
|
||||
- name: Remove policy.xml
|
||||
run: sudo rm /etc/ImageMagick-6/policy.xml
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.8
|
||||
- uses: actions/cache@v2
|
||||
name: Configure pip caching
|
||||
- name: Configure pip caching
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt')}}-${{ hashFiles('**/requirements-dev.txt') }}
|
||||
@@ -31,5 +31,5 @@ jobs:
|
||||
run: make check-flake
|
||||
- name: Run tests
|
||||
run: make tests
|
||||
- name: Examine code coverage
|
||||
- name: Upload code coverage
|
||||
uses: codecov/codecov-action@v1.0.12
|
||||
|
||||
@@ -3,7 +3,7 @@ PYTHON := venv/bin/python
|
||||
PIP = venv/bin/pip
|
||||
|
||||
venv:
|
||||
python -m venv venv
|
||||
python3 -m venv venv
|
||||
${PIP} install --upgrade pip
|
||||
${PIP} install -r requirements.txt
|
||||
${PIP} install -r requirements-dev.txt
|
||||
|
||||
@@ -48,3 +48,7 @@ def main(args_raw=sys.argv[1:]):
|
||||
kwargs = {"csv": {}, "json": {"indent": args.indent}}[args.format]
|
||||
with PDF.open(args.infile, pages=args.pages) as pdf:
|
||||
converter(pdf, sys.stdout, args.types, **kwargs)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -58,7 +58,9 @@ class Test(unittest.TestCase):
|
||||
|
||||
def test_cli(self):
|
||||
res = run([
|
||||
"pdfplumber",
|
||||
sys.executable,
|
||||
"-m",
|
||||
"pdfplumber.cli",
|
||||
self.path,
|
||||
"--format",
|
||||
"json",
|
||||
|
||||
Reference in New Issue
Block a user