From 44c1858635ba280c216ea5601b439308934e6e90 Mon Sep 17 00:00:00 2001 From: Jonathan Willitts Date: Fri, 2 Feb 2024 11:45:11 +0000 Subject: [PATCH 1/4] Bump pre-commit repos, run through Black 24.1.1 Black changes witnessed (mainly) include: - addition of blank line between module docstrings and imports - removal of blank lines between class declarations and docstrings - prefer splitting assignment statements on right-hand side - wrap conditional expressions that span multiple lines in parens --- .pre-commit-config.yaml | 12 ++++++------ edc_export/archive_exporter.py | 1 - .../export_tracking_fields_model_mixin.py | 1 - edc_export/model_options.py | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f3af91..3fa7253 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,32 +3,32 @@ exclude: tests/etc/user-* repos: - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.7.7 hooks: - id: bandit args: - "-x *test*.py" - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.1.1 hooks: - id: black language_version: python3.11 - repo: https://github.com/pycqa/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 args: - "--config=setup.cfg" - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: requirements-txt-fixer files: requirements/.*\.txt$ @@ -42,7 +42,7 @@ repos: - id: detect-private-key - repo: https://github.com/adrienverge/yamllint - rev: v1.32.0 + rev: v1.33.0 hooks: - id: yamllint args: diff --git a/edc_export/archive_exporter.py b/edc_export/archive_exporter.py index 6a78b00..c8f696e 100644 --- a/edc_export/archive_exporter.py +++ b/edc_export/archive_exporter.py @@ -25,7 +25,6 @@ class ArchiveExporterEmailError(Exception): class ArchiveExporter: - """Exports a list of models to individual CSV files and adds each to a single zip archive OR emails each. diff --git a/edc_export/model_mixins/export_tracking_fields_model_mixin.py b/edc_export/model_mixins/export_tracking_fields_model_mixin.py index cd13dba..d0ec581 100644 --- a/edc_export/model_mixins/export_tracking_fields_model_mixin.py +++ b/edc_export/model_mixins/export_tracking_fields_model_mixin.py @@ -7,7 +7,6 @@ class ExportTrackingFieldsModelMixin(models.Model): - """Adds these fields to the Concrete model.""" exported = models.BooleanField( diff --git a/edc_export/model_options.py b/edc_export/model_options.py index 1862010..464ef7d 100644 --- a/edc_export/model_options.py +++ b/edc_export/model_options.py @@ -3,7 +3,6 @@ class ModelOptions(dict): - """A serializable object of a selection of model attrs.""" def __init__(self, model: str = None): From c314180e2f8750d808ad6d6cccfccf14a4b556c1 Mon Sep 17 00:00:00 2001 From: Jonathan Willitts Date: Tue, 6 Feb 2024 09:07:15 +0000 Subject: [PATCH 2/4] Update GH actions to versions running Node.js 20 Fixes warnings: "Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20" See also: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ec2681..59f4d55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,9 +36,9 @@ jobs: sudo apt-get -y update sudo apt-get install libcups2-dev wamerican - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -48,7 +48,7 @@ jobs: echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: From 98d355aaaf42fc57654d4a304809dcdafbf863de Mon Sep 17 00:00:00 2001 From: Jonathan Willitts Date: Tue, 13 Feb 2024 13:31:53 +0000 Subject: [PATCH 3/4] Bump pre-commit repos (Black 24.2.0, yamllint 1.34.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3fa7253..a32918b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - "-x *test*.py" - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.2.0 hooks: - id: black language_version: python3.11 @@ -42,7 +42,7 @@ repos: - id: detect-private-key - repo: https://github.com/adrienverge/yamllint - rev: v1.33.0 + rev: v1.34.0 hooks: - id: yamllint args: From d094f055ec01a26bbe682a0ce102ba9a3c968af8 Mon Sep 17 00:00:00 2001 From: erikvw Date: Tue, 13 Feb 2024 19:43:48 -0600 Subject: [PATCH 4/4] change system check codes --- edc_export/system_checks.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/edc_export/system_checks.py b/edc_export/system_checks.py index c47b595..7097d11 100644 --- a/edc_export/system_checks.py +++ b/edc_export/system_checks.py @@ -5,21 +5,27 @@ from edc_export.utils import get_export_folder, get_upload_folder -def export_dir_checks(app_configs, **kwargs) -> list[CheckMessage]: +def edc_export_checks(app_configs, **kwargs) -> list[CheckMessage]: errors = [] if not os.path.exists(get_export_folder()): errors.append( Warning( - f"Folder does not exist. Tried {get_export_folder()}. See edc_export.", - id="settings.EDC_EXPORT_EXPORT_FOLDER", + ( + f"Folder does not exist. Tried {get_export_folder()}. " + "See settings.EDC_EXPORT_EXPORT_FOLDER." + ), + id="edc_export.W001", ) ) if not os.path.exists(get_upload_folder()): errors.append( Warning( - f"Folder does not exist. Tried {get_upload_folder()}. See edc_export.", - id="settings.EDC_EXPORT_UPLOAD_FOLDER", + ( + f"Folder does not exist. Tried {get_upload_folder()}. " + "See settings.EDC_EXPORT_UPLOAD_FOLDER." + ), + id="edc_export.W002", ) )