diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index eb64947..481ade5 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -23,7 +23,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox + pip install --upgrade setuptools setuptools_scm wheel build tox - name: Lint and test run: | tox + - name: Build + run: | + python -m build -nwsx . diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9e3a349..c337bab 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,11 +21,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install --upgrade setuptools setuptools_scm wheel build twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel + python -m build -nwsx . twine upload dist/* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..69dd27e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "markdownify" +version = "0.13.0" +authors = [{name = "Matthew Tretter", email = "m@tthewwithanm.com"}] +description = "Convert HTML to markdown." +readme = "README.rst" +classifiers = [ + "Environment :: Web Environment", + "Framework :: Django", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 2.5", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Topic :: Utilities", +] +dependencies = [ + "beautifulsoup4>=4.9,<5", + "six>=1.15,<2" +] + +[project.urls] +Homepage = "http://github.com/matthewwithanm/python-markdownify" +Download = "http://github.com/matthewwithanm/python-markdownify/tarball/master" + +[project.scripts] +markdownify = "markdownify.main:main" + +[tool.setuptools] +zip-safe = false +include-package-data = true + +[tool.setuptools.packages.find] +include = ["markdownify", "markdownify.*"] +namespaces = false + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index 9a703d0..0000000 --- a/setup.py +++ /dev/null @@ -1,52 +0,0 @@ -#/usr/bin/env python -import codecs -import os -from setuptools import setup, find_packages - - -read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read() - -pkgmeta = { - '__title__': 'markdownify', - '__author__': 'Matthew Tretter', - '__version__': '0.13.0', -} - -read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read() - -setup( - name='markdownify', - description='Convert HTML to markdown.', - long_description=read(os.path.join(os.path.dirname(__file__), 'README.rst')), - version=pkgmeta['__version__'], - author=pkgmeta['__author__'], - author_email='m@tthewwithanm.com', - url='http://github.com/matthewwithanm/python-markdownify', - download_url='http://github.com/matthewwithanm/python-markdownify/tarball/master', - packages=find_packages(), - zip_safe=False, - include_package_data=True, - install_requires=[ - 'beautifulsoup4>=4.9,<5', - 'six>=1.15,<2', - ], - classifiers=[ - 'Environment :: Web Environment', - 'Framework :: Django', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.5', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Topic :: Utilities' - ], - entry_points={ - 'console_scripts': [ - 'markdownify = markdownify.main:main' - ] - } -)