Skip to content

Commit c077df1

Browse files
committed
Use modern pyproject based packaging
1 parent ced6378 commit c077df1

File tree

5 files changed

+62
-114
lines changed

5 files changed

+62
-114
lines changed

pyproject.toml

Lines changed: 60 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,60 @@
1-
# -*- coding: utf-8 -*-
2-
import os
3-
from setuptools import setup, find_packages
4-
5-
long_desc = '''
6-
sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files.
7-
'''
8-
9-
extras_require = {
10-
'test': [
11-
'pytest',
12-
'html5lib',
13-
],
14-
'lint': [
15-
'flake8',
16-
'mypy',
17-
'types-setuptools',
18-
'docutils-stubs',
19-
]
20-
}
21-
22-
23-
def get_version():
24-
"""Get version number of the package from version.py without importing core module."""
25-
package_dir = os.path.abspath(os.path.dirname(__file__))
26-
version_file = os.path.join(package_dir, 'sphinxcontrib/htmlhelp/version.py')
27-
28-
namespace = {}
29-
with open(version_file, 'rt') as f:
30-
exec(f.read(), namespace)
31-
32-
return namespace['__version__']
33-
34-
35-
setup(
36-
name='sphinxcontrib-htmlhelp',
37-
version=get_version(),
38-
url='http://sphinx-doc.org/',
39-
download_url='https://pypi.org/project/sphinxcontrib-htmlhelp/',
40-
license='BSD',
41-
author='Georg Brandl',
42-
author_email='georg@python.org',
43-
description="sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files",
44-
long_description=long_desc,
45-
long_description_content_type='text/x-rst',
46-
zip_safe=False,
47-
classifiers=[
48-
'Development Status :: 5 - Production/Stable',
49-
'Environment :: Console',
50-
'Environment :: Web Environment',
51-
'Intended Audience :: Developers',
52-
'Intended Audience :: Education',
53-
'License :: OSI Approved :: BSD License',
54-
'Operating System :: OS Independent',
55-
'Programming Language :: Python',
56-
'Programming Language :: Python :: 3',
57-
'Programming Language :: Python :: 3.6',
58-
'Programming Language :: Python :: 3.7',
59-
'Programming Language :: Python :: 3.8',
60-
'Programming Language :: Python :: 3.9',
61-
'Framework :: Sphinx',
62-
'Framework :: Sphinx :: Extension',
63-
'Topic :: Documentation',
64-
'Topic :: Documentation :: Sphinx',
65-
'Topic :: Text Processing',
66-
'Topic :: Utilities',
67-
],
68-
platforms='any',
69-
python_requires=">=3.6",
70-
packages=find_packages(exclude=['tests']),
71-
include_package_data=True,
72-
extras_require=extras_require,
73-
namespace_packages=['sphinxcontrib'],
74-
)
1+
[build-system]
2+
requires = ["setuptools>=64"]
3+
build-backend = "setuptools.build_meta"
4+
5+
# project metadata
6+
[project]
7+
name = "sphinxcontrib-htmlhelp"
8+
description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files"
9+
readme = "README.rst"
10+
urls.Changelog = "https://www.sphinx-doc.org/en/master/changes.html"
11+
urls.Code = "https://github.com/sphinx-doc/sphinxcontrib-htmlhelp"
12+
urls.Download = "https://pypi.org/project/sphinxcontrib-htmlhelp/"
13+
urls.Homepage = "https://www.sphinx-doc.org/"
14+
urls."Issue tracker" = "https://github.com/sphinx-doc/sphinx/issues"
15+
license.text = "BSD-2-Clause"
16+
requires-python = ">=3.6"
17+
18+
# Classifiers list: https://pypi.org/classifiers/
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: Console",
22+
"Environment :: Web Environment",
23+
"Intended Audience :: Developers",
24+
"Intended Audience :: Education",
25+
"License :: OSI Approved :: BSD License",
26+
"Operating System :: OS Independent",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.6",
31+
"Programming Language :: Python :: 3.7",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
34+
"Framework :: Sphinx",
35+
"Framework :: Sphinx :: Extension",
36+
"Topic :: Documentation",
37+
"Topic :: Documentation :: Sphinx",
38+
"Topic :: Text Processing",
39+
"Topic :: Utilities",
40+
]
41+
dependencies = []
42+
dynamic = ["version"]
43+
44+
[project.optional-dependencies]
45+
test = [
46+
"pytest",
47+
"html5lib",
48+
]
49+
lint = [
50+
"flake8",
51+
"mypy",
52+
"docutils-stubs",
53+
]
54+
55+
[[project.authors]]
56+
name = "Georg Brandl"
57+
email = "georg@python.org"
58+
59+
[tool.setuptools.dynamic]
60+
version.attr = "sphinxcontrib.htmlhelp.__version__"

setup.cfg

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
[egg_info]
2-
tag_build = .dev
3-
tag_date = true
4-
5-
[aliases]
6-
release = egg_info -Db ''
7-
81
[extract_messages]
92
output_file = sphinxcontrib/htmlhelp/locales/sphinxcontrib.htmlhelp.pot
103
keywords = _ __
@@ -14,12 +7,6 @@ domain = sphinxcontrib.htmlhelp
147
directory = sphinxcontrib/htmlhelp/locales/
158
use_fuzzy = true
169

17-
[bdist_wheel]
18-
universal = 1
19-
20-
[metadata]
21-
license_file = LICENSE
22-
2310
[flake8]
2411
max-line-length = 95
2512
ignore = E116,E241,E251

sphinxcontrib/__init__.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

sphinxcontrib/htmlhelp/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
from sphinx.util.template import SphinxRenderer
3131
from sphinx.writers.html import HTMLTranslator
3232

33-
from sphinxcontrib.htmlhelp.version import __version__
34-
33+
__version__ = '2.0.1'
34+
__version_info__ = (2, 0, 1)
3535

3636
logger = logging.getLogger(__name__)
3737
__ = get_translation(__name__, 'console')

sphinxcontrib/htmlhelp/version.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)