From 790e55e09194a8ab98a4265857e52e0ae072f32a Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Sat, 9 Aug 2025 23:53:42 +0100 Subject: [PATCH 1/2] Convert setup.py to pyproject.toml --- pyproject.toml | 36 +++++++++++++++++++++++ setup.py | 78 -------------------------------------------------- 2 files changed, 36 insertions(+), 78 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..22215a9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "spyder-unittest" +description = "Plugin to run tests from within the Spyder IDE" +readme = "README.md" +requires-python = ">=3.9" +license = "MIT" +license-files = ["LICENSE.txt"] +authors = [{name = "Spyder Project Contributors"}] +keywords = ["Qt", "PyQt5", "PyQt6", "spyder", "plugins", "testing"] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: X11 Applications :: Qt", + "Environment :: Win32 (MS Windows)", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Testing", + "Topic :: Text Editors :: Integrated Development Environments (IDE)" +] +urls = {source = "https://github.com/spyder-ide/spyder-unittest"} +dependencies = ["lxml", "spyder>=6,<7", "pyzmq"] +dynamic = ["version"] + +[project.entry-points."spyder.plugins"] +unittest = "spyder_unittest.unittestplugin:UnitTestPlugin" + +[tool.setuptools.dynamic] +version = {attr = "spyder_unittest.__version__"} diff --git a/setup.py b/setup.py deleted file mode 100644 index 8710cbc..0000000 --- a/setup.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright © 2013 Spyder Project Contributors -# Licensed under the terms of the MIT License -# (see LICENSE.txt for details) - -""" -Setup script for spyder_unittest -""" - -from setuptools import setup, find_packages -import os -import os.path as osp - - -def get_version(): - """Get version from source file""" - import codecs - with codecs.open("spyder_unittest/__init__.py", encoding="utf-8") as f: - lines = f.read().splitlines() - for l in lines: - if "__version__" in l: - version = l.split("=")[1].strip() - version = version.replace("'", '').replace('"', '') - return version - -def get_package_data(name, extlist): - """Return data files for package *name* with extensions in *extlist*""" - flist = [] - # Workaround to replace os.path.relpath (not available until Python 2.6): - offset = len(name) + len(os.pathsep) - for dirpath, _dirnames, filenames in os.walk(name): - for fname in filenames: - if not fname.startswith('.') and osp.splitext(fname)[1] in extlist: - flist.append(osp.join(dirpath, fname)[offset:]) - return flist - - -# Requirements -REQUIREMENTS = ['lxml', 'spyder>=6,<7', 'pyzmq'] -EXTLIST = ['.jpg', '.png', '.json', '.mo', '.ini'] -LIBNAME = 'spyder_unittest' - - -LONG_DESCRIPTION = """ -This is a plugin for the Spyder IDE that integrates popular unit test -frameworks. It allows you to run tests and view the results. - -The plugin supports the `unittest` framework in the Python -standard library and the `pytest` and `nose2` testing frameworks. -""" - -setup( - name=LIBNAME, - version=get_version(), - packages=find_packages(), - package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST)}, - keywords=["Qt PyQt4 PyQt5 spyder plugins testing"], - python_requires='>=3.8', - install_requires=REQUIREMENTS, - url='https://github.com/spyder-ide/spyder-unittest', - license='MIT', - author="Spyder Project Contributors", - description='Plugin to run tests from within the Spyder IDE', - long_description=LONG_DESCRIPTION, - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: X11 Applications :: Qt', - 'Environment :: Win32 (MS Windows)', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Topic :: Software Development :: Testing', - 'Topic :: Text Editors :: Integrated Development Environments (IDE)'], - entry_points={ - 'spyder.plugins': [ - 'unittest = spyder_unittest.unittestplugin:UnitTestPlugin']}) From b29eb14eff07e2cdfa8fe7892be45652c06c1e01 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Sun, 10 Aug 2025 00:02:42 +0100 Subject: [PATCH 2/2] Remove setup.cfg because no longer necessary --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index cd79d6f..0000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[tool:pytest] -# Do not collect any classes -python_classes=