forked from torchbox/wagtaildraftsharing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mozmeao/add-wagtail-6-support
Add Wagtail 6 support + extra way to create a sharing link
- Loading branch information
Showing
22 changed files
with
796 additions
and
144 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,56 @@ | ||
name: "CI" # Note that this name appears in the README's badge | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
pull_request: | ||
# Placeholder for the future if this work gets accepted into the upstream repo | ||
# release: | ||
# types: [published] | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install .'[testing]' | ||
- name: Test with tox | ||
run: tox | ||
|
||
# Placeholder for the future if this work gets accepted into the upstream repo | ||
# release: | ||
# name: Release to PyPI | ||
# if: github.event_name == 'release' && github.event.action == 'published' | ||
# needs: | ||
# - run-tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: 3.11 | ||
# - name: Install dependencies for package building only | ||
# run: pip install build | ||
# - name: Build package for upload to PyPI | ||
# run: python -m build . | ||
# - name: Upload the distribution to PyPI | ||
# uses: pypa/[email protected] | ||
# with: | ||
# user: __token__ | ||
# password: ${{ secrets.PYPI_API_TOKEN }} |
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,18 +1,6 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
args: ["wagtaildraftsharing", "setup.py", "testmanage.py", "--line-length=79"] | ||
exclude: migrations | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.0.254 | ||
rev: v0.6.9 | ||
hooks: | ||
- id: ruff | ||
exclude: migrations | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
args: ["wagtaildraftsharing"] |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "wagtaildraftsharing" | |
version = "0.0.4" | ||
description = "Share wagtail drafts with private URLs." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
requires-python = ">=3.9" | ||
license = {text = "CC0"} | ||
authors = [ | ||
{name = "Shohan Dutta Roy", email = "[email protected]" } | ||
|
@@ -15,8 +15,10 @@ classifiers = [ | |
"Framework :: Django", | ||
"Framework :: Django :: 3.2", | ||
"Framework :: Django :: 4.2", | ||
"Framework :: Django :: 5.1", | ||
"Framework :: Wagtail", | ||
"Framework :: Wagtail :: 5", | ||
"Framework :: Wagtail :: 6", | ||
"License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", | ||
"License :: Public Domain", | ||
"Programming Language :: Python", | ||
|
@@ -26,7 +28,9 @@ classifiers = [ | |
[project.optional-dependencies] | ||
testing = [ | ||
"coverage[toml]", | ||
"tox", | ||
"wagtail-factories", | ||
"freezegun==1.5.1", | ||
] | ||
|
||
[project.urls] | ||
|
@@ -44,42 +48,6 @@ inventory = [ | |
"static/wagtaildraftsharing/*", | ||
] | ||
|
||
[tool.black] | ||
line-length = 79 | ||
target-version = ["py38"] | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
( | ||
/( | ||
\.eggs | ||
| \.git | ||
| \.tox | ||
| \*.egg-info | ||
| _build | ||
| build | ||
| dist | ||
| migrations | ||
)/ | ||
) | ||
''' | ||
|
||
[tool.isort] | ||
profile = "black" | ||
line_length = 79 | ||
lines_after_imports = 2 | ||
skip = [".tox", "migrations", ".venv", "venv"] | ||
known_django = ["django"] | ||
known_wagtail = ["wagtail"] | ||
default_section = "THIRDPARTY" | ||
sections = [ | ||
"STDLIB", | ||
"DJANGO", | ||
"WAGTAIL", | ||
"THIRDPARTY", | ||
"FIRSTPARTY", | ||
"LOCALFOLDER" | ||
] | ||
|
||
[tool.ruff] | ||
exclude = [ | ||
".git", | ||
|
@@ -90,13 +58,25 @@ exclude = [ | |
".venv", | ||
"venv", | ||
] | ||
|
||
|
||
[tool.ruff.lint] | ||
ignore = [] | ||
select = [ | ||
"E", | ||
"F", | ||
"W", | ||
] | ||
|
||
[tool.ruff.lint.isort] | ||
section-order = [ | ||
"future", | ||
"standard-library", | ||
"third-party", | ||
"first-party", | ||
"local-folder", | ||
] | ||
|
||
[tool.coverage.run] | ||
omit = [ | ||
"wagtaildraftsharing/tests/*", | ||
|
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
27 changes: 27 additions & 0 deletions
27
wagtaildraftsharing/migrations/0002_alter_wagtaildraftsharinglink_created_by.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 4.2.16 on 2024-10-01 14:32 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
("wagtaildraftsharing", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="wagtaildraftsharinglink", | ||
name="created_by", | ||
field=models.ForeignKey( | ||
blank=True, | ||
editable=False, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="+", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
] |
Oops, something went wrong.