Skip to content

Commit b1a74b4

Browse files
authored
🔧 MAINTAIN: Switch to declarative metadata (#139)
1 parent 36c386d commit b1a74b4

File tree

6 files changed

+98
-84
lines changed

6 files changed

+98
-84
lines changed

.flake8

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

.mypy.ini

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

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@ repos:
4444
hooks:
4545
- id: mypy
4646
additional_dependencies: [attrs]
47+
48+
- repo: https://github.com/asottile/setup-cfg-fmt
49+
rev: v1.16.0
50+
hooks:
51+
- id: setup-cfg-fmt

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools>=46.4.0", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[metadata]
2+
name = markdown_it_py
3+
version = attr: markdown_it.__version__
4+
description = Python port of markdown-it. Markdown parsing, done right!
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown
7+
url = https://github.com/executablebooks/markdown-it-py
8+
author = Chris Sewell
9+
author_email = [email protected]
10+
license = MIT
11+
license_file = LICENSE
12+
classifiers =
13+
Development Status :: 3 - Alpha
14+
Intended Audience :: Developers
15+
License :: OSI Approved :: MIT License
16+
Programming Language :: Python :: 3
17+
Programming Language :: Python :: 3.6
18+
Programming Language :: Python :: 3.7
19+
Programming Language :: Python :: 3.8
20+
Programming Language :: Python :: 3.9
21+
Programming Language :: Python :: Implementation :: CPython
22+
Programming Language :: Python :: Implementation :: PyPy
23+
Topic :: Software Development :: Libraries :: Python Modules
24+
Topic :: Text Processing :: Markup
25+
keywords = markdown lexer parser development
26+
project_urls =
27+
Documentation=https://markdown-it-py.readthedocs.io
28+
29+
[options]
30+
packages = find:
31+
install_requires =
32+
attrs>=19,<21
33+
mdit-py-plugins~=0.2.6
34+
python_requires = ~=3.6
35+
include_package_data = True
36+
zip_safe = False
37+
38+
[options.entry_points]
39+
console_scripts =
40+
markdown-it = markdown_it.cli.parse:main
41+
42+
[options.extras_require]
43+
code_style =
44+
pre-commit==2.6
45+
compare =
46+
commonmark~=0.9.1
47+
markdown~=3.2.2
48+
mistletoe-ebp~=0.10.0
49+
mistune~=0.8.4
50+
panflute~=1.12
51+
linkify =
52+
linkify-it-py~=1.0
53+
rtd =
54+
myst-nb~=0.11.1
55+
pyyaml
56+
sphinx>=2,<4
57+
sphinx-copybutton
58+
sphinx-panels~=0.4.0
59+
sphinx_book_theme
60+
testing =
61+
coverage
62+
psutil
63+
pytest>=3.6,<4
64+
pytest-benchmark~=3.2
65+
pytest-cov
66+
pytest-regressions
67+
68+
[options.packages.find]
69+
exclude =
70+
test*
71+
benchmarking
72+
73+
[mypy]
74+
show_error_codes = True
75+
warn_unused_ignores = True
76+
warn_redundant_casts = True
77+
no_implicit_optional = True
78+
strict_equality = True
79+
80+
[mypy-tests.test_plugins.*]
81+
ignore_errors = True
82+
83+
[flake8]
84+
max-line-length = 100
85+
extend-ignore = E203

setup.py

Lines changed: 5 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,6 @@
1-
# from importlib import import_module
2-
from os import path
3-
import re
4-
from setuptools import find_packages, setup
1+
# This file is needed for editable installs (`pip install -e .`).
2+
# Can be removed once the following is resolved
3+
# https://github.com/pypa/packaging-problems/issues/256
4+
from setuptools import setup
55

6-
7-
def get_version():
8-
text = open(path.join(path.dirname(__file__), "markdown_it", "__init__.py")).read()
9-
match = re.compile(r"^__version__\s*\=\s*[\"\']([^\s\'\"]+)", re.M).search(text)
10-
return match.group(1)
11-
12-
13-
setup(
14-
name="markdown-it-py",
15-
version=get_version(),
16-
description="Python port of markdown-it. Markdown parsing, done right!",
17-
long_description=open("README.md").read(),
18-
long_description_content_type="text/markdown",
19-
url="https://github.com/executablebooks/markdown-it-py",
20-
project_urls={"Documentation": "https://markdown-it-py.readthedocs.io"},
21-
author="Chris Sewell",
22-
author_email="[email protected]",
23-
license="MIT",
24-
packages=find_packages(exclude=["test*", "benchmarking"]),
25-
include_package_data=True,
26-
entry_points={"console_scripts": ["markdown-it = markdown_it.cli.parse:main"]},
27-
classifiers=[
28-
"Development Status :: 3 - Alpha",
29-
"Intended Audience :: Developers",
30-
"License :: OSI Approved :: MIT License",
31-
"Programming Language :: Python :: 3",
32-
"Programming Language :: Python :: 3.6",
33-
"Programming Language :: Python :: 3.7",
34-
"Programming Language :: Python :: 3.8",
35-
"Programming Language :: Python :: 3.9",
36-
"Programming Language :: Python :: Implementation :: CPython",
37-
"Programming Language :: Python :: Implementation :: PyPy",
38-
"Topic :: Software Development :: Libraries :: Python Modules",
39-
"Topic :: Text Processing :: Markup",
40-
],
41-
keywords="markdown lexer parser development",
42-
python_requires="~=3.6",
43-
install_requires=["attrs>=19,<21", "mdit-py-plugins~=0.2.6"],
44-
extras_require={
45-
"code_style": ["pre-commit==2.6"],
46-
"testing": [
47-
"coverage",
48-
"pytest>=3.6,<4",
49-
"pytest-cov",
50-
"pytest-regressions",
51-
"pytest-benchmark~=3.2",
52-
"psutil",
53-
],
54-
"rtd": [
55-
"myst-nb~=0.11.1",
56-
"sphinx_book_theme",
57-
"sphinx-panels~=0.4.0",
58-
"sphinx-copybutton",
59-
"sphinx>=2,<4",
60-
"pyyaml",
61-
],
62-
"compare": [
63-
"commonmark~=0.9.1",
64-
"markdown~=3.2.2",
65-
"mistune~=0.8.4",
66-
# "mistletoe~=0.7.2",
67-
"mistletoe-ebp~=0.10.0",
68-
"panflute~=1.12",
69-
],
70-
"linkify": ["linkify-it-py~=1.0"],
71-
},
72-
zip_safe=False,
73-
)
6+
setup()

0 commit comments

Comments
 (0)