Skip to content

Commit

Permalink
Adopt PEP-621 (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Jan 14, 2023
1 parent 3187378 commit d076fa2
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 67 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
format = pylint
# E203: https://github.com/python/black/issues/315
ignore = E741,W503,W504,H,E501,E203,D
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coverage_html_report
.coverage
docs/source/_build
man/ansi2html.1.xml
src/ansi2html/_version.py
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ include LICENSE
include man/asciidoc.conf
include man/ansi2html.1
include man/ansi2html.1.txt
include ansi2html/py.typed
recursive-include tests *
recursive-exclude tests *.pyc
3 changes: 0 additions & 3 deletions ansi2html/__init__.py

This file was deleted.

5 changes: 1 addition & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

from setuptools_scm import get_version
from ansi2html import __version__ as release # mypy: ignore # noqa: 401

# -- Project information -----------------------------------------------------

project = "ansi2html"
copyright = "2021, Ralph Bean, Robin Schneider and various contributors"
author = "Ralph Bean, Robin Schneider and various contributors"

# The full version, including alpha/beta/rc tags
release = get_version(root="../..", relative_to=__file__)

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
Expand Down
58 changes: 58 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,70 @@
requires = ["setuptools >= 45.0.0", "setuptools_scm[toml] >= 7.0.0"]
build-backend = "setuptools.build_meta"

[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.6"
dynamic = ["version"]
name = "ansi2html"
description = "Checks playbooks for practices and behavior that could potentially be improved"
readme = "README.rst"
authors = [{ "name" = "Ralph Bean", "email" = "rbean@redhat.com" }]
maintainers = [{ "name" = "Ralph Bean", "email" = "rbean@redhat.com" }]
license = { text = "LGPLv3+" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: POSIX",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Programming Language :: Python :: 3",
"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 :: Only",
"Programming Language :: Python",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: System :: Systems Administration",
"Topic :: Text Processing :: Markup :: HTML",
"Topic :: Text Processing :: Markup",
"Topic :: Text Processing",
"Topic :: Utilities",
]
keywords = ["ansi", "html", "color"]
dependencies = ['importlib-metadata; python_version<"3.8"']

[project.urls]
homepage = "https://github.com/pycontribs/ansi2html"
documentation = "https://ansi2html.readthedocs.io/"
repository = "https://github.com/pycontribs/ansi2html"
changelog = "https://github.com/pycontribs/ansi2html/releases"

[project.scripts]
ansi2html = "ansi2html.__main__:main"

[project.optional-dependencies]
docs = ["sphinx", "sphinx_rtd_theme"]
test = ["pytest", "pytest-cov"]

[tool.isort]
profile = "black"

[tool.mypy]
warn_return_any = true
warn_unused_configs = true

[[tool.mypy.overrides]]
module = ["ansi2html._version"]
ignore_missing_imports = true
ignore_errors = true

[tool.pylint."MESSAGES CONTROL"]
disable = [
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
Expand Down Expand Up @@ -41,3 +98,4 @@ output-format = "colorized"

[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/ansi2html/_version.py"
59 changes: 0 additions & 59 deletions setup.cfg

This file was deleted.

19 changes: 19 additions & 0 deletions src/ansi2html/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from __future__ import annotations

from ansi2html.converter import Ansi2HTMLConverter

try:
# pyright: reportMissingImport=false
from ansi2html._version import __version__ # mypy: disable
except ImportError: # pragma: no branch

try:
import pkg_resources

__version__ = pkg_resources.get_distribution("ansi2html").version
except Exception: # pylint: disable=broad-except
# this is the fallback SemVer version picked by setuptools_scm when tag
# information is not available.
__version__ = "0.1.dev1"

__all__ = ("Ansi2HTMLConverter", "__version__")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d076fa2

Please sign in to comment.