diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index ef340db2..0196c49b 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -63,9 +63,9 @@ jobs: run: | python -m pytest - - name: Lints with Black + - name: Lints with pre-commit run: | - python -m black --check . + pre-commit run -a build: needs: [test] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ae1c5b7..2918d2ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ default_language_version: python: python3.11 -exclude: .*migrations\/.*|static\/img\/.*|static\/animations\/.* +exclude: .*migrations\/.*|static\/img\/.*|static\/animations\/.*|kube\/boost\/templates\/.*\.yaml repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: check-case-conflict - id: check-merge-conflict @@ -17,12 +17,12 @@ repos: hooks: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.263' + rev: v0.0.272 hooks: - id: ruff args: [--fix] - repo: https://github.com/rtts/djhtml - rev: 'v2.0.0' + rev: 3.0.6 hooks: - id: djhtml entry: djhtml --tabwidth 2 diff --git a/core/tests/sample.adoc b/core/tests/sample.adoc deleted file mode 100644 index 759805eb..00000000 --- a/core/tests/sample.adoc +++ /dev/null @@ -1,3 +0,0 @@ -== Test Document - -This is a test. diff --git a/core/tests/test_commands.py b/core/tests/test_commands.py index 027c8aa5..8806f8f6 100644 --- a/core/tests/test_commands.py +++ b/core/tests/test_commands.py @@ -8,8 +8,9 @@ import os def cleanup_test_asciidoc(): # This function will be executed after the test function completes def remove_files(): - expected_output_file = "core/tests/sample.html" - os.remove(os.path.join(settings.BASE_DIR, expected_output_file)) + for extension in ("adoc", "html"): + expected_output_file = f"core/tests/sample.{extension}" + os.remove(os.path.join(settings.BASE_DIR, expected_output_file)) # Yield control back to the test function yield diff --git a/requirements.in b/requirements.in index 1c9899df..041160cc 100755 --- a/requirements.in +++ b/requirements.in @@ -34,17 +34,18 @@ celery==5.2.7 redis==4.5.4 # Testing -black==22.3 +Faker +black django-bakery django-test-plus +ipython +minio +model_bakery +pre-commit pytest pytest-cov pytest-django -Faker -model_bakery -ipython responses -minio # Packaging pip-tools==6.13.0 diff --git a/requirements.txt b/requirements.txt index d1835ec2..3f9fa2d3 100755 --- a/requirements.txt +++ b/requirements.txt @@ -44,6 +44,8 @@ certifi==2023.5.7 # requests cffi==1.15.1 # via cryptography +cfgv==3.3.1 + # via pre-commit charset-normalizer==3.1.0 # via requests click==8.1.3 @@ -72,6 +74,8 @@ decorator==5.1.1 # via ipython defusedxml==0.7.1 # via python3-openid +distlib==0.3.6 + # via virtualenv dj-database-url==2.0.0 # via environs dj-email-url==1.0.6 @@ -149,6 +153,8 @@ faker==18.9.0 # via -r ./requirements.in fastcore==1.5.29 # via ghapi +filelock==3.12.2 + # via virtualenv fs==2.4.16 # via django-bakery gevent==22.10.2 @@ -161,6 +167,8 @@ greenlet==2.0.1 # gevent gunicorn==20.1.0 # via -r ./requirements.in +identify==2.5.24 + # via pre-commit idna==3.4 # via requests iniconfig==2.0.0 @@ -189,6 +197,8 @@ model-bakery==1.11.0 # via -r ./requirements.in mypy-extensions==1.0.0 # via black +nodeenv==1.8.0 + # via pre-commit oauthlib==3.2.2 # via requests-oauthlib packaging==23.1 @@ -213,9 +223,13 @@ pillow==9.4.0 pip-tools==6.13.0 # via -r ./requirements.in platformdirs==3.5.1 - # via black + # via + # black + # virtualenv pluggy==1.0.0 # via pytest +pre-commit==3.3.3 + # via -r ./requirements.in prompt-toolkit==3.0.38 # via # click-repl @@ -264,6 +278,7 @@ pytz==2023.3 # djangorestframework pyyaml==6.0 # via + # pre-commit # python-frontmatter # responses redis==4.5.4 @@ -317,6 +332,8 @@ vine==5.0.0 # via # celery # kombu +virtualenv==20.23.0 + # via pre-commit wcwidth==0.2.6 # via prompt-toolkit wheel==0.40.0