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

Updates for Travis: new python #974

Closed
wants to merge 5 commits into from
Closed

Conversation

kkopachev
Copy link
Member

  • Updated red eye filter to work with cv2 and add test
  • Fix noise filter test
  • Updated install scripts to use opencv-python from pip
  • Fix skipped base_imaging handler test
  • Added more caching for travis

FYI @cclauss

.travis.yml Outdated
directories:
- $HOME/.cache/pip
- /tmp/ffmpeg/bin
sudo: false
Copy link

Choose a reason for hiding this comment

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

My take is you don't need the sudo and dist lines because these are not Travis defaults and it would be a bummer to lock in trusty when Travis updates distro but this is minor stuff.

@@ -1,62 +1,54 @@
language: python
Copy link

Choose a reason for hiding this comment

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

Really cool stuff!! Just some minor comments...

.travis.yml Outdated
- gfortran
- libopenblas-dev
- liblapack-dev
- python-pyexiv2
- yasm
install:
- pip install -U --upgrade pip
Copy link

Choose a reason for hiding this comment

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

Could this be --user instead of -U? Explicit is better than... I forgot to do this on an earlier PR.

@kkopachev
Copy link
Member Author

should be all good now

@marcelometal
Copy link
Member

Hi @kkopachev,

Who is the copyright holder of tests/fixtures/filters/redeye.png, could you please add this info and the license?

@kkopachev
Copy link
Member Author

kkopachev commented Sep 7, 2017

@marcelometal It's public domain. Not sure where to add that info.

@marcelometal
Copy link
Member

@kkopachev, maybe here tests/fixtures/filters/README.mkd ?

@kkopachev
Copy link
Member Author

@marcelometal done! Thanks.

.travis.yml Outdated
directories:
- $HOME/.cache/pip
sudo: false
- /tmp/ffmpeg/bin
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@scorphus
Copy link
Member

Hey, @kkopachev. Can you please:

  • Squash commits that are related to each other (like fix commits and/or commits that undo things done by an earlier commit, such as the miniconda in and out)
  • Rebase the commits on top of current master (a.k.a. resolve conflicts)

Thank you very much!

@kkopachev
Copy link
Member Author

@scorphus do you prefer a way of pulling ffmpeg off of zesty repo - requires sudo on travis, might be slow to start the test. Or preserve ffmpeg compile stage and use travis cache?

@scorphus
Copy link
Member

Hey @kkopachev. Glad you're still with us! 🤗

@marcelometal's PR – #975 – that installs ffmpeg from zesty was already merged, so I guess we're good on that.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.5%) to 86.06% when pulling 79dc61e on kkopachev:new-travis into 2b86a4d on thumbor:master.

@kkopachev
Copy link
Member Author

updated

Copy link
Member

@scorphus scorphus left a comment

Choose a reason for hiding this comment

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

That's all I could review for now. @marcelometal, can you please chime in and give us your thoughts?

"flake8",
"yanc",
"remotecv",
"pyssim",
"pyssim>=0.4.0",
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering why we're setting a lower threshold for pyssim here. There's nothing different in tests nor in docs on this commit. I looked briefly but could not see any relation between pyssim >= 0.4 and latest Python versions. Excuse me if I missed something.

Copy link
Member Author

Choose a reason for hiding this comment

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

so, this is only a list of test dependencies.
previously, scipy was manually included, but never used directly anywhere in the code. Only usage was through pyssim.
Pyssim, in it's turn, does not seem to install its dependencies automatically, up to latest release (0.4). jterrace/pyssim#24
Now that pyssim can automatically install it's own dependencies, I decided to remove explicit require of scipy, as it was not directly used and let pip's pyssim do the magic.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, my bad, didn't notice that diff regarded changes made to test_require.

"cairosvg>=1.0.0,<2.0.0,!=1.0.21",
"preggy>=1.3.0",
"opencv-python",
Copy link
Member

Choose a reason for hiding this comment

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

Here we're making this a mandatory dependency, which is not the case for Thumbor, I believe. Only if the user decides to use such engine and configure Thumbor to do so and in such cases he/she should install the desired engine. Perhaps docs regarding this should be improved.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a list of test dependencies. opencv could be used in PIL engine to convert 16bit TIFFs to png.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, it's also used in redeye filter and detectors. And in order to test that it's all required.

@@ -1,23 +1,23 @@
language: python
python:
- 2.7_with_system_site_packages
Copy link
Member Author

Choose a reason for hiding this comment

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

so, with_system_site_packages thing forces travis to use whatever python is shipped with distribution. IIRC it's 2.7.6 at the moment. Then there were some problems installing opencv... It was easier to go with virtualenv and install packages from pip instead (reason to upgrade from cv/cv2 to cv3)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice improvement.

@kkopachev
Copy link
Member Author

Any updates here?

@coveralls
Copy link

coveralls commented Sep 23, 2017

Coverage Status

Coverage increased (+1.5%) to 86.123% when pulling 6de04cb on kkopachev:new-travis into 0053c69 on thumbor:master.

Copy link

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

There is some good stuff. What is to be done before it is considered done?

.travis.yml Outdated
before_install:
- echo "deb http://archive.ubuntu.com/ubuntu zesty main universe" | sudo tee --append /etc/apt/sources.list
- sudo apt-get update
- sudo apt-get install ffmpeg -y -f
install:
- pip install -U --upgrade pip
- pip install --upgrade pip
- pip install -I https://github.com/escaped/pyexiv2/archive/master.zip
Copy link
Member

Choose a reason for hiding this comment

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

Hi @kkopachev, master branch may not be completely stable at a given moment and could break Thumbor build. What do you think about installing this dependency via .deb package?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure I can use deb to make it automatically available in virtual env. I can reference commit hash instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

pyexiv2 is dead anyway, not likely there will be any releases.

Copy link
Member

Choose a reason for hiding this comment

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

Currently, pyexiv2 is installed via .deb package (Travis) and the tests are running.

Copy link
Member Author

Choose a reason for hiding this comment

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

current travis setup uses python with system provided packages, that's why it's working.
However, not working if we don't use system python and use virtualenv: https://travis-ci.org/thumbor/thumbor/jobs/280505386#L1689

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, if you guys care that much about something breaking the build, there are other issues as well https://github.com/thumbor/thumbor/pull/975/files#r141397089

@coveralls
Copy link

Coverage Status

Coverage increased (+1.4%) to 86.026% when pulling 65a65d5 on kkopachev:new-travis into 0053c69 on thumbor:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.5%) to 86.123% when pulling 1960f92 on kkopachev:new-travis into 0053c69 on thumbor:master.

@kkopachev
Copy link
Member Author

any more comments?

@marcelometal
Copy link
Member

Hi @kkopachev, Good work!

Thank you for contributing to Thumbor!

@scorphus
Copy link
Member

Merged in 2f15296 🎉 You are a rockstar, @kkopachev! 🚀 Thank you for your contributions to Thumbor!

@scorphus scorphus closed this Sep 28, 2017
@kkopachev kkopachev deleted the new-travis branch September 28, 2017 16:27
@Kmaschta Kmaschta mentioned this pull request Jan 5, 2018
9 tasks
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.

None yet

6 participants