Commit Graph

9178 Commits

Author SHA1 Message Date
Andrew Murray
df86d2d78a
Merge pull request #4150 from radarhere/ci
Updated CI target Python versions for macOS
2019-10-20 21:15:51 +11:00
Andrew Murray
aaf9720c58 Updated CI target Python versions for macOS [ci skip] 2019-10-20 21:00:26 +11:00
Hugo van Kemenade
a56b9713a3
Merge pull request #4141 from hugovk/add-3.8
Add support for Python 3.8
2019-10-20 12:44:04 +03:00
Hugo van Kemenade
2b86210308
Quotes and caps
To exactly match the recommend text at https://tidelift.com/lifter/package/pypi/Pillow/tasks/2439 and hopefully mark the task as done.
2019-10-19 09:58:13 +03:00
hugovk
062c4013a4 Consistent slash 2019-10-15 23:02:43 +03:00
hugovk
fd4707d9d3 Test on Python 3.8 final 2019-10-15 20:57:29 +03:00
Hugo
2ab518edcb Add support for Python 3.8 2019-10-15 12:44:21 +03:00
Hugo van Kemenade
facd9b003e
Merge pull request #4140 from hugovk/pypy3.6-v7.2.0
Test pypy3.6-v7.2.0 on Windows
2019-10-15 12:06:08 +03:00
hugovk
dcb732d110 Test pypy3.6-v7.2.0 on Windows 2019-10-14 23:22:21 +03:00
Andrew Murray
7068225b23 Updated CHANGES.rst [ci skip] 2019-10-13 08:12:54 +11:00
Andrew Murray
96003a98d0
Merge pull request #4137 from jdufresne/tox-pypy
Add PyPy3 to the tox test matrix
2019-10-13 08:05:43 +11:00
Andrew Murray
02ca4a1a7f
Merge pull request #4138 from jdufresne/skip-known
Remove unused arguments from PillowTestCase.skipKnownBadTest()
2019-10-13 06:42:02 +11:00
Jon Dufresne
9981568982 Simpilify PillowTestCase.delete_tempfile for pytest
As the test suite always runs with pytest now, self.currentResult is
always None. Using this, can remove unused code.
2019-10-12 11:13:14 -07:00
Jon Dufresne
4cd4adddc3 Improve handling of file resources
Follow Python's file object semantics. User code is responsible for
closing resources (usually through a context manager) in a deterministic
way.

To achieve this, remove __del__ functions. These functions used to
closed open file handlers in an attempt to silence Python
ResourceWarnings. However, using __del__ has the following drawbacks:

- __del__ isn't called until the object's reference count reaches 0.
  Therefore, resource handlers remain open or in use longer than
  necessary.

- The __del__ method isn't guaranteed to execute on system exit. See the
  Python documentation:

  https://docs.python.org/3/reference/datamodel.html#object.__del__

  > It is not guaranteed that __del__() methods are called for objects
  > that still exist when the interpreter exits.

- Exceptions that occur inside __del__ are ignored instead of raised.
  This has the potential of hiding bugs. This is also in the Python
  documentation:

  > Warning: Due to the precarious circumstances under which __del__()
  > methods are invoked, exceptions that occur during their execution
  > are ignored, and a warning is printed to sys.stderr instead.

Instead, always close resource handlers when they are no longer in use.
This will close the file handler at a specified point in the user's code
and not wait until the interpreter chooses to. It is always guaranteed
to run. And, if an exception occurs while closing the file handler, the
bug will not be ignored.

Now, when code receives a ResourceWarning, it will highlight an area
that is mishandling resources. It should not simply be silenced, but
fixed by closing resources with a context manager.

All warnings that were emitted during tests have been cleaned up. To
enable warnings, I passed the `-Wa` CLI option to Python. This exposed
some mishandling of resources in ImageFile.__init__() and
SpiderImagePlugin.loadImageSeries(), they too were fixed.
2019-10-12 08:27:17 -07:00
Jon Dufresne
0affbacd5e Remove unused arguments from PillowTestCase.skipKnwonBadTest() 2019-10-12 08:17:20 -07:00
Jon Dufresne
911079cc68 Add PyPy3 to the tox test matrix
Allows contributors to automatically test locally.
2019-10-12 07:56:43 -07:00
nulano
accbe58b5e add Python version to selftest, rename brief parameter 2019-10-12 15:40:12 +01:00
Andrew Murray
7c95d9d188
Rearranged badges [ci skip]
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
2019-10-12 21:53:49 +11:00
Andrew Murray
8cdacf8871 Added GitHub Actions badges for platform builds [ci skip] 2019-10-12 21:38:01 +11:00
Hugo van Kemenade
6595ce1609
Merge pull request #4081 from hugovk/test-with-github-actions
Test Linux and macOS with GitHub Actions
2019-10-12 13:07:28 +03:00
Hugo
a4d7861e34 Turn fail-fast off, so one failed job doesn't cancel others 2019-10-12 12:14:49 +03:00
Hugo
707c9910ab Install OS dependencies without checking version number 2019-10-12 10:49:26 +03:00
Hugo
cf8f8b1743 Drop support for EOL Python 2.7 2019-10-12 10:49:26 +03:00
Hugo
01373b4ed9 Add Codecov token to config 2019-10-12 10:49:26 +03:00
Hugo
ac5642dc76 Split script.sh into build.sh and test.sh 2019-10-12 10:49:26 +03:00
Hugo
7c7c53fbb6 Test macOS with GitHub Actions 2019-10-12 10:49:26 +03:00
Hugo
e595ddbaa1 Test with GitHub Actions 2019-10-12 10:49:26 +03:00
Andrew Murray
078a767b77
Merge pull request #4133 from hugovk/dont-test-2.7
CI: Stop testing Python 2.7
2019-10-12 17:56:32 +11:00
Hugo van Kemenade
23c3891b81
Merge pull request #4084 from nulano/gha-win
Test Windows with GitHub Actions
2019-10-11 22:16:45 +03:00
Hugo van Kemenade
f0c08ad565
Merge branch 'master' into gha-win 2019-10-11 19:24:48 +03:00
Hugo
faa1d1f326 Stop testing Python 2.7 2019-10-11 19:05:20 +03:00
Hugo van Kemenade
7fad924ac0
Merge pull request #4132 from radarhere/orientation
Added orientation note
2019-10-11 18:42:13 +03:00
Hugo van Kemenade
8225642745
Merge pull request #4131 from radarhere/badges
Added GitHub Actions badges
2019-10-11 18:41:05 +03:00
Andrew Murray
a8c07e3d5f Added orientation note [ci skip] 2019-10-11 22:40:31 +11:00
Andrew Murray
f2abab474d Added GitHub Actions badges [ci skip] 2019-10-11 22:04:21 +11:00
Hugo van Kemenade
8c94f01842
Merge pull request #4126 from radarhere/python38
Added Python 3.8 rc1 to AppVeyor
2019-10-09 23:50:23 +03:00
Andrew Murray
1c493fb4fa Added Python 3.8 rc1 2019-10-10 06:31:18 +11:00
Andrew Murray
7e980d7613
Merge pull request #4066 from hugovk/test-docker-with-github-actions
Test Docker with GitHub Actions
2019-10-09 21:16:42 +11:00
nulano
a0a5601689
Merge branch 'master' into gha-win 2019-10-08 12:56:43 +01:00
Hugo van Kemenade
4c172ae266
Updated ImageOps documentation (#4125)
Updated ImageOps documentation
2019-10-08 13:44:40 +03:00
Andrew Murray
fab0205abc Updated documentation [ci skip] 2019-10-08 21:12:15 +11:00
Hugo
fc4dbf8484 Test Docker with GitHub Actions 2019-10-08 11:26:08 +03:00
Hugo van Kemenade
a59c1b7cea
Merge pull request #4122 from jdufresne/imports
Move several imports to the top-level of the file
2019-10-08 10:13:39 +03:00
Jon Dufresne
64032061c0 Move several imports to the top-level of the file
This better follows PEP 8 style guide:

https://www.python.org/dev/peps/pep-0008/#imports

> Imports are always put at the top of the file, just after any module
> comments and docstrings, and before module globals and constants.

This also avoids duplicate import code within the same file.
2019-10-07 06:28:36 -07:00
Hugo van Kemenade
127b322194
Test Qt5 (#4120)
Test Qt5
2019-10-07 14:27:48 +03:00
Hugo van Kemenade
fe855ab999
Merge pull request #4121 from jdufresne/bytes
Use bytes literals instead of bytes(str)
2019-10-07 08:38:39 +03:00
Jon Dufresne
922f55c265 Use bytes literals instead of bytes(str)
Bytes literals are available on all supported Python versions. Rather
than convert strings literals to bytes at runtime, simply use a bytes
literal.
2019-10-06 19:26:55 -07:00
Andrew Murray
bbfa8bc1ca Updated CHANGES.rst [ci skip] 2019-10-07 13:07:36 +11:00
Andrew Murray
c3822de70d Test Qt5 2019-10-07 12:41:33 +11:00
Andrew Murray
e8cf9a6bc1
Merge pull request #4108 from hugovk/rm-deprecated-qt
Drop support for EOL PyQt4 and PySide
2019-10-07 12:35:56 +11:00