From 3f7bf6b97a641f1c7f88d511bb2a6270f2149b85 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 1 Nov 2021 14:34:59 -0500 Subject: [PATCH] Port setup metadata from legacy setup.py to declarative setup.cfg --- RELEASE.md | 4 ++-- qtpy/__init__.py | 2 +- qtpy/_version.py | 2 -- setup.cfg | 47 ++++++++++++++++++++++++++++++++++++++++++ setup.py | 53 +++++------------------------------------------- 5 files changed, 55 insertions(+), 53 deletions(-) delete mode 100644 qtpy/_version.py create mode 100644 setup.cfg diff --git a/RELEASE.md b/RELEASE.md index f3d434ce..dca29916 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -10,7 +10,7 @@ To release a new version of qtpy on PyPI: loghub -m vX.X.X spyder-ide/qtpy -* Update `_version.py` (set release version, remove 'dev0') +* Update `__version__` in `__init__.py` (set release version, remove 'dev0') * git add . && git commit -m 'Release X.X.X' @@ -22,7 +22,7 @@ To release a new version of qtpy on PyPI: * git tag -a vX.X.X -m 'Release X.X.X' -* Update `_version.py` (add 'dev0' and increment minor) +* Update `__version__` in `__init__.py` (add 'dev0' and increment minor) * git add . && git commit -m 'Back to work' diff --git a/qtpy/__init__.py b/qtpy/__init__.py index e473274a..d19d660f 100644 --- a/qtpy/__init__.py +++ b/qtpy/__init__.py @@ -61,7 +61,7 @@ import warnings # Version of QtPy -from ._version import __version__ +__version__ = '2.0.0.dev0' class PythonQtError(RuntimeError): diff --git a/qtpy/_version.py b/qtpy/_version.py deleted file mode 100644 index cb9f17f0..00000000 --- a/qtpy/_version.py +++ /dev/null @@ -1,2 +0,0 @@ -version_info = (2, 0, 0, 'dev0') -__version__ = '.'.join(map(str, version_info)) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..91ad1913 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,47 @@ +[metadata] +name = QtPy +version = attr: qtpy.__version__ +description = Provides an abstraction layer on top of the various Qt bindings (PyQt5/6 and PySide2/6) and additional custom QWidgets. +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/spyder-ide/qtpy +author = Colin Duquesnoy and the Spyder Development Team +author_email = spyder.python@gmail.com +maintainer = Spyder Development Team and QtPy Contributors +maintainer_email = spyder.python@gmail.com +license = MIT +license_file = LICENSE.txt +license_files = + AUTHORS.txt + LICENSE.txt +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Win32 (MS Windows) + Environment :: X11 Applications :: Qt + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 +keywords = qt PyQt5 PyQt6 PySide2 PySide6 +project_urls = + Github = https://github.com/r-spacex/submanager + Bug Tracker = https://github.com/r-spacex/submanager/issues + Demo = https://www.reddit.com/r/SpaceX + +[options] +packages = find: +install_requires = + packaging +python_requires = >=3.6 +include_pacakge_data = True +zip_safe = False + +[options.packages.find] +exclude = + contrib + docs + tests* diff --git a/setup.py b/setup.py index 5aacfb6c..de11cffa 100644 --- a/setup.py +++ b/setup.py @@ -1,51 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -""" -Setup script for qtpy -""" +"""Stub setup.py for use with legacy build tooling.""" -import os +import setuptools -from setuptools import setup, find_packages - -HERE = os.path.abspath(os.path.dirname(__file__)) - -version_ns = {} -with open(os.path.join(HERE, 'qtpy', '_version.py')) as f: - exec(f.read(), {}, version_ns) - -with open(os.path.join(HERE, 'README.md'), encoding='utf-8') as f: - LONG_DESCRIPTION = f.read() - -setup( - name='QtPy', - version=version_ns['__version__'], - packages=find_packages(exclude=['contrib', 'docs', 'tests*']), - python_requires='>=3.6', - install_requires=['packaging'], - keywords=["qt PyQt5 PyQt6 PySide2 PySide6"], - url='https://github.com/spyder-ide/qtpy', - license='MIT', - author='Colin Duquesnoy and the Spyder Development Team', - author_email='spyder.python@gmail.com', - maintainer='Spyder Development Team and QtPy Contributors', - maintainer_email='spyder.python@gmail.com', - description='Provides an abstraction layer on top of the various Qt ' - 'bindings (PyQt5/6 and PySide2/6) and additional custom ' - 'QWidgets.', - long_description=LONG_DESCRIPTION, - long_description_content_type='text/markdown', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: X11 Applications :: Qt', - 'Environment :: Win32 (MS Windows)', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - ] -) +if __name__ == "__main__": + setuptools.setup()