Fix CLI test & GitHub action

This commit is contained in:
Jeremy Singer-Vine
2020-08-13 21:23:09 -04:00
parent 76583d9f33
commit 6c9f8db9b6
4 changed files with 17 additions and 11 deletions
+9 -9
View File
@@ -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
+1 -1
View File
@@ -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
+4
View File
@@ -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()
+3 -1
View File
@@ -58,7 +58,9 @@ class Test(unittest.TestCase):
def test_cli(self):
res = run([
"pdfplumber",
sys.executable,
"-m",
"pdfplumber.cli",
self.path,
"--format",
"json",