-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maintain: set PEP621 metadata. move to src-layout
- Loading branch information
Showing
11 changed files
with
179 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[bumpversion] | ||
commit = True | ||
tag = True | ||
tag_name = v{new_version} | ||
current_version = 1.0.0 | ||
|
||
[bumpversion:file:pyproject.toml] | ||
search = version = "{current_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT | ||
replace = version = "{new_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT | ||
|
||
[bumpversion:file:src/mdformat_tables/__init__.py] | ||
search = __version__ = "{current_version}" | ||
replace = __version__ = "{new_version}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
max-complexity = 10 | ||
extend-ignore = | ||
# E203: Whitespace before ':' (violates PEP8 and black style) | ||
E203, | ||
# A005: A module is shadowing a Python builtin module | ||
A005, | ||
extend-exclude = */site-packages/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Run pre-commit | ||
run: | | ||
pipx run pre-commit run --all-files | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Installation | ||
run: | | ||
pip install -r tests/requirements.txt . | ||
- name: Run pytest | ||
run: | | ||
pytest --cov --cov-fail-under=100 | ||
pre-commit-hook: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Installation | ||
run: | | ||
pip install pre-commit | ||
pip install . | ||
- name: run pre-commit with plugin | ||
run: | | ||
pre-commit run --config .pre-commit-test.yaml --all-files --verbose --show-diff-on-failure | ||
publish: | ||
name: Publish to PyPi | ||
needs: [pre-commit, tests, pre-commit-hook] | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install build and publish tools | ||
run: | | ||
pip install build twine | ||
- name: Build and check | ||
run: | | ||
rm -rf dist/ && python -m build | ||
twine check --strict dist/* | ||
- name: Publish | ||
run: | | ||
twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_KEY }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,4 +128,8 @@ dmypy.json | |
# Pyre type checker | ||
.pyre/ | ||
|
||
# IntelliJ | ||
.idea/ | ||
|
||
# VS Code | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
[build-system] | ||
requires = ["flit_core >=2,<4"] | ||
requires = ["flit_core>=3.2.0,<4"] | ||
build-backend = "flit_core.buildapi" | ||
|
||
[tool.flit.metadata] | ||
module = "mdformat_tables" | ||
author = "Chris Sewell" | ||
author-email = "[email protected]" | ||
maintainer = "Taneli Hukkinen" | ||
maintainer-email = "[email protected]" | ||
description-file = "README.md" | ||
home-page = "https://github.com/hukkin/mdformat-tables" | ||
[project] | ||
name = "mdformat-tables" | ||
version = "1.0.0" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT | ||
authors = [ | ||
{ name = "Chris Sewell", email = "[email protected]"}, | ||
] | ||
maintainers = [ | ||
{ name = "Taneli Hukkinen", email = "[email protected]"}, | ||
] | ||
description = "Mdformat plugin for rendering tables" | ||
readme = "README.md" | ||
license = { file = "LICENSE" } | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
'mdformat >=0.7.19,<0.8.0', | ||
'wcwidth >=0.2.13', | ||
] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Documentation", | ||
"Topic :: Text Processing :: Markup", | ||
] | ||
keywords = "mdformat,markdown,markdown-it" | ||
|
||
requires-python=">=3.9" | ||
requires=["mdformat>=0.7.19,<0.8.0", "wcwidth>=0.2.13"] | ||
keywords = ["mdformat", "markdown", "formatter", "gfm"] | ||
|
||
[tool.flit.metadata.requires-extra] | ||
test = [ | ||
"pytest~=6.0", | ||
"coverage", | ||
"pytest-cov", | ||
] | ||
[project.urls] | ||
"Homepage" = "https://github.com/hukkin/mdformat-tables" | ||
|
||
[tool.flit.entrypoints."mdformat.parser_extension"] | ||
tables = "mdformat_tables" | ||
[project.entry-points."mdformat.parser_extension"] | ||
"tables" = "mdformat_tables" | ||
|
||
[tool.flit.sdist] | ||
include = [] | ||
exclude = [".github/", "tests/"] | ||
|
||
[tool.isort] | ||
# Force imports to be sorted by module, independent of import type | ||
|
@@ -46,3 +44,39 @@ known_first_party = ["mdformat_tables", "tests"] | |
|
||
# Settings for Black compatibility | ||
profile = "black" | ||
|
||
|
||
[tool.pytest.ini_options] | ||
addopts = "--strict-markers --strict-config" | ||
xfail_strict = true | ||
|
||
|
||
[tool.tox] | ||
requires = ["tox>=4.21.1"] | ||
# Only run pytest envs when no args given to tox | ||
env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
|
||
[tool.tox.env_run_base] | ||
description = "run tests under {base_python}" | ||
deps = [ | ||
"-r tests/requirements.txt", | ||
] | ||
commands = [ | ||
["pytest", { replace = "posargs", default = ["--cov", "--cov-fail-under", "100"], extend = true }], | ||
] | ||
|
||
[tool.tox.env."pre-commit"] | ||
description = "run linters" | ||
skip_install = true | ||
deps = ["pre-commit"] | ||
commands = [ | ||
["pre-commit", "run", { replace = "posargs", default = ["--all-files"], extend = true }], | ||
] | ||
|
||
[tool.tox.env."hook"] | ||
description = "test unreleased changes via pre-commit hook" | ||
skip_install = true | ||
deps = ["pre-commit"] | ||
commands = [ | ||
["pre-commit", "run", "--config", ".pre-commit-test.yaml", { replace = "posargs", default = ["--all-files", "--verbose", "--show-diff-on-failure"], extend = true }], | ||
] |
2 changes: 0 additions & 2 deletions
2
mdformat_tables/__init__.py → src/mdformat_tables/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
"""An mdformat plugin for rendering tables.""" | ||
|
||
__version__ = "1.0.0" | ||
|
||
from .plugin import ( # noqa: F401 | ||
|
File renamed without changes.
Oops, something went wrong.