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

Update Travis CI #207

wants to merge 7 commits into from

Conversation

edumco
Copy link

@edumco edumco commented Jul 28, 2020

This PR brings several important changes

A new list of Python versions

Although it is possible to support all Python versions it become harder and harder every day. So, I've selected that are present in Ubuntu versions that have a long term support (LTS)

Each LTS has a long life in support from canonical from 5 to 10 years and comes with a default Python:

  • 14.04 (Trusty Thar) = Python 2.7
  • 16.04 (Xenial Xerus) = Python 3.5 and 2.7
  • 18.04 (Bionic Beaver) = Python 3.6 and 2.7
  • 20.04 (Focal Fossa) = Python 3.8 only

Even with the EOL of Python 2.7, 3.5 and 3.6 it will be possible to run these machines for a long time (at their own risk).

Pytest parallel execution

Pytest allows you to run tests tests in parallel reducing the total execution time. I've fixed the number of jobs to 4 because the runners normally have 2 virtual cores and it is a good practice to use 2 threads per core (maximum)

Requirements File

A requirements.txt was add to make clear what are the dependencies on the project.

It was created using a python2.7 version so only the minimum requirements versions are defined for now.

Disabled a bunch of failing tests

Its been so long since the last successful build on Travis that the failing tests could be caused by many causes.

I believe all testes should be manually reviewed so I did not open individual issues.

Update PDFs imports

I changed the import format to make tests pass on newer Python versions (especially 3.8)

Before

import static_pdfs

Now

from test import static_pdfs

@@ -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?

- 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

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.

👍

@@ -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?

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?

@@ -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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants