diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9706ae0..3479274 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,7 +44,7 @@ jobs: - name: Run pytest run: | - pytest --cov=mdformat_plugin --cov-report=xml --cov-report=term-missing + pytest --cov=mdformat_admon --cov-report=xml --cov-report=term-missing - name: Upload to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e481775..0e5544b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.4.0 hooks: - id: end-of-file-fixer - id: mixed-line-ending @@ -8,22 +8,22 @@ repos: - id: check-yaml - id: check-toml - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.8.0 + rev: v1.9.0 hooks: - id: python-check-blanket-noqa - repo: https://github.com/timothycrosley/isort - rev: 5.8.0 + rev: 5.10.1 hooks: - id: isort - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.10.0 hooks: - id: black -- repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.0 +- repo: https://github.com/pycqa/flake8 + rev: 6.0.0 hooks: - id: flake8 additional_dependencies: - - flake8-bugbear==21.3.2 - - flake8-builtins==1.5.3 - - flake8-comprehensions==3.4.0 + - flake8-bugbear>=21.3.2 + - flake8-builtins>=1.5.3 + - flake8-comprehensions>=3.4.0 diff --git a/README.md b/README.md index 41054b9..d071537 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,10 @@ -# mdformat-plugin +# mdformat-admon [![Build Status][ci-badge]][ci-link] [![codecov.io][cov-badge]][cov-link] [![PyPI version][pypi-badge]][pypi-link] -An [mdformat](https://github.com/executablebooks/mdformat) plugin for... - -## Required changes for a new plugin - -This demonstration is setup with a plugin named `plugin`. -There are a number of locations to change. -At a top level for a plugin `foo` at least the following changes are required - -- Global find and replace `mdformat_plugin` to `mdformat_foo` including folder names. -- Global find and replace `mdformat-plugin` to `mdformat-foo` including folder names. -- `tests/test_fixtures.py`: `output = mdformat.text(text, extensions={"plugin"})` becomes `output = mdformat.text(text, extensions={"foo"})` -- `pyproject.toml` in addition to the global find and replace: `plugin = "mdformat_plugin"` becomes `foo = "mdformat_foo"` - -Do not forget to update authorship / maintainers in `pyproject.toml` as well. +An [mdformat](https://github.com/executablebooks/mdformat) plugin for admonitions. ## Development @@ -41,7 +28,7 @@ and with test coverage: tox -e py37-cov ``` -The easiest way to write tests, is to edit tests/fixtures.md +The easiest way to write tests, is to edit `tests/fixtures.md` To run the code formatting and style checks: @@ -75,9 +62,9 @@ or trigger the GitHub Action job, by creating a release with a tag equal to the Note, this requires generating an API key on PyPi and adding it to the repository `Settings/Secrets`, under the name `PYPI_KEY`. -[ci-badge]: https://github.com/executablebooks/mdformat-plugin/workflows/CI/badge.svg?branch=master +[ci-badge]: https://github.com/executablebooks/mdformat-admon/workflows/CI/badge.svg?branch=master [ci-link]: https://github.com/executablebooks/mdformat/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush -[cov-badge]: https://codecov.io/gh/executablebooks/mdformat-plugin/branch/master/graph/badge.svg -[cov-link]: https://codecov.io/gh/executablebooks/mdformat-plugin -[pypi-badge]: https://img.shields.io/pypi/v/mdformat-plugin.svg -[pypi-link]: https://pypi.org/project/mdformat-plugin +[cov-badge]: https://codecov.io/gh/executablebooks/mdformat-admon/branch/master/graph/badge.svg +[cov-link]: https://codecov.io/gh/executablebooks/mdformat-admon +[pypi-badge]: https://img.shields.io/pypi/v/mdformat-admon.svg +[pypi-link]: https://pypi.org/project/mdformat-admon diff --git a/mdformat_plugin/__init__.py b/mdformat-admon/__init__.py similarity index 100% rename from mdformat_plugin/__init__.py rename to mdformat-admon/__init__.py diff --git a/mdformat_plugin/plugin.py b/mdformat-admon/plugin.py similarity index 100% rename from mdformat_plugin/plugin.py rename to mdformat-admon/plugin.py diff --git a/pyproject.toml b/pyproject.toml index d728245..baa15bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["flit_core >=3.2.0,<4"] build-backend = "flit_core.buildapi" [project] -name = "mdformat_plugin" +name = "mdformat_admon" authors = [ { name = "Chris Sewell", email = "executablebooks@gmail.com" }, ] @@ -30,10 +30,10 @@ test = [ dev = ["pre-commit"] [project.urls] -Homepage = "https://github.com/executablebooks/mdformat-plugin" +Homepage = "https://github.com/executablebooks/mdformat-admon" [project.entry-points."mdformat.parser_extension"] -plugin = "mdformat_plugin" +admon = "mdformat_admon" [tool.flit.sdist] include = [] @@ -46,7 +46,7 @@ force_sort_within_sections = true no_lines_before = ["LOCALFOLDER"] # Configure isort to work without access to site-packages -known_first_party = ["mdformat_plugin", "tests"] +known_first_party = ["mdformat_admon", "tests"] # Settings for Black compatibility profile = "black" diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index 68fc3bf..5e19d41 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -12,6 +12,6 @@ "line,title,text,expected", fixtures, ids=[f[1] for f in fixtures] ) def test_fixtures(line, title, text, expected): - output = mdformat.text(text, extensions={"plugin"}) + output = mdformat.text(text, extensions={"admon"}) print(output) assert output.rstrip() == expected.rstrip(), output diff --git a/tox.ini b/tox.ini index c284ba3..0e7ed6f 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ commands = pytest {posargs} [testenv:py{36,37,38,39}-cov] extras = test -commands = pytest --cov={envsitepackagesdir}/mdformat_plugin {posargs} +commands = pytest --cov={envsitepackagesdir}/mdformat_admon {posargs} [testenv:py{36,37,38,39}-pre-commit] extras = dev