Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit fe1fd9d

Browse files
committed
✨NEW: Initial package structure
1 parent 4954333 commit fe1fd9d

File tree

8 files changed

+177
-0
lines changed

8 files changed

+177
-0
lines changed

.github/workflows/tests.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags:
7+
- 'v*'
8+
pull_request:
9+
10+
jobs:
11+
12+
pre-commit:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.7
21+
- uses: pre-commit/[email protected]
22+
23+
tests:
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
matrix:
27+
python-version: [3.6, 3.7, 3.8, 3.9.0-rc.1]
28+
os: [ubuntu-latest]
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Installation (deps and package)
39+
run: |
40+
pip install .[testing]
41+
42+
- name: Run pytest
43+
run: |
44+
pytest --cov=mdformat_tables --cov-report=xml --cov-report=term-missing
45+
46+
- name: Upload to Codecov
47+
if: matrix.python-version == 3.7
48+
uses: codecov/codecov-action@v1
49+
with:
50+
name: pytests-py3.7
51+
flags: pytests
52+
file: ./coverage.xml
53+
fail_ci_if_error: true
54+
55+
publish:
56+
name: Publish to PyPi
57+
needs: [pre-commit, tests]
58+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout source
62+
uses: actions/checkout@v2
63+
- name: Set up Python 3.7
64+
uses: actions/setup-python@v1
65+
with:
66+
python-version: 3.7
67+
- name: install flit
68+
run: |
69+
pip install flit~=3.0
70+
- name: Build and publish
71+
run: |
72+
flit publish
73+
env:
74+
FLIT_USERNAME: __token__
75+
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: mixed-line-ending
7+
- id: trailing-whitespace
8+
- id: check-yaml
9+
- id: check-toml
10+
- repo: https://github.com/pre-commit/pygrep-hooks
11+
rev: v1.6.0
12+
hooks:
13+
- id: python-check-blanket-noqa
14+
- repo: https://github.com/timothycrosley/isort
15+
rev: 5.5.3
16+
hooks:
17+
- id: isort
18+
- repo: https://github.com/psf/black
19+
rev: 20.8b1
20+
hooks:
21+
- id: black
22+
- repo: https://gitlab.com/pycqa/flake8
23+
rev: 3.8.3
24+
hooks:
25+
- id: flake8
26+
additional_dependencies:
27+
- flake8-bugbear==20.1.4
28+
- flake8-builtins==1.5.3
29+
- flake8-comprehensions==3.2.3

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# mdformat-tables
2+
23
mdformat plugin for rendering tables

mdformat_tables/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""mdformat plugin for rendering tables."""
2+
3+
__version__ = "0.1.0"

mdformat_tables/plugin.py

Whitespace-only changes.

pyproject.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[build-system]
2+
requires = ["flit_core >=2,<4"]
3+
build-backend = "flit_core.buildapi"
4+
5+
[tool.flit.metadata]
6+
module = "mdformat_tables"
7+
author = "Chris Sewell"
8+
author-email = "[email protected]"
9+
description-file = "README.md"
10+
home-page = "https://github.com/executablebooks/mdformat-tables"
11+
classifiers = [
12+
"Intended Audience :: Developers",
13+
"License :: OSI Approved :: MIT License",
14+
"Programming Language :: Python :: 3",
15+
"Topic :: Software Development :: Libraries :: Python Modules",
16+
]
17+
keywords = "mdformat,markdown,markdown-it"
18+
19+
requires-python=">=3.6"
20+
requires=["mdformat~=0.3.1"]
21+
22+
[tool.flit.metadata.requires-extra]
23+
testing = [
24+
"pytest~=6.0",
25+
"coverage",
26+
"pytest-cov",
27+
]
28+
29+
[tool.flit.entrypoints."mdformat.parser_extension"]
30+
tables = "mdformat:plugin"
31+
32+
[tool.flit.sdist]
33+
include = []
34+
exclude = [".github/", "tests/"]
35+
36+
[tool.isort]
37+
skip = ["venv"]
38+
# Force imports to be sorted by module, independent of import type
39+
force_sort_within_sections = true
40+
# Group first party and local folder imports together
41+
no_lines_before = ["LOCALFOLDER"]
42+
43+
# Configure isort to work without access to site-packages
44+
known_first_party = ["mdformat_tables", "tests"]
45+
46+
# Settings for Black compatibility
47+
profile = "black"

tests/test_parse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from mdformat_tables import __version__
2+
3+
4+
def test_basic():
5+
assert isinstance(__version__, str)

tox.ini

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[tox]
2+
envlist = py{36,37,38}
3+
isolated_build = True
4+
5+
[testenv:py{36,37,38}]
6+
extras = testing
7+
commands = pytest {posargs}
8+
9+
[testenv:py{36,37,38}-pre-commit]
10+
deps = pre-commit
11+
commands = pre-commit run {posargs}
12+
13+
[flake8]
14+
max-line-length = 88
15+
max-complexity = 10
16+
# These checks violate PEP8 so let's ignore them
17+
extend-ignore = E203

0 commit comments

Comments
 (0)