diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..5af0a95 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 95 +ignore = E116,E241,E251 +exclude = .git,.tox,.venv diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 0000000..fb9cc94 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,8 @@ +[extract_messages] +output_file = sphinxcontrib/serializinghtml/locales/sphinxcontrib.serializinghtml.pot +keywords = _ __ + +[compile_catalog] +domain = sphinxcontrib.serializinghtml +directory = sphinxcontrib/serializinghtml/locales/ +use_fuzzy = true diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f56c7d4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,79 @@ +[build-system] +requires = ["flit_core>=3.7"] +build-backend = "flit_core.buildapi" + +# project metadata +[project] +name = "sphinxcontrib-serializinghtml" +description = """sphinxcontrib-serializinghtml is a sphinx extension which \ +outputs "serialized" HTML files (json and pickle)""" +readme = "README.rst" +urls.Changelog = "https://www.sphinx-doc.org/en/master/changes.html" +urls.Code = "https://github.com/sphinx-doc/sphinxcontrib-serializinghtml" +urls.Download = "https://pypi.org/project/sphinxcontrib-serializinghtml/" +urls.Homepage = "https://www.sphinx-doc.org/" +urls."Issue tracker" = "https://github.com/sphinx-doc/sphinx/issues" +license.text = "BSD-2-Clause" +requires-python = ">=3.5" + +# Classifiers list: https://pypi.org/classifiers/ +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Framework :: Sphinx", + "Framework :: Sphinx :: Extension", + "Topic :: Documentation", + "Topic :: Documentation :: Sphinx", + "Topic :: Text Processing", + "Topic :: Utilities", +] +dependencies = [] +dynamic = ["version"] + +[project.optional-dependencies] +test = [ + "pytest", +] +lint = [ + "flake8", + "mypy", + "docutils-stubs", +] + +[[project.authors]] +name = "Georg Brandl" +email = "georg@python.org" + +[tool.flit.module] +name = "sphinxcontrib.serializinghtml" + +[tool.flit.sdist] +include = [ + "CHANGES", + "LICENSE", + # Tests + "tests/", + "tox.ini", +] +exclude = [ + "doc/_build", +] + +[tool.mypy] +ignore_missing_imports = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f346323..0000000 --- a/setup.cfg +++ /dev/null @@ -1,30 +0,0 @@ -[egg_info] -tag_build = .dev -tag_date = true - -[aliases] -release = egg_info -Db '' - -[extract_messages] -output_file = sphinxcontrib/serializinghtml/locales/sphinxcontrib.serializinghtml.pot -keywords = _ __ - -[compile_catalog] -domain = sphinxcontrib.serializinghtml -directory = sphinxcontrib/serializinghtml/locales/ -use_fuzzy = true - -[bdist_wheel] -universal = 1 - -[metadata] -license_file = LICENSE - -[flake8] -max-line-length = 95 -ignore = E116,E241,E251 -exclude = .git,.tox,.venv - -[mypy] -ignore_missing_imports = True -strict_optional = False diff --git a/setup.py b/setup.py deleted file mode 100644 index 8f1b614..0000000 --- a/setup.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -import os -from setuptools import setup, find_packages - -long_desc = ''' -sphinxcontrib-serializinghtml is a sphinx extension which outputs -"serialized" HTML files (json and pickle). -''' - -extras_require = { - 'test': [ - 'pytest', - ], - 'lint': [ - 'flake8', - 'mypy', - 'docutils-stubs', - ], -} - - -def get_version(): - """Get version number of the package from version.py without importing core module.""" - package_dir = os.path.abspath(os.path.dirname(__file__)) - version_file = os.path.join(package_dir, 'sphinxcontrib/serializinghtml/version.py') - - namespace = {} - with open(version_file, 'rt') as f: - exec(f.read(), namespace) - - return namespace['__version__'] - - -setup( - name='sphinxcontrib-serializinghtml', - version=get_version(), - url='http://sphinx-doc.org/', - download_url='https://pypi.org/project/sphinxcontrib-serializinghtml/', - license='BSD', - author='Georg Brandl', - author_email='georg@python.org', - description=long_desc.strip().replace('\n', ' '), - long_description=long_desc, - zip_safe=False, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - 'Intended Audience :: Education', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Framework :: Sphinx', - 'Framework :: Sphinx :: Extension', - 'Topic :: Documentation', - 'Topic :: Documentation :: Sphinx', - 'Topic :: Text Processing', - 'Topic :: Utilities', - ], - platforms='any', - python_requires=">=3.5", - packages=find_packages(exclude=['tests']), - include_package_data=True, - extras_require=extras_require, - namespace_packages=['sphinxcontrib'], -) diff --git a/sphinxcontrib/__init__.py b/sphinxcontrib/__init__.py deleted file mode 100644 index c10210a..0000000 --- a/sphinxcontrib/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -""" - sphinxcontrib - ~~~~~~~~~~~~~ - - This package is a namespace package that contains all extensions - distributed in the ``sphinx-contrib`` distribution. - - :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import pkg_resources - - -pkg_resources.declare_namespace(__name__) diff --git a/sphinxcontrib/serializinghtml/__init__.py b/sphinxcontrib/serializinghtml/__init__.py index c247656..ff800a0 100644 --- a/sphinxcontrib/serializinghtml/__init__.py +++ b/sphinxcontrib/serializinghtml/__init__.py @@ -17,12 +17,14 @@ from sphinx.util.osutil import SEP, copyfile, ensuredir, os_path from sphinxcontrib.serializinghtml import jsonimpl -from sphinxcontrib.serializinghtml.version import __version__ if False: # For type annotation from typing import Any, Dict, Tuple # NOQA +__version__ = '1.1.6' +__version_info__ = (1, 1, 6) + package_dir = path.abspath(path.dirname(__file__)) __ = get_translation(__name__, 'console') diff --git a/sphinxcontrib/serializinghtml/version.py b/sphinxcontrib/serializinghtml/version.py deleted file mode 100644 index a69a9e7..0000000 --- a/sphinxcontrib/serializinghtml/version.py +++ /dev/null @@ -1,10 +0,0 @@ -""" - sphinxcontrib.serializinghtml.version - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - :copyright: Copyright 2007-2019 by the Sphinx team, see README. - :license: BSD, see LICENSE for details. -""" - -__version__ = '1.1.6' -__version_info__ = tuple(map(int, __version__.split('.')))