Skip to content

Commit

Permalink
Merge branch 'release/0.1.20' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Nov 20, 2024
2 parents 94f762f + 97c2bed commit f33a680
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
django-version: ['4.2', '5.1', 'dev']
python-version: ['3.12', '3.13']
django-version: ['5.1', 'dev']
database-engine: ["mysql", "postgres"]

services:
Expand Down
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ exclude: tests/etc/user-*

repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
rev: 1.7.10
hooks:
- id: bandit
args:
- "-x *test*.py"

- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
language_version: python3.12
Expand All @@ -28,15 +28,17 @@ repos:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: requirements-txt-fixer
files: requirements/.*\.txt$
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Erik van Widenfelt <ew2789@gmail.com>
Erik van Widenfelt <ew2789@gmail.com>
7 changes: 5 additions & 2 deletions edc_qareports/model_mixins/qa_report_model_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.conf import settings
from django.contrib.sites.models import Site
from django.db import connection, models
from django.db import OperationalError, connection, models
from django.db.models import DO_NOTHING, Index
from edc_utils import get_utcnow

Expand Down Expand Up @@ -49,7 +49,10 @@ def recreate_db_view(cls, drop: bool | None = None, verbose: bool | None = None)
print(f"create view {cls._meta.db_table} as {sql};")
with connection.cursor() as c:
if drop:
c.execute(f"drop view {cls._meta.db_table};")
try:
c.execute(f"drop view {cls._meta.db_table};")
except OperationalError:
pass
c.execute(f"create view {cls._meta.db_table} as {sql};")
sys.stdout.write(
f"Done. Refreshed DB VIEW `{cls._meta.db_table}` for model {cls}."
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a title="{{ title }}" href="{{ url }}?q={{ subject_identifier }}">{{ label|default:subject_identifier }}</a>
<a title="{{ title }}" href="{{ url }}?q={{ subject_identifier }}">{{ label|default:subject_identifier }}</a>
27 changes: 20 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[build-system]
requires = ["setuptools>=60", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_file="_version.py"
version_file = "_version.py"

[tool.black]
line-length = 95
Expand Down Expand Up @@ -35,33 +36,33 @@ exclude_lines = [
legacy_tox_ini = """
[tox]
envlist =
py{312}-dj{42,51,dev},
py{312,313}-dj{51,dev},
lint
pre-commit
isolated_build = true
[gh-actions]
python =
3.12: py312, lint
3.12: py312, lint, pre-commit
3.13: py313
[gh-actions:env]
DJANGO =
4.2: dj42
5.1: dj51
dev: djdev, lint
dev: djdev, lint, pre-commit
[testenv]
deps =
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/tox.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/test_utils.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/edc.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/third_party_dev.txt
dj42: Django>=4.2,<5.0
dj51: Django>=5.1,<5.2
djdev: https://github.com/django/django/tarball/main
commands =
pip install -U pip
python --version
pip --version
pip freeze
coverage run -a runtests.py
Expand All @@ -70,7 +71,19 @@ commands =
[testenv:lint]
deps = -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/lint.txt
commands =
python --version
pip --version
pip freeze
isort --profile=black --check --diff .
black --check --diff .
flake8 .
[testenv:pre-commit]
deps = pre-commit
commands =
python --version
pip --version
pip freeze
pre-commit autoupdate
pre-commit run --all-files
"""
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ keywords = django Edc QA, SQL VIEWS, clinicedc, clinical trials
classifiers=
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 4.2
Framework :: Django :: 5.1
Intended Audience :: Developers
Intended Audience :: Science/Research
Expand Down

0 comments on commit f33a680

Please sign in to comment.