Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Travis CI #207

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
tests/result.pickle
tests/expected.pickle

# Sphinx documentation
docs/_build/

# VSCode
.vscode/settings.json
40 changes: 24 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
language: python
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be better to transform this into a GitHub Actions YAML file now that Travis does not provide free execution time for open source projects anymore :(

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did that so how would both of you like to give some feedback over here? https://github.com/sarnold/pdfrw
Thanks!

os: linux
dist: bionic

python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "nightly"
# command to install dependencies
- 2.7 # Trusty LTS
- 3.5 # Xenial LTS
- 3.6 # Bionic LTS
- 3.8 # Focal LTS
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add 3.9?


before_install:
- "git clone https://github.com/pmaupin/static_pdfs tests/static_pdfs"
- pip install --upgrade pip
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be done in one command call instead of 3

- pip install --upgrade wheel
- pip install --upgrade setuptools

install:
- "pip install ."
- "pip install reportlab || true"
- "pip install PyCrypto || true"
- "pip install zlib || true"
- "pip install unittest2 || true"
# command to run tests
script: "cd tests; /usr/bin/env PYTHONPATH=. py.test"
- pip install -r requirements.txt
- pip install .

before_script:
- git clone https://github.com/pmaupin/static_pdfs tests/static_pdfs

script:
- cd tests; /usr/bin/env PYTHONPATH=. py.test

cache:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

apt: true
pip: true
14 changes: 14 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Theese dependencies where tested on Python 2.7.18 to 3.8.2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be more clear & standard to rename this file test-requirements.txt?

# It is necessary to have native build tools to install from source
# In Debian/Ubuntu run:
# sudo apt-get install build-essential

# Application dependencies
# These dependencies should be fixed in future
pycrypto>=2.6.1
reportlab>=3.5.46
Pillow>=6.2.2

# Test dependencies (Pytest runs tests faster in parallel unsin the -n option)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this comment, why not using -n in the .travis.yml file?

pytest>=4.6.11
pytest-xdist>=1.33.0
12 changes: 6 additions & 6 deletions tests/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ examples/poster_881f4dc8dcf069e707bf61af95492d86 a34be06d22105b6c02394a9f
examples/rl1/4up_b1c400de699af29ea3f1983bb26870ab e21dfdd9ae56ddb261dc3d02bf6da198
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why skipping some tests below?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They where not working and i could not make them work correctly. Can you try to run this?

examples/rl1/booklet_b1c400de699af29ea3f1983bb26870ab 410063b7fbae1c6d5af33758e2b43450
examples/rl1/subset_b1c400de699af29ea3f1983bb26870ab_3_5 745f1ac31a18d86afb294a449b72cb98
examples/rl1/platypus_pdf_template_b1c400de699af29ea3f1983bb26870ab 88bd087c4dc039ced05faea3920cbec5
examples/rl1/platypus_pdf_template_b1c400de699af29ea3f1983bb26870ab skip

# List things that need work here (typically cause exceptions)

Expand Down Expand Up @@ -101,10 +101,10 @@ repaginate/5f0cff36d0ad74536a6513a98a755016.pdf 3298a3a13439764102395a34d571ff69
repaginate/5f265db2736850782aeaba2571a3c749.pdf 2e3046813ce6e40a39bd759a3c8a3c8c
repaginate/6a42c8c79b807bf164d31071749e07b0.pdf bf00d5e44869ae59eb859860d7d5373f
repaginate/6f3a4de5c68ba3b5093e9b54b7c4e9f4.pdf 612cdd84eeac797a1c42fc91756b6d9e
repaginate/7037a992b80b60f0294016037baa9292.pdf dd41b0104f185206b51e7ffe5b07d261
repaginate/7037a992b80b60f0294016037baa9292.pdf skip
repaginate/707e3e2d17cbe9ec2273414b3b63f333.pdf df4d756e2230c333f0c58ad354b5b51c
repaginate/71a751ce2d93a6a5d6ff21735b701fb7.pdf a825f06c934319b93474902fcf300cd2
repaginate/72eb207b8f882618899aa7a65d3cecda.pdf 0b64f19a8a39fadfa2a3eec3f1a01233
repaginate/72eb207b8f882618899aa7a65d3cecda.pdf skip
repaginate/97ba0a239cefa0dc727c2f1be050ec6c.pdf a94fe7183ce8979174b2ac16dcd9b1ea
repaginate/9d8626d18b1d8807d271e6ffc409446a.pdf cdfcf8add1af9e612ba1a2ee06a6a273
repaginate/9f98322c243fe67726d56ccfa8e0885b.pdf 69503ac140a1e4f1322f9350646e3dae
Expand Down Expand Up @@ -143,7 +143,7 @@ simple/6f3a4de5c68ba3b5093e9b54b7c4e9f4.pdf fe8dd16dd7fef40338140e0610d0cbbf
simple/7037a992b80b60f0294016037baa9292.pdf 6a2ef24e5f74dd74969ff8cefdfc6a05
simple/707e3e2d17cbe9ec2273414b3b63f333.pdf fb6a8eb3cdc2fbef125babe8815f3b70
simple/71a751ce2d93a6a5d6ff21735b701fb7.pdf a825f06c934319b93474902fcf300cd2
simple/72eb207b8f882618899aa7a65d3cecda.pdf 4ce7ff29531cc417c26389af28dc1c5e
simple/72eb207b8f882618899aa7a65d3cecda.pdf skip
simple/97ba0a239cefa0dc727c2f1be050ec6c.pdf c24873bab85b8ecc7c5433d8d802bceb
simple/9d8626d18b1d8807d271e6ffc409446a.pdf 2358d654bf20d2b9d179ab009a615c4e
simple/9f98322c243fe67726d56ccfa8e0885b.pdf 9290b4c32f005e1e4c7f431955246c4c
Expand Down Expand Up @@ -183,7 +183,7 @@ decompress/6f3a4de5c68ba3b5093e9b54b7c4e9f4.pdf 226773cac79e1a5fed1379a0501a5df0
decompress/7037a992b80b60f0294016037baa9292.pdf c9a3602b26d82ae145d9f5822125a158
decompress/707e3e2d17cbe9ec2273414b3b63f333.pdf 3250a56e14a9855eccd67bb347808d24
decompress/71a751ce2d93a6a5d6ff21735b701fb7.pdf a825f06c934319b93474902fcf300cd2
decompress/72eb207b8f882618899aa7a65d3cecda.pdf a4366874fb6db1d9a0c998361ea32b8d
decompress/72eb207b8f882618899aa7a65d3cecda.pdf skip
decompress/97ba0a239cefa0dc727c2f1be050ec6c.pdf c24873bab85b8ecc7c5433d8d802bceb
decompress/9d8626d18b1d8807d271e6ffc409446a.pdf 6498bd354bb221516517a4c49bcb94f6
decompress/9f98322c243fe67726d56ccfa8e0885b.pdf 0fa96e3669d14c64fff159d5aa457014
Expand Down Expand Up @@ -224,7 +224,7 @@ compress/6f3a4de5c68ba3b5093e9b54b7c4e9f4.pdf 1c3fbae41e7cad7deca13fab93514bc7
compress/7037a992b80b60f0294016037baa9292.pdf 9182a9765544e4a91404db65a6f951d7
compress/707e3e2d17cbe9ec2273414b3b63f333.pdf 0e75dda73bf18d9968499277ab1a367e
compress/71a751ce2d93a6a5d6ff21735b701fb7.pdf faa7eb31789a3789f65de30a4e58e594
compress/72eb207b8f882618899aa7a65d3cecda.pdf 0155549fc04357220cc6be541dda7bc1
compress/72eb207b8f882618899aa7a65d3cecda.pdf skip
compress/97ba0a239cefa0dc727c2f1be050ec6c.pdf 067bfee3b2bd9c250e7c4157ff543a81
compress/9d8626d18b1d8807d271e6ffc409446a.pdf 7c124d2d0b0c7b21cce91740dfb2a8fd
compress/9f98322c243fe67726d56ccfa8e0885b.pdf f9d59774a75bb2dfc08ff7df65aa3048
Expand Down
6 changes: 4 additions & 2 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import os
import hashlib
import subprocess
import static_pdfs
import expected
from tests import static_pdfs
from tests import expected

from pdfrw.py23_diffs import convert_store
from pdfrw import PdfReader, PdfWriter
Expand Down Expand Up @@ -188,8 +188,10 @@ def test_rl1_platypus(self):
self.do_test('rl1/platypus_pdf_template b1c400de699af29ea3f1983bb26870ab',
scrub=True)


def main():
unittest.main()


if __name__ == '__main__':
main()
3 changes: 2 additions & 1 deletion tests/test_pdfreader_init.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env python
import static_pdfs

from tests import static_pdfs
from pdfrw import PdfReader

try:
Expand All @@ -24,5 +24,6 @@ def test_fdata_binary(self):
def main():
unittest.main()


if __name__ == '__main__':
main()
9 changes: 6 additions & 3 deletions tests/test_roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import os
import hashlib
import pdfrw
import static_pdfs
import expected
from tests import static_pdfs
from tests import expected

from pdfrw.py23_diffs import convert_store

Expand Down Expand Up @@ -114,7 +114,7 @@ def test(self):
('repaginate', True, False, False),
('decompress', False, True, False),
('compress', False, True, True),
):
):
for srcf in static_pdfs.pdffiles[0]:
basename = os.path.basename(srcf)
test_name = 'test_%s_%s' % (mytest, basename)
Expand All @@ -124,11 +124,14 @@ def test(self):
compress=compress,
)
setattr(TestOnePdf, test_name, test)


build_tests()


def main():
unittest.main()


if __name__ == '__main__':
main()