Skip to content

Commit

Permalink
Switch from setup.py to pyproject.toml (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
waylan committed Mar 22, 2023
1 parent 4a7b935 commit b81bf17
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 151 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip setuptools wheel build
- name: Build
run: |
python setup.py bdist_wheel sdist --formats gztar
python -m build
- name: Publish
if: success()
uses: pypa/gh-action-pypi-publish@v1.1.0
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
recursive-include markdown *.py
recursive-include docs *
recursive-include tests *.txt *.html *.py
include setup.py
include setup.cfg
include makefile
include LICENSE.md
include README.md
Expand Down
5 changes: 3 additions & 2 deletions docs/change_log/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ title: Change Log
Python-Markdown Change Log
=========================

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

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

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

Expand Down
9 changes: 2 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ help:
@echo ' install Install Python-Markdown locally'
@echo ' deploy Register and upload a new release to PyPI'
@echo ' build Build a source distribution'
@echo ' build-win Build a Windows exe distribution'
@echo ' docs Build documentation'
@echo ' test Run all tests'
@echo ' clean Clean up the source directories'
Expand All @@ -21,18 +20,14 @@ install:
deploy:
rm -rf build
rm -rf dist
python setup.py bdist_wheel sdist --formats gztar
python -m build
twine upload dist/*

.PHONY : build
build:
rm -rf build
rm -rf dist
python setup.py bdist_wheel sdist --formats gztar

.PHONY : build-win
build-win:
python setup.py bdist_wininst
python -m build

.PHONY : docs
docs:
Expand Down
2 changes: 1 addition & 1 deletion markdown/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# (1, 2, 0, 'beta', 2) => "1.2b2"
# (1, 2, 0, 'rc', 4) => "1.2rc4"
# (1, 2, 0, 'final', 0) => "1.2"
__version_info__ = (3, 4, 1, 'final', 0)
__version_info__ = (3, 4, 2, 'dev', 0)


def _get_version(version_info):
Expand Down
88 changes: 87 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,90 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools>=36.6", "wheel"]
requires = ["setuptools>=61.2", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = 'Markdown'
dynamic = ['version']
description = "Python implementation of John Gruber's Markdown."
readme = {file = 'README.md', content-type='text/markdown'}
authors = [
{name = 'Manfred Stienstra'},
{name = 'Yuri Takhteyev'},
{name = 'Waylan limberg', email = 'python.markdown@gmail.com'}
]
maintainers = [
{name = 'Waylan Limberg', email = 'python.markdown@gmail.com'},
{name = 'Isaac Muse'}
]
license = {file = 'LICENSE.md'}
requires-python = '>=3.7'
dependencies = [
"importlib-metadata>=4.4;python_version<'3.10'"
]
keywords = ['markdown', 'markdown-parser', 'python-markdown', 'markdown-to-html']
classifiers = [
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'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 :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Communications :: Email :: Filters',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
'Topic :: Internet :: WWW/HTTP :: Site Management',
'Topic :: Software Development :: Documentation',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Filters',
'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Text Processing :: Markup :: Markdown'
]

[project.optional-dependencies]
testing = [
'coverage',
'pyyaml',
]

[project.urls]
'Homepage' = 'https://Python-Markdown.github.io/'
'Documentation' = 'https://Python-Markdown.github.io/'
'Repository' = 'https://github.com/Python-Markdown/markdown'
'Issue Tracker' = 'https://github.com/Python-Markdown/markdown/issues'
'Changelog' = 'https://github.com/Python-Markdown/markdown/blob/master/docs/change_log/index.md'

[project.entry-points.scripts]
markdown_py = 'markdown.__main__:run'

[project.entry-points.'markdown.extensions']
abbr = 'markdown.extensions.abbr:AbbrExtension'
admonition = 'markdown.extensions.admonition:AdmonitionExtension'
attr_list = 'markdown.extensions.attr_list:AttrListExtension'
codehilite = 'markdown.extensions.codehilite:CodeHiliteExtension'
def_list = 'markdown.extensions.def_list:DefListExtension'
extra = 'markdown.extensions.extra:ExtraExtension'
fenced_code = 'markdown.extensions.fenced_code:FencedCodeExtension'
footnotes = 'markdown.extensions.footnotes:FootnoteExtension'
md_in_html = 'markdown.extensions.md_in_html:MarkdownInHtmlExtension'
meta = 'markdown.extensions.meta:MetaExtension'
nl2br = 'markdown.extensions.nl2br:Nl2BrExtension'
sane_lists = 'markdown.extensions.sane_lists:SaneListExtension'
smarty = 'markdown.extensions.smarty:SmartyExtension'
tables = 'markdown.extensions.tables:TableExtension'
toc = 'markdown.extensions.toc:TocExtension'
wikilinks = 'markdown.extensions.wikilinks:WikiLinkExtension'
legacy_attrs = 'markdown.extensions.legacy_attrs:LegacyAttrExtension'
legacy_em = 'markdown.extensions.legacy_em:LegacyEmExtension'

[tool.setuptools]
packages = ['markdown', 'markdown.extensions']

[tool.setuptools.dynamic]
version = {attr = 'markdown.__meta__.__version__'}
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

133 changes: 0 additions & 133 deletions setup.py

This file was deleted.

4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ isolated_build = True
[testenv]
extras = testing
deps = pytidylib
allowlist_externals = coverage
commands =
coverage run --source=markdown -m unittest discover {toxinidir}/tests
coverage xml
Expand All @@ -20,7 +21,8 @@ deps =

[testenv:flake8]
deps = flake8
commands = flake8 {toxinidir}/markdown {toxinidir}/tests {toxinidir}/setup.py
allowlist_externals = flake8
commands = flake8 {toxinidir}/markdown {toxinidir}/tests
skip_install = true

[testenv:checkspelling]
Expand Down

0 comments on commit b81bf17

Please sign in to comment.