Skip to content

Commit b81bf17

Browse files
authored
Switch from setup.py to pyproject.toml (#1324)
1 parent 4a7b935 commit b81bf17

File tree

9 files changed

+98
-151
lines changed

9 files changed

+98
-151
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
python-version: 3.7
1818
- name: Install dependencies
1919
run: |
20-
python -m pip install --upgrade pip setuptools wheel
20+
python -m pip install --upgrade pip setuptools wheel build
2121
- name: Build
2222
run: |
23-
python setup.py bdist_wheel sdist --formats gztar
23+
python -m build
2424
- name: Publish
2525
if: success()
2626
uses: pypa/[email protected]

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
recursive-include markdown *.py
22
recursive-include docs *
33
recursive-include tests *.txt *.html *.py
4-
include setup.py
5-
include setup.cfg
64
include makefile
75
include LICENSE.md
86
include README.md

docs/change_log/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ title: Change Log
33
Python-Markdown Change Log
44
=========================
55

6-
*under development*: version 3.4.1 (a bug-fix release).
6+
*under development*: version 3.4.2 (a bug-fix release).
77

88
* Improve standalone * and _ parsing (#1300).
99
* Consider `<html>` HTML tag a block-level element (#1309).
10-
* Officially support for Python 3.11.
10+
* Officially support Python 3.11.
11+
* Switch from `setup.py` to `pyproject.toml`.
1112

1213
July 15, 2022: version 3.4.1 (a bug-fix release).
1314

makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ help:
88
@echo ' install Install Python-Markdown locally'
99
@echo ' deploy Register and upload a new release to PyPI'
1010
@echo ' build Build a source distribution'
11-
@echo ' build-win Build a Windows exe distribution'
1211
@echo ' docs Build documentation'
1312
@echo ' test Run all tests'
1413
@echo ' clean Clean up the source directories'
@@ -21,18 +20,14 @@ install:
2120
deploy:
2221
rm -rf build
2322
rm -rf dist
24-
python setup.py bdist_wheel sdist --formats gztar
23+
python -m build
2524
twine upload dist/*
2625

2726
.PHONY : build
2827
build:
2928
rm -rf build
3029
rm -rf dist
31-
python setup.py bdist_wheel sdist --formats gztar
32-
33-
.PHONY : build-win
34-
build-win:
35-
python setup.py bdist_wininst
30+
python -m build
3631

3732
.PHONY : docs
3833
docs:

markdown/__meta__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# (1, 2, 0, 'beta', 2) => "1.2b2"
2727
# (1, 2, 0, 'rc', 4) => "1.2rc4"
2828
# (1, 2, 0, 'final', 0) => "1.2"
29-
__version_info__ = (3, 4, 1, 'final', 0)
29+
__version_info__ = (3, 4, 2, 'dev', 0)
3030

3131

3232
def _get_version(version_info):

pyproject.toml

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,90 @@
11
[build-system]
22
# Minimum requirements for the build system to execute.
3-
requires = ["setuptools>=36.6", "wheel"]
3+
requires = ["setuptools>=61.2", "wheel"]
44
build-backend = "setuptools.build_meta"
5+
6+
[project]
7+
name = 'Markdown'
8+
dynamic = ['version']
9+
description = "Python implementation of John Gruber's Markdown."
10+
readme = {file = 'README.md', content-type='text/markdown'}
11+
authors = [
12+
{name = 'Manfred Stienstra'},
13+
{name = 'Yuri Takhteyev'},
14+
{name = 'Waylan limberg', email = '[email protected]'}
15+
]
16+
maintainers = [
17+
{name = 'Waylan Limberg', email = '[email protected]'},
18+
{name = 'Isaac Muse'}
19+
]
20+
license = {file = 'LICENSE.md'}
21+
requires-python = '>=3.7'
22+
dependencies = [
23+
"importlib-metadata>=4.4;python_version<'3.10'"
24+
]
25+
keywords = ['markdown', 'markdown-parser', 'python-markdown', 'markdown-to-html']
26+
classifiers = [
27+
'Development Status :: 5 - Production/Stable',
28+
'License :: OSI Approved :: BSD License',
29+
'Operating System :: OS Independent',
30+
'Programming Language :: Python',
31+
'Programming Language :: Python :: 3',
32+
'Programming Language :: Python :: 3.7',
33+
'Programming Language :: Python :: 3.8',
34+
'Programming Language :: Python :: 3.9',
35+
'Programming Language :: Python :: 3.10',
36+
'Programming Language :: Python :: 3.11',
37+
'Programming Language :: Python :: 3 :: Only',
38+
'Programming Language :: Python :: Implementation :: CPython',
39+
'Programming Language :: Python :: Implementation :: PyPy',
40+
'Topic :: Communications :: Email :: Filters',
41+
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
42+
'Topic :: Internet :: WWW/HTTP :: Site Management',
43+
'Topic :: Software Development :: Documentation',
44+
'Topic :: Software Development :: Libraries :: Python Modules',
45+
'Topic :: Text Processing :: Filters',
46+
'Topic :: Text Processing :: Markup :: HTML',
47+
'Topic :: Text Processing :: Markup :: Markdown'
48+
]
49+
50+
[project.optional-dependencies]
51+
testing = [
52+
'coverage',
53+
'pyyaml',
54+
]
55+
56+
[project.urls]
57+
'Homepage' = 'https://Python-Markdown.github.io/'
58+
'Documentation' = 'https://Python-Markdown.github.io/'
59+
'Repository' = 'https://github.com/Python-Markdown/markdown'
60+
'Issue Tracker' = 'https://github.com/Python-Markdown/markdown/issues'
61+
'Changelog' = 'https://github.com/Python-Markdown/markdown/blob/master/docs/change_log/index.md'
62+
63+
[project.entry-points.scripts]
64+
markdown_py = 'markdown.__main__:run'
65+
66+
[project.entry-points.'markdown.extensions']
67+
abbr = 'markdown.extensions.abbr:AbbrExtension'
68+
admonition = 'markdown.extensions.admonition:AdmonitionExtension'
69+
attr_list = 'markdown.extensions.attr_list:AttrListExtension'
70+
codehilite = 'markdown.extensions.codehilite:CodeHiliteExtension'
71+
def_list = 'markdown.extensions.def_list:DefListExtension'
72+
extra = 'markdown.extensions.extra:ExtraExtension'
73+
fenced_code = 'markdown.extensions.fenced_code:FencedCodeExtension'
74+
footnotes = 'markdown.extensions.footnotes:FootnoteExtension'
75+
md_in_html = 'markdown.extensions.md_in_html:MarkdownInHtmlExtension'
76+
meta = 'markdown.extensions.meta:MetaExtension'
77+
nl2br = 'markdown.extensions.nl2br:Nl2BrExtension'
78+
sane_lists = 'markdown.extensions.sane_lists:SaneListExtension'
79+
smarty = 'markdown.extensions.smarty:SmartyExtension'
80+
tables = 'markdown.extensions.tables:TableExtension'
81+
toc = 'markdown.extensions.toc:TocExtension'
82+
wikilinks = 'markdown.extensions.wikilinks:WikiLinkExtension'
83+
legacy_attrs = 'markdown.extensions.legacy_attrs:LegacyAttrExtension'
84+
legacy_em = 'markdown.extensions.legacy_em:LegacyEmExtension'
85+
86+
[tool.setuptools]
87+
packages = ['markdown', 'markdown.extensions']
88+
89+
[tool.setuptools.dynamic]
90+
version = {attr = 'markdown.__meta__.__version__'}

setup.cfg

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

setup.py

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

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ isolated_build = True
55
[testenv]
66
extras = testing
77
deps = pytidylib
8+
allowlist_externals = coverage
89
commands =
910
coverage run --source=markdown -m unittest discover {toxinidir}/tests
1011
coverage xml
@@ -20,7 +21,8 @@ deps =
2021

2122
[testenv:flake8]
2223
deps = flake8
23-
commands = flake8 {toxinidir}/markdown {toxinidir}/tests {toxinidir}/setup.py
24+
allowlist_externals = flake8
25+
commands = flake8 {toxinidir}/markdown {toxinidir}/tests
2426
skip_install = true
2527

2628
[testenv:checkspelling]

0 commit comments

Comments
 (0)