diff --git a/noxfile.py b/noxfile.py index da20ed0a..b260ffa8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -27,9 +27,6 @@ def test(session): """\ Run test suite. """ - import platform - if platform.python_version()[:4] == '3.12': - session.install('setuptools') #TODO: Remove this, see issue session.install('-Ur', 'tests/requirements.txt') session.install('.') session.run('py.test') diff --git a/pyproject.toml b/pyproject.toml index 61082b20..6f609c2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,9 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities", ] +dependencies = [ + "importlib-metadata>=3.6.0; python_version < '3.8'", +] [project.urls] "Homepage" = "https://github.com/heuer/segno/" diff --git a/tests/requirements.txt b/tests/requirements.txt index d8080169..543a54fc 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -3,3 +3,5 @@ pytest pytest-cov pypng~=0.0.20 pyzbar~=0.1.8 +qrcode-artistic +Pillow diff --git a/tests/test_plugin.py b/tests/test_plugin.py index ff24cf89..30465481 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -8,9 +8,7 @@ """\ Tests plugin loading. """ -from __future__ import absolute_import, unicode_literals import os -import pkg_resources import pytest import segno @@ -21,22 +19,9 @@ def test_noplugin(): qr.to_unknown_plugin() -def an_example_plugin(qrcode): - """\ - This is a Segno converter plugin used by the next test case. - """ - assert qrcode - return 'works' - - def test_plugin(): - distribution = pkg_resources.Distribution(os.path.dirname(__file__)) - entry_point = pkg_resources.EntryPoint.parse('test = test_plugin:an_example_plugin', dist=distribution) - distribution._ep_map = {'segno.plugin.converter': {'test': entry_point}} - pkg_resources.working_set.add(distribution) - qr = segno.make('The Beatles') - assert 'works' == qr.to_test() + assert qr.to_pil() is not None if __name__ == '__main__':