diff --git a/.gitignore b/.gitignore index 047a2c1..f5b7f4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/html2text/_version.py + *.py[co] *.bak build diff --git a/docs/usage.md b/docs/usage.md index 2a5b78c..f22b56c 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -21,9 +21,9 @@ $ pip install html2text Clone the repository from https://github.com/Alir3z4/html2text ``` -$ git clone --depth 1 https://github.com/Alir3z4/html2text.git -$ python setup.py build -$ python setup.py install +$ git clone --depth 50 https://github.com/Alir3z4/html2text.git +$ python -m build -nwx +$ python -m pip install --upgrade ./dist/*.whl ``` diff --git a/html2text/__init__.py b/html2text/__init__.py index c59ae16..e9dc74f 100644 --- a/html2text/__init__.py +++ b/html2text/__init__.py @@ -9,6 +9,7 @@ from typing import Dict, List, Optional, Tuple, Union from . import config +from ._version import __version_tuple__ as __version__ from .elements import AnchorElement, ListElement from .typing import OutCallback from .utils import ( @@ -27,9 +28,6 @@ unifiable_n, ) -__version__ = (2020, 1, 16) - - # TODO: # Support decoded entities with UNIFIABLE. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8a813b9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "html2text" +description = "Turn HTML into equivalent Markdown-structured text." +readme = "README.md" +authors = [{name = "Aaron Swartz", email = "me@aaronsw.com"}] +maintainers = [{name = "Alireza Savand", email = "alireza.savand@gmail.com"}] +license = {text = "GNU GPL 3"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License (GPL)", + "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", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +urls = {Homepage = "https://github.com/Alir3z4/html2text/"} +requires-python = ">=3.5" +dynamic = ["version"] + +[project.scripts] +html2text = "html2text.cli:main" + +[tool.setuptools] +zip-safe = false +packages = ["html2text"] +platforms = ["OS Independent"] +include-package-data = false + +[tool.setuptools.package-data] +html2text = ["py.typed"] + +[tool.setuptools_scm] +write_to = "html2text/_version.py" + +[tool.flake8] # you will need Flake8-pyproject +max_line_length = "88" +extend-ignore = "E203" + +[tool.isort] +profile = "black" +combine_as_imports = true + +[tool.mypy] +python_version = "3.5" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6ba62eb..0000000 --- a/setup.cfg +++ /dev/null @@ -1,51 +0,0 @@ -[metadata] -name = html2text -version = attr: html2text.__version__ -description = Turn HTML into equivalent Markdown-structured text. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/Alir3z4/html2text/ -author = Aaron Swartz -author_email = me@aaronsw.com -maintainer = Alireza Savand -maintainer_email = alireza.savand@gmail.com -license = GNU GPL 3 -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: GNU General Public License (GPL) - 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 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy -platform = OS Independent - -[options] -zip_safe = False -packages = html2text -python_requires = >=3.5 - -[options.entry_points] -console_scripts = - html2text = html2text.cli:main - -[options.package_data] -html2text = py.typed - -[flake8] -max_line_length = 88 -extend-ignore = E203 - -[isort] -combine_as_imports = True -profile = black - -[mypy] -python_version = 3.5 diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup()