summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2023-03-22 11:42:59 -0400
committerGitHub <noreply@github.com>2023-03-22 11:42:59 -0400
commitb81bf17ef4928039bebd43c4d5426c6ba87e1076 (patch)
treeb74246120b5caeeccaf67fcab2d92115ae5139fa
parent4a7b9352d677ae89d4dc89c243148dafac130957 (diff)
downloadpython-markdown-b81bf17ef4928039bebd43c4d5426c6ba87e1076.tar.gz
Switch from setup.py to pyproject.toml (#1324)
-rw-r--r--.github/workflows/deploy.yml4
-rw-r--r--MANIFEST.in2
-rw-r--r--docs/change_log/index.md5
-rw-r--r--makefile9
-rw-r--r--markdown/__meta__.py2
-rw-r--r--pyproject.toml88
-rw-r--r--setup.cfg2
-rwxr-xr-xsetup.py133
-rw-r--r--tox.ini4
9 files changed, 98 insertions, 151 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index fca5318..7cf84cf 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -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
diff --git a/MANIFEST.in b/MANIFEST.in
index 4d3c6a2..e6efa61 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -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
diff --git a/docs/change_log/index.md b/docs/change_log/index.md
index 6d7e252..7b9dec9 100644
--- a/docs/change_log/index.md
+++ b/docs/change_log/index.md
@@ -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).
diff --git a/makefile b/makefile
index 2fbe695..ec97db9 100644
--- a/makefile
+++ b/makefile
@@ -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'
@@ -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:
diff --git a/markdown/__meta__.py b/markdown/__meta__.py
index ccabee5..14ed840 100644
--- a/markdown/__meta__.py
+++ b/markdown/__meta__.py
@@ -26,7 +26,7 @@ License: BSD (see LICENSE.md for details).
# (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):
diff --git a/pyproject.toml b/pyproject.toml
index 39d9d77..17b4751 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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__'}
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 21934a2..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[metadata]
-license_file = LICENSE.md
diff --git a/setup.py b/setup.py
deleted file mode 100755
index 2a659d1..0000000
--- a/setup.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/usr/bin/env python
-"""
-Python Markdown
-
-A Python implementation of John Gruber's Markdown.
-
-Documentation: https://python-markdown.github.io/
-GitHub: https://github.com/Python-Markdown/markdown/
-PyPI: https://pypi.org/project/Markdown/
-
-Started by Manfred Stienstra (http://www.dwerg.net/).
-Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org).
-Currently maintained by Waylan Limberg (https://github.com/waylan),
-Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser).
-
-Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later)
-Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
-Copyright 2004 Manfred Stienstra (the original version)
-
-License: BSD (see LICENSE.md for details).
-"""
-
-
-import os
-from setuptools import setup
-
-
-def get_version():
- """Get version and version_info from markdown/__meta__.py file."""
- module_path = os.path.join(os.path.dirname('__file__'), 'markdown', '__meta__.py')
-
- import importlib.util
- spec = importlib.util.spec_from_file_location('__meta__', module_path)
- meta = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(meta)
- return meta.__version__, meta.__version_info__
-
-
-__version__, __version_info__ = get_version()
-
-# Get development Status for classifiers
-dev_status_map = {
- 'dev': '2 - Pre-Alpha',
- 'alpha': '3 - Alpha',
- 'beta': '4 - Beta',
- 'rc': '4 - Beta',
- 'final': '5 - Production/Stable'
-}
-DEVSTATUS = dev_status_map[__version_info__[3]]
-
-# The command line script name. Currently set to "markdown_py" so as not to
-# conflict with the perl implementation (which uses "markdown").
-SCRIPT_NAME = 'markdown_py'
-
-with open('README.md') as f:
- long_description = f.read()
-
-setup(
- name='Markdown',
- version=__version__,
- url='https://Python-Markdown.github.io/',
- project_urls={
- 'Documentation': 'https://Python-Markdown.github.io/',
- 'GitHub Project': 'https://github.com/Python-Markdown/markdown',
- 'Issue Tracker': 'https://github.com/Python-Markdown/markdown/issues'
- },
- description='Python implementation of Markdown.',
- long_description=long_description,
- long_description_content_type='text/markdown',
- author='Manfred Stienstra, Yuri takhteyev and Waylan limberg',
- author_email='python.markdown@gmail.com',
- maintainer='Waylan Limberg',
- maintainer_email='python.markdown@gmail.com',
- license='BSD License',
- packages=['markdown', 'markdown.extensions'],
- python_requires='>=3.7',
- install_requires=["importlib-metadata>=4.4;python_version<'3.10'"],
- extras_require={
- 'testing': [
- 'coverage',
- 'pyyaml',
- ],
- },
- entry_points={
- 'console_scripts': [
- '%s = markdown.__main__:run' % SCRIPT_NAME,
- ],
- # Register the built in extensions
- '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',
- ]
- },
- classifiers=[
- 'Development Status :: %s' % DEVSTATUS,
- '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'
- ]
-)
diff --git a/tox.ini b/tox.ini
index 4ad8f36..4689516 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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
@@ -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]