Skip to content

Commit

Permalink
Merge f959f4e into 3e5bb6c
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Apr 7, 2020
2 parents 3e5bb6c + f959f4e commit 1a0e960
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
@@ -1,5 +1,5 @@
python:
version: 2.7
version: 3.5
pip_install: true
extra_requirements:
- docs
3 changes: 0 additions & 3 deletions .travis.yml
Expand Up @@ -4,8 +4,6 @@ cache: pip

matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 3.5
env: TOXENV=py35
- python: 3.6
Expand All @@ -21,7 +19,6 @@ addons:
apt:
packages:
- graphviz
- python-pygame
- libsdl-dev
- python3-dev
- python3-numpy
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,8 @@ ChangeLog
+------------+---------------------------------------------------------------------+------------+
| Version | Description | Date |
+============+=====================================================================+============+
| **1.3.0** | * Remove Python 2.7 support. Only Python 3.5 or newer is supported. | TBD |
+------------+---------------------------------------------------------------------+------------+
| **1.2.0** | * Rework namespace handling for luma sub-projects | 2019/06/16 |
+------------+---------------------------------------------------------------------+------------+
| **1.1.0** | * Added ASCII-block emulator | 2018/02/03 |
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

# luma.emulator documentation build configuration file, created by
Expand Down
12 changes: 2 additions & 10 deletions doc/install.rst
@@ -1,21 +1,13 @@
Installation
------------
.. note:: The library has been tested against Python 2.7 and 3.4+.

For **Python3** installation, substitute the following in the
instructions below.

* ``pip`` ⇒ ``pip3``,
* ``python`` ⇒ ``python3``,
* ``python-dev`` ⇒ ``python3-dev``,
* ``python-pip`` ⇒ ``python3-pip``.
.. note:: The library has been tested against Python 3.5 and newer.

System packages
^^^^^^^^^^^^^^^

Install dependencies for pygame first::

$ sudo apt install python-dev python-pip build-essential
$ sudo apt install python3-dev python3-pip build-essential
$ sudo apt install libsdl-dev libportmidi-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev

And upgrade ``pip`` and ``setuptools``::
Expand Down
2 changes: 1 addition & 1 deletion luma/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2019 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

try:
Expand Down
4 changes: 2 additions & 2 deletions luma/emulator/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

__version__ = '1.2.0'
__version__ = '1.3.0'
2 changes: 1 addition & 1 deletion luma/emulator/clut.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

# From a comment by @TerrorBite on https://gist.github.com/MicahElliott/719710
Expand Down
2 changes: 1 addition & 1 deletion luma/emulator/device.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

import os
Expand Down
2 changes: 1 addition & 1 deletion luma/emulator/render.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

import os
Expand Down
2 changes: 1 addition & 1 deletion luma/emulator/segment_mapper.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.


Expand Down
11 changes: 4 additions & 7 deletions setup.py
Expand Up @@ -33,7 +33,6 @@ def find_version(*file_paths):
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
test_deps = [
'mock;python_version<"3.3"',
'pytest<=4.5',
'pytest-cov'
]
Expand All @@ -59,7 +58,7 @@ def find_version(*file_paths):
"luma/emulator/images/7-segment.png"
]},
install_requires=[
"luma.core>=1.12.0",
"luma.core>=1.14.0",
"pygame"
],
setup_requires=pytest_runner,
Expand All @@ -75,7 +74,7 @@ def find_version(*file_paths):
'test': test_deps
},
zip_safe=False,
python_requires='>=2.7',
python_requires='>=3.5, <4',
classifiers=[
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
Expand All @@ -85,12 +84,10 @@ def find_version(*file_paths):
"Topic :: System :: Hardware",
"Topic :: System :: Hardware :: Hardware Drivers",
"Topic :: Software Development :: Libraries :: pygame",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7"
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8"
]
)
2 changes: 1 addition & 1 deletion tests/baseline_data.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.


Expand Down
14 changes: 2 additions & 12 deletions tests/helpers.py
@@ -1,22 +1,12 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

from contextlib import contextmanager
import hashlib
import os.path
import sys

if sys.version_info > (3, 0):
from io import StringIO
else:
from io import BytesIO as StringIO


try:
from unittest.mock import call, patch
except ImportError:
from mock import call, patch, Mock # noqa: F401
from io import StringIO


def md5(fname):
Expand Down
15 changes: 5 additions & 10 deletions tests/test_asciiblock.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull and contributors
# Copyright (c) 2018-2020 Richard Hull and contributors
# See LICENSE.rst for details.

"""
Expand All @@ -10,10 +10,11 @@
import hashlib
import struct
import sys
from unittest.mock import patch

from luma.core.render import canvas
import baseline_data
from helpers import patch, md5, redirect_stdout
from helpers import md5, redirect_stdout


def noop():
Expand Down Expand Up @@ -42,10 +43,7 @@ def test_display():
baseline_data.primitives(device, draw)

device.cleanup = noop
out = f.getvalue()

if sys.version_info > (3, 0):
out = out.encode('utf-8')
out = f.getvalue().encode('utf-8')

digest = hashlib.md5(out).hexdigest()
assert md5('tests/reference/asciiblock.txt') == digest
Expand All @@ -65,10 +63,7 @@ def test_cleanup():
device.cleanup()

device.cleanup = noop
out = f.getvalue()

if sys.version_info > (3, 0):
out = out.encode('utf-8')
out = f.getvalue().encode('utf-8')

digest = hashlib.md5(out).hexdigest()
assert digest == '3139690363a9edf4c03d553b36a37fe6'
2 changes: 1 addition & 1 deletion tests/test_capture.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_clut.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

"""
Expand Down
6 changes: 3 additions & 3 deletions tests/test_emulator.py
@@ -1,12 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

"""
Tests for :py:class:`luma.emulator.device.emulator`.
"""

from unittest.mock import patch

from luma.emulator.device import emulator

import pytest
Expand All @@ -15,8 +17,6 @@

from PIL import Image, ImageDraw

from helpers import patch


def test_cleanup():
device = emulator(1, 2, 3, 'RGB', 'none', 6)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gifanim.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_segment_mapper.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transformer.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.

"""
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -2,7 +2,7 @@
# See LICENSE.rst for details.

[tox]
envlist = py{27,35,36,37,38},qa,doc
envlist = py{35,36,37,38},qa,doc
skip_missing_interpreters = True

[testenv]
Expand Down

0 comments on commit 1a0e960

Please sign in to comment.