Skip to content

Commit 7e08adc

Browse files
committed
Add basic version
1 parent 9b5dec2 commit 7e08adc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2410
-0
lines changed

.coveragerc

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[run]
2+
branch = True
3+
concurrency = multiprocessing, thread
4+
parallel = True
5+
source_pkgs = wagtail_tinytableblock
6+
omit = **/migrations/*,tests/*, **/__version__.py
7+
8+
[paths]
9+
source = src,.tox/py*/**/site-packages
10+
11+
[report]
12+
show_missing = True
13+
ignore_errors = True
14+
skip_covered = True
15+
16+
# Regexes for lines to exclude from consideration
17+
exclude_also =
18+
# Have to re-enable the standard pragma
19+
pragma: no cover
20+
21+
# Don't complain about missing debug-only code:
22+
def __repr__
23+
if self.debug
24+
if settings.DEBUG
25+
26+
# Don't complain if tests don't hit defensive assertion code:
27+
raise AssertionError
28+
raise NotImplementedError
29+
30+
# Don't complain if non-runnable code isn't run:
31+
if 0:
32+
if __name__ == .__main__.:
33+
34+
# Nor complain about type checking
35+
"if TYPE_CHECKING:",
36+
class .*\bProtocol\):
37+
@(abc\.)?abstractmethod

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.{yaml,yml,json,md}]
14+
indent_size = 2

.github/workflows/publish.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read # to fetch code (actions/checkout)
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
20+
cache: "pip"
21+
cache-dependency-path: "**/pyproject.toml"
22+
23+
- name: ⬇️ Install build dependencies
24+
run: |
25+
python -m pip install -U flit
26+
27+
- name: 🏗️ Build
28+
run: python -m flit build
29+
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
path: ./dist
33+
34+
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
35+
pypi-publish:
36+
needs: build
37+
environment: 'publish'
38+
39+
name: ⬆️ Upload release to PyPI
40+
runs-on: ubuntu-latest
41+
permissions:
42+
# Mandatory for trusted publishing
43+
id-token: write
44+
steps:
45+
- uses: actions/download-artifact@v4
46+
47+
- name: 🚀 Publish package distributions to PyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
with:
50+
packages-dir: artifact/
51+
print-hash: true

.github/workflows/ruff.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Ruff
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'stable/**'
8+
pull_request:
9+
branches: [main]
10+
11+
jobs:
12+
ruff:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
# Keep in sync with .pre-commit-config.yaml
19+
- run: python -Im pip install --user ruff==0.9.9
20+
21+
- name: Run ruff
22+
working-directory: ./src
23+
run: ruff check --output-format=github wagtail_tinytableblock

.github/workflows/test.yml

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Wagtail TinyTableBlock CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'stable/**'
8+
9+
pull_request:
10+
branches: [main]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read # to fetch code (actions/checkout)
18+
19+
env:
20+
FORCE_COLOR: '1' # Make tools pretty.
21+
TOX_TESTENV_PASSENV: FORCE_COLOR
22+
PIP_DISABLE_PIP_VERSION_CHECK: '1'
23+
PIP_NO_PYTHON_VERSION_WARNING: '1'
24+
PYTHON_LATEST: '3.13'
25+
26+
jobs:
27+
test-sqlite:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
python-version: ["3.12", "3.13"]
32+
django: ["4.2"]
33+
wagtail: ["6.3"]
34+
db: ["sqlite"]
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Install dependencies
44+
run: |
45+
python -Im pip install --upgrade pip flit tox tox-gh-actions
46+
47+
- name: 🏗️ Build wheel
48+
run: python -Im flit build --format wheel
49+
50+
- name: Test
51+
env:
52+
TOXENV: py${{ matrix.python-version }}-django${{ matrix.django }}-wagtail${{ matrix.wagtail }}-sqlite
53+
run: tox --installpkg ./dist/*.whl
54+
55+
- name: ⬆️ Upload coverage data
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: coverage-data-${{ matrix.python-version }}-sqlite
59+
path: .coverage.*
60+
include-hidden-files: true
61+
if-no-files-found: ignore
62+
retention-days: 1
63+
64+
test-postgres:
65+
runs-on: ubuntu-latest
66+
strategy:
67+
matrix:
68+
python-version: ["3.12", "3.13"]
69+
db: ["postgres"]
70+
71+
services:
72+
postgres:
73+
image: postgres:15
74+
env:
75+
POSTGRES_PASSWORD: postgres
76+
ports:
77+
- 5432:5432
78+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
- name: Set up Python ${{ matrix.python-version }}
83+
uses: actions/setup-python@v5
84+
with:
85+
python-version: ${{ matrix.python-version }}
86+
- name: Install dependencies
87+
run: |
88+
python -Im pip install --upgrade pip flit tox tox-gh-actions
89+
90+
- name: 🏗️ Build wheel
91+
run: python -Im flit build --format wheel
92+
93+
- name: Test
94+
env:
95+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/wagtail_localize_git
96+
run: tox --installpkg ./dist/*.whl
97+
98+
- name: ⬆️ Upload coverage data
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: coverage-data-${{ matrix.python-version }}
102+
path: .coverage.*
103+
include-hidden-files: true
104+
if-no-files-found: ignore
105+
retention-days: 1
106+
107+
coverage:
108+
runs-on: ubuntu-latest
109+
needs:
110+
- test-sqlite
111+
- test-postgres
112+
113+
steps:
114+
- uses: actions/checkout@v4
115+
- uses: actions/setup-python@v5
116+
with:
117+
# Use latest Python, so it understands all syntax.
118+
python-version: ${{env.PYTHON_LATEST}}
119+
120+
- run: python -Im pip install --upgrade coverage
121+
122+
- name: ⬇️ Download coverage data
123+
uses: actions/download-artifact@v4
124+
with:
125+
pattern: coverage-data-*
126+
merge-multiple: true
127+
128+
- name: + Combine coverage
129+
run: |
130+
python -Im coverage combine
131+
python -Im coverage html --skip-covered --skip-empty
132+
python -Im coverage report
133+
echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
134+
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
135+
- name: 📈 Upload HTML report
136+
uses: actions/upload-artifact@v4
137+
with:
138+
name: html-report
139+
path: htmlcov

.gitignore

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# Unit test / coverage reports
31+
htmlcov/
32+
.tox/
33+
.nox/
34+
.coverage
35+
.coverage.*
36+
.cache
37+
nosetests.xml
38+
coverage.xml
39+
*.cover
40+
*.py,cover
41+
.hypothesis/
42+
.pytest_cache/
43+
44+
# Translations
45+
*.mo
46+
*.pot
47+
48+
# Django stuff:
49+
*.log
50+
local_settings.py
51+
*.sqlite3
52+
*.sqlite3-journal
53+
54+
# IPython
55+
profile_default/
56+
ipython_config.py
57+
58+
# pyenv
59+
.python-version
60+
61+
# Environments
62+
.env
63+
.venv
64+
env/
65+
venv/
66+
ENV/
67+
env.bak/
68+
venv.bak/
69+
70+
# mkdocs documentation
71+
/site
72+
73+
# mypy
74+
.mypy_cache/
75+
.dmypy.json
76+
dmypy.json
77+
78+
poetry.lock
79+
.ruff_cache
80+
81+
tests/test-media
82+
tests/test-static

.pre-commit-config.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ci:
2+
autofix_prs: false
3+
4+
default_language_version:
5+
python: python3.13
6+
7+
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v5.0.0
10+
hooks:
11+
- id: check-added-large-files
12+
- id: check-case-conflict
13+
- id: check-json
14+
- id: check-merge-conflict
15+
- id: check-symlinks
16+
- id: check-toml
17+
- id: check-yaml
18+
args: ["--unsafe"]
19+
- id: end-of-file-fixer
20+
- id: trailing-whitespace
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
# keep in sync with .github/workflows/ruff.yml
23+
rev: 'v0.9.9'
24+
hooks:
25+
- id: ruff
26+
args: [--fix, --exit-non-zero-on-fix]
27+
- id: ruff-format

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Wagtail TinyTableBlock Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [unreleased]
9+
10+
## [0.1] - 2025-03-04
11+
12+
Initial release
13+
14+
15+
[unreleased]: https://github.com/torchbox/wagtail-tinytableblock/compare/v0.1...HEAD
16+
[0.1]: https://github.com/torchbox/wagtail-tinytableblock/compare/9b5dec2...v0.1

0 commit comments

Comments
 (0)