Skip to content

Commit

Permalink
Use modern pyproject based packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jan 7, 2023
1 parent 5907799 commit b11afda
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 116 deletions.
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

130 changes: 63 additions & 67 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,67 +1,63 @@
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages

long_desc = '''
sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books
'''

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/applehelp/version.py')

namespace = {}
with open(version_file, 'rt') as f:
exec(f.read(), namespace)

return namespace['__version__']


setup(
name='sphinxcontrib-applehelp',
version=get_version(),
url='http://sphinx-doc.org/',
download_url='https://pypi.org/project/sphinxcontrib-applehelp/',
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',
'Framework :: Sphinx',
'Framework :: Sphinx :: Extension',
'Topic :: Documentation',
'Topic :: Documentation :: Sphinx',
'Topic :: Text Processing',
'Topic :: Utilities',
],
platforms='any',
python_requires=">=3.7",
packages=find_packages(exclude=['tests']),
include_package_data=True,
extras_require=extras_require,
namespace_packages=['sphinxcontrib'],
)
[build-system]
requires = ["flit_core>=3.7"]
build-backend = "flit_core.buildapi"

# project metadata
[project]
name = "sphinxcontrib.applehelp"
description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books"
readme = "README.rst"
urls.Changelog = "https://www.sphinx-doc.org/en/master/changes.html"
urls.Code = "https://github.com/sphinx-doc/sphinxcontrib-applehelp"
urls.Download = "https://pypi.org/project/sphinxcontrib-applehelp/"
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.8"

# 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",
"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.sdist]
include = [
"LICENSE",
"CHANGES",
# Tests
"tests/",
"tox.ini",
]
exclude = [
"doc/_build",
]
13 changes: 0 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
[egg_info]
tag_build = .dev
tag_date = true

[aliases]
release = egg_info -Db ''

[extract_messages]
output_file = sphinxcontrib/applehelp/locales/sphinxcontrib.applehelp.pot
keywords = _ __
Expand All @@ -14,12 +7,6 @@ domain = sphinxcontrib.applehelp
directory = sphinxcontrib/applehelp/locales/
use_fuzzy = true

[bdist_wheel]
universal = 1

[metadata]
license_file = LICENSE

[flake8]
max-line-length = 95
ignore = E116,E241,E251
Expand Down
15 changes: 0 additions & 15 deletions sphinxcontrib/__init__.py

This file was deleted.

5 changes: 3 additions & 2 deletions sphinxcontrib/applehelp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
from sphinx.util.matching import Matcher
from sphinx.util.osutil import ensuredir, make_filename

from sphinxcontrib.applehelp.version import __version__

if sphinx.version_info[:2] >= (6, 1):
from sphinx.util.display import SkipProgressMessage, progress_message
else:
from sphinx.util import SkipProgressMessage, progress_message

__version__ = '1.0.3'
__version_info__ = (1, 0, 3)

package_dir = path.abspath(path.dirname(__file__))
template_dir = path.join(package_dir, 'templates')

Expand Down
10 changes: 0 additions & 10 deletions sphinxcontrib/applehelp/version.py

This file was deleted.

0 comments on commit b11afda

Please sign in to comment.