diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 93948c4..0e56079 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,8 +28,9 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python-version: [pypy3, 3.6, 3.7, 3.8, 3.9] + python-version: ['pypy-3.7', '3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 @@ -64,13 +65,13 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 - - name: Build package + python-version: "3.8" + - name: install flit run: | - pip install build - python -m build - - name: Publish - uses: pypa/gh-action-pypi-publish@v1.1.0 - with: - user: __token__ - password: ${{ secrets.PYPI_KEY }} + pip install flit~=3.4 + - name: Build and publish + run: | + flit publish + env: + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.PYPI_KEY }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aebb4b7..89d2e52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,27 +19,13 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/mgedmin/check-manifest - rev: "0.48" - hooks: - - id: check-manifest - args: [--no-build-isolation] - additional_dependencies: [setuptools>=46.4.0] - - # this is not used for now, - # since it converts mdit-py-plugins to mdit_py_plugins and removes comments - # - repo: https://github.com/asottile/setup-cfg-fmt - # rev: v1.17.0 - # hooks: - # - id: setup-cfg-fmt - - repo: https://github.com/timothycrosley/isort rev: 5.10.1 hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 22.8.0 hooks: - id: black @@ -50,7 +36,7 @@ repos: additional_dependencies: [flake8-bugbear==21.3.1] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.961 + rev: v0.971 hooks: - id: mypy - additional_dependencies: [markdown-it-py~=1.0] + additional_dependencies: [markdown-it-py~=2.0] diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index b04c40b..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,17 +0,0 @@ -exclude docs -recursive-exclude docs * -exclude tests -recursive-exclude tests * - -exclude .pre-commit-config.yaml -exclude .readthedocs.yml -exclude tox.ini -exclude .flake8 -exclude codecov.yml -exclude .mypy.ini - -include LICENSE -include CHANGELOG.md -include mdit_py_plugins/py.typed - -recursive-include mdit_py_plugins port.yaml LICENSE README.md diff --git a/pyproject.toml b/pyproject.toml index 013bf4a..5613bca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,67 @@ [build-system] -requires = ["setuptools>=46.4.0", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["flit_core >=3.4,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "mdit-py-plugins" +dynamic = ["version"] +description = "Collection of plugins for markdown-it-py" +readme = "README.md" +authors = [{name = "Chris Sewell", email = "chrisj_sewell@hotmail.com"}] +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "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 :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Text Processing :: Markup", +] +keywords = ["markdown", "markdown-it", "lexer", "parser", "development"] +requires-python = ">=3.7" +dependencies = ["markdown-it-py>=1.0.0,<3.0.0"] + +[project.urls] +Homepage = "https://github.com/executablebooks/mdit-py-plugins" +Documentation = "https://markdown-it-py.readthedocs.io" + +[project.optional-dependencies] +code_style = ["pre-commit"] +testing = [ + "coverage", + "pytest", + "pytest-cov", + "pytest-regressions", +] +rtd = [ + "attrs", + "myst-parser~=0.16.1", + "sphinx-book-theme~=0.1.0", +] + +[tool.flit.module] +name = "mdit_py_plugins" + +[tool.flit.sdist] +exclude = [ + "docs/", + "tests/", +] [tool.isort] profile = "black" +force_sort_within_sections = true known_first_party = ["mdit_py_plugins", "tests"] + +[tool.mypy] +show_error_codes = true +warn_unused_ignores = true +warn_redundant_casts = true +no_implicit_optional = true +strict_equality = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 30a06b8..0000000 --- a/setup.cfg +++ /dev/null @@ -1,64 +0,0 @@ -[metadata] -name = mdit-py-plugins -version = attr: mdit_py_plugins.__version__ -description = Collection of plugins for markdown-it-py -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/executablebooks/mdit-py-plugins -author = Chris Sewell -author_email = chrisj_sewell@hotmail.com -license = MIT -license_file = LICENSE -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Topic :: Software Development :: Libraries :: Python Modules - Topic :: Text Processing :: Markup -keywords = markdown, lexer, parser, development -project_urls = - Documentation=https://markdown-it-py.readthedocs.io - -[options] -packages = find: -install_requires = - markdown-it-py>=1.0.0,<3.0.0 -python_requires = >=3.6 -include_package_data = True -zip_safe = True - -[options.packages.find] -exclude = - test* - benchmarking - -[options.extras_require] -code_style = - pre-commit==2.6 -testing = - coverage - pytest>=3.6,<4 - pytest-cov - pytest-regressions -rtd = - attrs - myst-parser~=0.16.1 - sphinx-book-theme~=0.1.0 - -[mypy] -show_error_codes = True -warn_unused_ignores = True -warn_redundant_casts = True -no_implicit_optional = True -strict_equality = True - -[flake8] -max-line-length = 100 -extend-ignore = E203,E731 diff --git a/setup.py b/setup.py deleted file mode 100644 index 3614126..0000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -# This file is needed for editable installs (`pip install -e .`). -# Can be removed once the following is resolved -# https://github.com/pypa/packaging-problems/issues/256 -from setuptools import setup - -setup() diff --git a/tests/test_amsmath.py b/tests/test_amsmath.py index 7cb2e00..55b4987 100644 --- a/tests/test_amsmath.py +++ b/tests/test_amsmath.py @@ -1,9 +1,9 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.amsmath import amsmath_plugin diff --git a/tests/test_anchors.py b/tests/test_anchors.py index 3d50a68..0515b92 100644 --- a/tests/test_anchors.py +++ b/tests/test_anchors.py @@ -1,8 +1,8 @@ from pathlib import Path -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.anchors import anchors_plugin diff --git a/tests/test_colon_fence.py b/tests/test_colon_fence.py index 6cb4d99..d520906 100644 --- a/tests/test_colon_fence.py +++ b/tests/test_colon_fence.py @@ -1,9 +1,9 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.colon_fence import colon_fence_plugin diff --git a/tests/test_container.py b/tests/test_container.py index 21e3bd1..daf2ce6 100644 --- a/tests/test_container.py +++ b/tests/test_container.py @@ -1,9 +1,9 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.container import container_plugin diff --git a/tests/test_deflist.py b/tests/test_deflist.py index 0aae38f..d924e93 100644 --- a/tests/test_deflist.py +++ b/tests/test_deflist.py @@ -1,9 +1,9 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.deflist import deflist_plugin diff --git a/tests/test_dollarmath.py b/tests/test_dollarmath.py index 1cb1b12..9f88726 100644 --- a/tests/test_dollarmath.py +++ b/tests/test_dollarmath.py @@ -1,11 +1,11 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.rules_block import StateBlock from markdown_it.rules_inline import StateInline from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.dollarmath import dollarmath_plugin from mdit_py_plugins.dollarmath import index as main diff --git a/tests/test_field_list.py b/tests/test_field_list.py index 568a52a..cf00ae9 100644 --- a/tests/test_field_list.py +++ b/tests/test_field_list.py @@ -1,9 +1,9 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.field_list import fieldlist_plugin diff --git a/tests/test_footnote.py b/tests/test_footnote.py index ca7a10c..c662cb6 100644 --- a/tests/test_footnote.py +++ b/tests/test_footnote.py @@ -1,12 +1,12 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.rules_block import StateBlock from markdown_it.rules_inline import StateInline from markdown_it.token import Token from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.footnote import footnote_plugin, index diff --git a/tests/test_front_matter.py b/tests/test_front_matter.py index 3cf1043..627cb89 100644 --- a/tests/test_front_matter.py +++ b/tests/test_front_matter.py @@ -1,9 +1,9 @@ from pathlib import Path -import pytest from markdown_it import MarkdownIt from markdown_it.token import Token from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.front_matter import front_matter_plugin diff --git a/tests/test_myst_block.py b/tests/test_myst_block.py index 5fb46c7..632ed4b 100644 --- a/tests/test_myst_block.py +++ b/tests/test_myst_block.py @@ -1,9 +1,9 @@ from pathlib import Path -import pytest from markdown_it import MarkdownIt from markdown_it.token import Token from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.myst_blocks import myst_block_plugin diff --git a/tests/test_myst_role.py b/tests/test_myst_role.py index 46a2316..f70e3f8 100644 --- a/tests/test_myst_role.py +++ b/tests/test_myst_role.py @@ -1,9 +1,9 @@ from pathlib import Path -import pytest from markdown_it import MarkdownIt from markdown_it.token import Token from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.myst_role import myst_role_plugin diff --git a/tests/test_substitution.py b/tests/test_substitution.py index aae02df..706c1e2 100644 --- a/tests/test_substitution.py +++ b/tests/test_substitution.py @@ -1,9 +1,9 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest # from markdown_it.token import Token from mdit_py_plugins.substitution import substitution_plugin diff --git a/tests/test_tasklists.py b/tests/test_tasklists.py index 82e878f..427c336 100644 --- a/tests/test_tasklists.py +++ b/tests/test_tasklists.py @@ -1,9 +1,9 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.tasklists import tasklists_plugin diff --git a/tests/test_texmath.py b/tests/test_texmath.py index 70fdd53..80bf67b 100644 --- a/tests/test_texmath.py +++ b/tests/test_texmath.py @@ -1,11 +1,11 @@ from pathlib import Path from textwrap import dedent -import pytest from markdown_it import MarkdownIt from markdown_it.rules_block import StateBlock from markdown_it.rules_inline import StateInline from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.texmath import index as main from mdit_py_plugins.texmath import texmath_plugin diff --git a/tests/test_wordcount.py b/tests/test_wordcount.py index edeb0fc..d7629d9 100644 --- a/tests/test_wordcount.py +++ b/tests/test_wordcount.py @@ -1,9 +1,9 @@ import json from pathlib import Path -import pytest from markdown_it import MarkdownIt from markdown_it.utils import read_fixture_file +import pytest from mdit_py_plugins.wordcount import wordcount_plugin diff --git a/tox.ini b/tox.ini index 21e8e49..163d38b 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ envlist = py37 [testenv] usedevelop = true -[testenv:py{36,37,38,39}] +[testenv:py{37,38,39,310}] extras = testing commands = pytest {posargs} @@ -19,3 +19,7 @@ whitelist_externals = rm commands = clean: rm -rf docs/_build sphinx-build -nW --keep-going -b {posargs:html} docs/ docs/_build/{posargs:html} + +[flake8] +max-line-length = 100 +extend-ignore = E203,E731