From 029dc917f3c431d22003536988e42bd97eb8920b Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 16 Dec 2021 00:35:33 -0600 Subject: [PATCH] Upgrade packaging to PEP 517 & setup.cfg and update metadata --- docrepr/__init__.py | 2 +- docrepr/_version.py | 2 -- pyproject.toml | 6 +++++ setup.cfg | 63 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 37 ++++---------------------- 5 files changed, 75 insertions(+), 35 deletions(-) delete mode 100644 docrepr/_version.py create mode 100644 pyproject.toml create mode 100644 setup.cfg diff --git a/docrepr/__init__.py b/docrepr/__init__.py index 05bf19a..0721012 100644 --- a/docrepr/__init__.py +++ b/docrepr/__init__.py @@ -14,7 +14,7 @@ Derived from spyderlib.utils.inspector and IPython.core.oinspect """ -from ._version import version_info, __version__ +__version__ = '0.2.0.dev0' # Configuration options for docrepr options = { diff --git a/docrepr/_version.py b/docrepr/_version.py deleted file mode 100644 index 5671b7e..0000000 --- a/docrepr/_version.py +++ /dev/null @@ -1,2 +0,0 @@ -version_info = (0, 2, 0, 'dev0') -__version__ = '.'.join(map(str, version_info)) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f6c1689 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", +] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..07f119d --- /dev/null +++ b/setup.cfg @@ -0,0 +1,63 @@ +[metadata] +name = docrepr +version = attr: docrepr.__version__ +description = Renders Python docstrings to rich HTML +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/spyder-ide/docrepr +author = Tim Dumol and the Spyder Development Team +author_email = spyder.python@gmail.com +maintainer = Spyder Development Team and Docrepr Contributors +maintainer_email = spyder.python@gmail.com +license = BSD-3-clause +license_file = LICENSE.txt +license_files = + AUTHORS.md + LICENSE.txt +classifiers = + Development Status :: 4 - Beta + Environment :: Web Environment + Framework :: IPython + Framework :: Jupyter + Framework :: Matplotlib + Framework :: Sphinx + Intended Audience :: Developers + Intended Audience :: Science/Research + License :: OSI Approved :: BSD License + Operating System :: OS Independent + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Topic :: Documentation :: Sphinx + Topic :: Scientific/Engineering :: Visualization + Topic :: Software Development :: Documentation + Topic :: Software Development :: Libraries :: Python Modules + Topic :: Text Processing :: Markup :: reStructuredText + Topic :: Utilities +keywords = Sphinx docstrings renderer HTML Spyder IPython help formatter +project_urls = + Github = https://github.com/spyder-ide/docrepr + Bug Tracker = https://github.com/spyder-ide/docrepr/issues + Parent Project = https://www.spyder-ide.org/ + +[options] +packages = find: +install_requires = + docutils + jinja2 + sphinx>=1.1 +python_requires = >=3.6 +include_package_data = True +zip_safe = False + +[options.extras_require] +plot = + matplotlib>=2.2.4 +test = + ipython + matplotlib>=2.2.4 + numpy + pytest>=6.0.0 diff --git a/setup.py b/setup.py index 8d5dc55..de11cff 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,8 @@ -from setuptools import setup, find_packages -import os +#!/usr/bin/env python3 -name = 'docrepr' -here = os.path.abspath(os.path.dirname(__file__)) +"""Stub setup.py for use with legacy build tooling.""" -version_ns = {} -with open(os.path.join(here, name, '_version.py')) as f: - exec(f.read(), {}, version_ns) +import setuptools -setup( - name=name, - version=version_ns['__version__'], - description='docrepr renders Python docstrings in HTML', - long_description='docrepr renders Python docstrings in HTML. It is based on the sphinxify module developed by Tim Dumol for the Sage Notebook and the utils.inspector developed for ther Spyder IDE.', - packages=find_packages(), - include_package_data=True, - python_requires='>=3.6', - install_requires=['docutils', 'jinja2', 'sphinx>=1.1'], - extras_require={ - 'plot': [ - 'matplotlib>=2.2.4', - ], - 'test': [ - 'ipython', - 'matplotlib>=2.2.4', - 'numpy', - 'pytest>=6', - ], - }, - url='https://github.com/spyder-ide/docrepr', - author='Tim Dumol / The Spyder Development Team', - maintainer='The Spyder Development Team', - license='BSD', -) +if __name__ == "__main__": + setuptools.setup()