Skip to content

Commit d076fa2

Browse files
authored
Adopt PEP-621 (#198)
1 parent 3187378 commit d076fa2

File tree

13 files changed

+83
-67
lines changed

13 files changed

+83
-67
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
format = pylint
3+
# E203: https://github.com/python/black/issues/315
4+
ignore = E741,W503,W504,H,E501,E203,D

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ coverage_html_report
1010
.coverage
1111
docs/source/_build
1212
man/ansi2html.1.xml
13+
src/ansi2html/_version.py

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ include LICENSE
33
include man/asciidoc.conf
44
include man/ansi2html.1
55
include man/ansi2html.1.txt
6-
include ansi2html/py.typed
76
recursive-include tests *
87
recursive-exclude tests *.pyc

ansi2html/__init__.py

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

docs/source/conf.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7-
from setuptools_scm import get_version
7+
from ansi2html import __version__ as release # mypy: ignore # noqa: 401
88

99
# -- Project information -----------------------------------------------------
1010

1111
project = "ansi2html"
1212
copyright = "2021, Ralph Bean, Robin Schneider and various contributors"
1313
author = "Ralph Bean, Robin Schneider and various contributors"
1414

15-
# The full version, including alpha/beta/rc tags
16-
release = get_version(root="../..", relative_to=__file__)
17-
1815
# -- General configuration ---------------------------------------------------
1916

2017
# Add any Sphinx extension module names here, as strings. They can be

pyproject.toml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,70 @@
22
requires = ["setuptools >= 45.0.0", "setuptools_scm[toml] >= 7.0.0"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
# https://peps.python.org/pep-0621/#readme
7+
requires-python = ">=3.6"
8+
dynamic = ["version"]
9+
name = "ansi2html"
10+
description = "Checks playbooks for practices and behavior that could potentially be improved"
11+
readme = "README.rst"
12+
authors = [{ "name" = "Ralph Bean", "email" = "[email protected]" }]
13+
maintainers = [{ "name" = "Ralph Bean", "email" = "[email protected]" }]
14+
license = { text = "LGPLv3+" }
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Environment :: Console",
18+
"Intended Audience :: Developers",
19+
"Intended Audience :: System Administrators",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: MacOS",
22+
"Operating System :: POSIX",
23+
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3.6",
26+
"Programming Language :: Python :: 3.7",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3 :: Only",
32+
"Programming Language :: Python",
33+
"Topic :: Software Development :: Quality Assurance",
34+
"Topic :: Software Development :: Testing",
35+
"Topic :: System :: Systems Administration",
36+
"Topic :: Text Processing :: Markup :: HTML",
37+
"Topic :: Text Processing :: Markup",
38+
"Topic :: Text Processing",
39+
"Topic :: Utilities",
40+
]
41+
keywords = ["ansi", "html", "color"]
42+
dependencies = ['importlib-metadata; python_version<"3.8"']
43+
44+
[project.urls]
45+
homepage = "https://github.com/pycontribs/ansi2html"
46+
documentation = "https://ansi2html.readthedocs.io/"
47+
repository = "https://github.com/pycontribs/ansi2html"
48+
changelog = "https://github.com/pycontribs/ansi2html/releases"
49+
50+
[project.scripts]
51+
ansi2html = "ansi2html.__main__:main"
52+
53+
[project.optional-dependencies]
54+
docs = ["sphinx", "sphinx_rtd_theme"]
55+
test = ["pytest", "pytest-cov"]
56+
557
[tool.isort]
658
profile = "black"
759

860
[tool.mypy]
961
warn_return_any = true
1062
warn_unused_configs = true
1163

64+
[[tool.mypy.overrides]]
65+
module = ["ansi2html._version"]
66+
ignore_missing_imports = true
67+
ignore_errors = true
68+
1269
[tool.pylint."MESSAGES CONTROL"]
1370
disable = [
1471
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
@@ -41,3 +98,4 @@ output-format = "colorized"
4198

4299
[tool.setuptools_scm]
43100
local_scheme = "no-local-version"
101+
write_to = "src/ansi2html/_version.py"

setup.cfg

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

src/ansi2html/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import annotations
2+
3+
from ansi2html.converter import Ansi2HTMLConverter
4+
5+
try:
6+
# pyright: reportMissingImport=false
7+
from ansi2html._version import __version__ # mypy: disable
8+
except ImportError: # pragma: no branch
9+
10+
try:
11+
import pkg_resources
12+
13+
__version__ = pkg_resources.get_distribution("ansi2html").version
14+
except Exception: # pylint: disable=broad-except
15+
# this is the fallback SemVer version picked by setuptools_scm when tag
16+
# information is not available.
17+
__version__ = "0.1.dev1"
18+
19+
__all__ = ("Ansi2HTMLConverter", "__version__")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)