From ecac82ff4885776f723445dbeb5389dcf1cc10c8 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Thu, 4 Jan 2024 00:38:12 +0100 Subject: [PATCH 01/11] fix: Create missing __init__.py in management folder (#366) --- djangocms_versioning/management/__init__.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 djangocms_versioning/management/__init__.py diff --git a/djangocms_versioning/management/__init__.py b/djangocms_versioning/management/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/djangocms_versioning/management/__init__.py @@ -0,0 +1 @@ + From 4ed03c961779e161e6e3af46213984a327ad0599 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Mon, 15 Jan 2024 12:31:16 +0000 Subject: [PATCH 02/11] ci: Add testing against django main (#353) --- .github/dependabot.yml | 11 +++++++ .github/workflows/test.yml | 58 +++++++++++++++++++++++++++++------- tests/test_admin.py | 14 +++++---- tests/test_datastructures.py | 12 +++++--- tests/test_models.py | 8 +++-- tox.ini | 3 ++ 6 files changed, 84 insertions(+), 22 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..14f01789 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 654f4793..de4d7473 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.9, "3.10", "3.11", ] # latest release minus two + python-version: [ 3.9, "3.10", "3.11", "3.12" ] # latest release minus two requirements-file: [ dj32_cms41.txt, dj40_cms41.txt, @@ -21,10 +21,10 @@ jobs: ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -44,7 +44,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.9, "3.10", "3.11", ] # latest release minus two + python-version: [ 3.9, "3.10", "3.11", "3.12" ] # latest release minus two requirements-file: [ dj32_cms41.txt, dj40_cms41.txt, @@ -65,10 +65,10 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -90,7 +90,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.9, "3.10", "3.11", ] # latest release minus two + python-version: [ 3.9, "3.10", "3.11", "3.12" ] # latest release minus two requirements-file: [ dj32_cms41.txt, dj40_cms41.txt, @@ -109,10 +109,10 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -153,8 +153,44 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r tests/requirements/${{ matrix.requirements-file }} - pip install ${{ matrix.cms-version }} + python -m pip install -r tests/requirements/${{ matrix.requirements-file }} + python -m pip install ${{ matrix.cms-version }} + python setup.py install + + - name: Run coverage + run: coverage run setup.py test + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v2 + + sqlite-django-main: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [ "3.11" ] + cms-version: [ + 'https://github.com/django-cms/django-cms/archive/develop-4.tar.gz' + ] + django-version: [ + 'https://github.com/django/django/archive/main.tar.gz' + ] + requirements-file: [ + requirements_base.txt, + ] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r tests/requirements/${{ matrix.requirements-file }} + python -m pip install ${{ matrix.cms-version }} ${{ matrix.django-version }} python setup.py install - name: Run coverage diff --git a/tests/test_admin.py b/tests/test_admin.py index 14a4ba9e..8ed65073 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -58,6 +58,10 @@ from djangocms_versioning.test_utils.polls.cms_config import PollsCMSConfig from djangocms_versioning.test_utils.polls.models import Answer, Poll, PollContent +if not hasattr(CMSTestCase, "assertQuerySetEqual"): + # Django < 4.2 + CMSTestCase.assertQuerySetEqual = CMSTestCase.assertQuerysetEqual + class BaseStateTestCase(CMSTestCase): def assertRedirectsToVersionList(self, response, version): @@ -268,7 +272,7 @@ def test_only_fetches_latest_content_records(self): with self.login_user_context(self.get_superuser()): response = self.client.get(self.get_admin_url(PollContent, "changelist")) - self.assertQuerysetEqual( + self.assertQuerySetEqual( response.context["cl"].queryset, [poll_content1.pk, poll_content2.pk, poll_content3.pk], transform=lambda x: x.pk, @@ -291,7 +295,7 @@ def test_records_filtering_is_generic(self): with self.login_user_context(self.get_superuser()): response = self.client.get(self.get_admin_url(BlogContent, "changelist")) - self.assertQuerysetEqual( + self.assertQuerySetEqual( response.context["cl"].queryset, [blog_content1.pk, blog_content2.pk], transform=lambda x: x.pk, @@ -2124,7 +2128,7 @@ def test_compare_view_has_version_data_in_context_when_no_get_param(self): self.assertNotIn("v2", context) self.assertNotIn("v2_preview_url", context) self.assertIn("version_list", context) - self.assertQuerysetEqual( + self.assertQuerySetEqual( context["version_list"], [versions[0].pk, versions[1].pk], transform=lambda o: o.pk, @@ -2184,7 +2188,7 @@ def test_compare_view_has_version_data_in_context_when_version2_in_get_param(sel self.disable_toolbar_params, ) self.assertIn("version_list", context) - self.assertQuerysetEqual( + self.assertQuerySetEqual( context["version_list"], [versions[0].pk, versions[1].pk, versions[2].pk], transform=lambda o: o.pk, @@ -2310,7 +2314,7 @@ def test_grouper_filtering(self): self.assertEqual(response.status_code, 200) self.assertIn("cl", response.context) - self.assertQuerysetEqual( + self.assertQuerySetEqual( response.context["cl"].queryset, [pv.pk], transform=lambda x: x.pk, diff --git a/tests/test_datastructures.py b/tests/test_datastructures.py index cdea40c9..633ec384 100644 --- a/tests/test_datastructures.py +++ b/tests/test_datastructures.py @@ -11,6 +11,10 @@ from djangocms_versioning.test_utils.people.models import PersonContent from djangocms_versioning.test_utils.polls.models import Poll, PollContent +if not hasattr(CMSTestCase, "assertQuerySetEqual"): + # Django < 4.2 + CMSTestCase.assertQuerySetEqual = CMSTestCase.assertQuerysetEqual + class VersionableItemTestCase(CMSTestCase): def setUp(self): @@ -31,7 +35,7 @@ def test_distinct_groupers(self): grouper_field_name="poll", copy_function=default_copy, ) - self.assertQuerysetEqual( + self.assertQuerySetEqual( versionable.distinct_groupers(), [latest_poll1_version.content.pk, latest_poll2_version.content.pk], transform=lambda x: x.pk, @@ -59,7 +63,7 @@ def test_queryset_filter_for_distinct_groupers(self): qs_published_filter = {"versions__state__in": [PUBLISHED]} # Should be one published version - self.assertQuerysetEqual( + self.assertQuerySetEqual( versionable.distinct_groupers(**qs_published_filter), [poll1_published_version.content.pk], transform=lambda x: x.pk, @@ -68,7 +72,7 @@ def test_queryset_filter_for_distinct_groupers(self): qs_archive_filter = {"versions__state__in": [ARCHIVED]} # Should be two archived versions - self.assertQuerysetEqual( + self.assertQuerySetEqual( versionable.distinct_groupers(**qs_archive_filter), [poll1_archived_version.content.pk, poll2_archived_version.content.pk], transform=lambda x: x.pk, @@ -89,7 +93,7 @@ def test_for_grouper(self): copy_function=default_copy, ) - self.assertQuerysetEqual( + self.assertQuerySetEqual( versionable.for_grouper(self.initial_version.content.poll), [self.initial_version.content.pk, poll1_version2.content.pk], transform=lambda x: x.pk, diff --git a/tests/test_models.py b/tests/test_models.py index 98ac5b3e..8485d9ec 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -12,6 +12,10 @@ from djangocms_versioning.test_utils.polls.cms_config import PollsCMSConfig from djangocms_versioning.test_utils.polls.models import Poll, PollContent +if not hasattr(CMSTestCase, "assertQuerySetEqual"): + # Django < 4.2 + CMSTestCase.assertQuerySetEqual = CMSTestCase.assertQuerysetEqual + class CopyTestCase(CMSTestCase): def _create_versionables_mock(self, copy_function): @@ -261,7 +265,7 @@ def test_filter_by_grouper(self): versions_for_grouper = Version.objects.filter_by_grouper(poll) - self.assertQuerysetEqual( + self.assertQuerySetEqual( versions_for_grouper, [versions[0].pk, versions[1].pk], transform=lambda o: o.pk, @@ -278,7 +282,7 @@ def test_filter_by_grouper_doesnt_include_other_content_types(self): versions_for_grouper = Version.objects.filter_by_grouper(pv.content.poll) # Only poll version included - self.assertQuerysetEqual( + self.assertQuerySetEqual( versions_for_grouper, [pv.pk], transform=lambda o: o.pk, ordered=False ) diff --git a/tox.ini b/tox.ini index d7ed0942..52c40c51 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = ruff py{39.310,311}-dj{32,40,41,42}-sqlite + py{311,312}-djmain-cms-develop4-sqlite skip_missing_interpreters=True @@ -13,6 +14,8 @@ deps = dj40: -r{toxinidir}/tests/requirements/dj40_cms41.txt dj41: -r{toxinidir}/tests/requirements/dj41_cms41.txt dj42: -r{toxinidir}/tests/requirements/dj42_cms41.txt + djmain: https://github.com/django/django/archive/main.tar.gz + develop4: https://github.com/django-cms/django-cms/archive/develop-4.tar.gz basepython = py39: python3.9 From c5af26f0332989c2e4f73170b5dd2881c5369a81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:24:48 +0000 Subject: [PATCH 03/11] build(deps): bump actions/checkout from 3 to 4 (#373) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/publish-to-live-pypi.yml | 2 +- .github/workflows/publish-to-test-pypi.yml | 2 +- .github/workflows/test.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ceac2fc8..c30908d0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8687ed46..cd70ea54 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/publish-to-live-pypi.yml b/.github/workflows/publish-to-live-pypi.yml index 2d8272e2..79936d2b 100644 --- a/.github/workflows/publish-to-live-pypi.yml +++ b/.github/workflows/publish-to-live-pypi.yml @@ -15,7 +15,7 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.10 uses: actions/setup-python@v4 with: diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index fd1cf6fb..95548485 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -15,7 +15,7 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.10 uses: actions/setup-python@v4 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de4d7473..4d289ac1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -144,7 +144,7 @@ jobs: ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 From 38ed838f7ff2c7bccf026aa62f40a67551166b1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:38:03 +0000 Subject: [PATCH 04/11] build(deps): bump actions/cache from 3.3.1 to 3.3.3 (#372) Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.3.1...v3.3.3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6412cc0f..1b7db249 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,7 @@ jobs: python-version: '3.11' cache: 'pip' - name: Cache dependencies - uses: actions/cache@v3.3.1 + uses: actions/cache@v3.3.3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} @@ -44,7 +44,7 @@ jobs: python-version: '3.11' cache: 'pip' - name: Cache dependencies - uses: actions/cache@v3.3.1 + uses: actions/cache@v3.3.3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} From b51e1f99fc3210bc2daf8ca150153dd43345f6a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:44:16 +0000 Subject: [PATCH 05/11] build(deps): bump codecov/codecov-action from 2 to 3 (#370) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v2...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d289ac1..29f43b29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: run: coverage run setup.py test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 postgres: runs-on: ubuntu-latest @@ -83,7 +83,7 @@ jobs: DATABASE_URL: postgres://postgres:postgres@127.0.0.1/postgres - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 mysql: runs-on: ubuntu-latest @@ -127,7 +127,7 @@ jobs: DATABASE_URL: mysql://root@127.0.0.1/djangocms_test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 cms-develop-sqlite: runs-on: ${{ matrix.os }} @@ -161,7 +161,7 @@ jobs: run: coverage run setup.py test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 sqlite-django-main: runs-on: ubuntu-latest @@ -197,4 +197,4 @@ jobs: run: coverage run setup.py test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 From fc786a75072008333fa9f4739433a6641db20c62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:12:13 +0000 Subject: [PATCH 06/11] build(deps): bump actions/setup-python from 3 to 5 (#369) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v3...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docs.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/publish-to-live-pypi.yml | 2 +- .github/workflows/publish-to-test-pypi.yml | 2 +- .github/workflows/test.yml | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1b7db249..7c1ec0a7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -39,7 +39,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd70ea54..6d465993 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" cache: 'pip' diff --git a/.github/workflows/publish-to-live-pypi.yml b/.github/workflows/publish-to-live-pypi.yml index 79936d2b..3208e6bb 100644 --- a/.github/workflows/publish-to-live-pypi.yml +++ b/.github/workflows/publish-to-live-pypi.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 95548485..32ddf41a 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29f43b29..8c69a445 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: - 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 }} - name: Install dependencies @@ -68,7 +68,7 @@ jobs: - 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 }} - name: Install dependencies @@ -112,7 +112,7 @@ jobs: - 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 }} - name: Install dependencies @@ -147,7 +147,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -183,7 +183,7 @@ jobs: - 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 }} - name: Install dependencies From f90c5b25810f209cfdc14f83964338793c8d0c7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:54:11 +0000 Subject: [PATCH 07/11] build(deps): bump actions/cache from 3.3.3 to 4.0.0 (#375) Bumps [actions/cache](https://github.com/actions/cache) from 3.3.3 to 4.0.0. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.3.3...v4.0.0) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7c1ec0a7..8fa38e54 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,7 @@ jobs: python-version: '3.11' cache: 'pip' - name: Cache dependencies - uses: actions/cache@v3.3.3 + uses: actions/cache@v4.0.0 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} @@ -44,7 +44,7 @@ jobs: python-version: '3.11' cache: 'pip' - name: Cache dependencies - uses: actions/cache@v3.3.3 + uses: actions/cache@v4.0.0 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} From cf7c3de562355a9ca07b4698cce914086c045caa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 00:44:55 +0000 Subject: [PATCH 08/11] build(deps): bump codecov/codecov-action from 3 to 4 (#377) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c69a445..ff49a8aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: run: coverage run setup.py test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 postgres: runs-on: ubuntu-latest @@ -83,7 +83,7 @@ jobs: DATABASE_URL: postgres://postgres:postgres@127.0.0.1/postgres - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 mysql: runs-on: ubuntu-latest @@ -127,7 +127,7 @@ jobs: DATABASE_URL: mysql://root@127.0.0.1/djangocms_test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 cms-develop-sqlite: runs-on: ${{ matrix.os }} @@ -161,7 +161,7 @@ jobs: run: coverage run setup.py test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 sqlite-django-main: runs-on: ubuntu-latest @@ -197,4 +197,4 @@ jobs: run: coverage run setup.py test - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 From 8f5c0aef531dec37d191ff2642e95db46815fa53 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Tue, 6 Feb 2024 20:06:15 +0000 Subject: [PATCH 09/11] ci: Improve efficiency of ruff workflow (#378) --- .github/workflows/lint.yml | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6d465993..da24e88e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,26 +1,17 @@ -name: Lint +name: Ruff -on: [push, pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +on: + push: + pull_request: jobs: ruff: - name: ruff runs-on: ubuntu-latest + steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.11" - cache: 'pip' - - run: | - python -m pip install --upgrade pip - pip install ruff - - name: Run Ruff - run: | - ruff djangocms_versioning tests + - uses: actions/checkout@v4 + + - run: python -Im pip install --user ruff + + - name: Run ruff + run: ruff --output-format=github djangocms_versioning tests From a70c194c27c5aadb58f07e42309613ca7952daa8 Mon Sep 17 00:00:00 2001 From: Raffaella <45825990+raffaellasuardini@users.noreply.github.com> Date: Sun, 18 Feb 2024 17:10:43 +0100 Subject: [PATCH 10/11] Chore: update ruff and pre-commit hook (#381) * chore: updated pyproject.toml to solve warnings * ci: updated ruff-pre-commit version hook --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 31 ++++++++++++++++--------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed8a6403..6922db3d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,8 +14,8 @@ repos: - id: check-merge-conflict - id: mixed-line-ending - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.0.264" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.2.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/pyproject.toml b/pyproject.toml index c6a1005d..43360176 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,19 @@ [tool.ruff] -# https://beta.ruff.rs/docs/configuration/ +exclude = [ + ".eggs", + ".git", + ".mypy_cache", + ".ruff_cache", + ".env", + ".venv", + "**migrations/**", + "node_modules", + "venv", +] line-length = 120 + +[tool.ruff.lint] +# https://beta.ruff.rs/docs/configuration/ select = [ "E", # pycodestyle errors "W", # pycodestyle warnings @@ -15,18 +28,6 @@ select = [ "UP", # pyupgrade ] -exclude = [ - ".eggs", - ".git", - ".mypy_cache", - ".ruff_cache", - ".env", - ".venv", - "**migrations/**", - "node_modules", - "venv", -] - ignore = [ "B006", # Do not use mutable data structures for argument defaults "B011", # tests use assert False @@ -43,12 +44,12 @@ ignore = [ "UP007", # Use `X | Y` for type annotations ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "__init__.py" = [ "F401" # unused-import ] -[tool.ruff.isort] +[tool.ruff.lint.isort] combine-as-imports = true known-first-party = [ "djangocms_versioning", From 8a4e6c99e1cd2540172abed12b20e1d6e1e90dc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 23:38:01 +0000 Subject: [PATCH 11/11] build(deps): bump actions/cache from 4.0.0 to 4.0.1 (#385) Bumps [actions/cache](https://github.com/actions/cache) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4.0.0...v4.0.1) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8fa38e54..c393f081 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,7 @@ jobs: python-version: '3.11' cache: 'pip' - name: Cache dependencies - uses: actions/cache@v4.0.0 + uses: actions/cache@v4.0.1 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} @@ -44,7 +44,7 @@ jobs: python-version: '3.11' cache: 'pip' - name: Cache dependencies - uses: actions/cache@v4.0.0 + uses: actions/cache@v4.0.1 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}