Skip to content

Commit

Permalink
perf: add compatibility with Open edX Palm release DS-708 (#100)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: add compatibility with palm release

* perf: add support for palm release

* fix: remove 3.10 version test

* fix: tag pylint to avoid error and newrelic to match with edx-platform

* fix: rename functions due requirements migrations

* fix: line too long

* fix: ignore C0103

* fix: ignore W0707

* fix: ignore R0903, R0904

* fix: pylint R1705: Unnecessary "else" after "return"

* fix: too-many-ancestors

* fix: too-many-ancestors

* fix: too-many-instance-attributes

* fix: too-many-instance-attributes

* fix: unused-wildcard-import

* fix: unused-wildcard-import

* fix: similar lines in 2 files

* fix: similar lines in 2 files

* fix: similar lines in 2 files

* fix: remove disable codes

* fix: remove disable codes

* fix: remove disable codes

* fix: pylint style

* docs: update readme

---------

Co-authored-by: Maria Fernanda Magallanes Zubillaga <[email protected]>
  • Loading branch information
luisfelipec95 and MaferMazu authored Jan 2, 2024
1 parent 98fe948 commit 9540f2a
Show file tree
Hide file tree
Showing 21 changed files with 359 additions and 329 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bumpversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
default_prerelease_bump: false
dry_run: true
- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Create bumpversion
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Commit bumpversion
id: bumpversion
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.ref }}
commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_version }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4.1.12
- uses: wagoid/commitlint-github-action@v5.4.4
2 changes: 1 addition & 1 deletion .github/workflows/pr_issue_assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Auto-assign PR-Issue'
uses: pozil/auto-assign-issue@v1.5.0
uses: pozil/auto-assign-issue@v1.13.0
with:
repo-token: ${{ secrets.DEDALO_PAT }}
teams: django-plugins-tahoau
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: ["3.8", "3.10"]
python-version: ["3.8"]
django: ["32"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache dependency
uses: actions/cache@v3
Expand All @@ -25,7 +25,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
8 changes: 5 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ Compatibility Notes
+-------------------+----------------+
| Lilac | >= 2.2 < 5.0 |
+-------------------+----------------+
| Maple | >= 4.0 |
| Maple | >= 4.0 < 6.0 |
+-------------------+----------------+
| Nutmeg | >= 5.0 |
| Nutmeg | >= 5.0 < 6.0 |
+-------------------+----------------+
| Olive | >= 5.0 |
| Olive | >= 5.0 < 6.0 |
+-------------------+----------------+
| Palm | >= 6.0 |
+-------------------+----------------+

The following changes to the plugin settings are necessary. If the release you are looking for is
Expand Down
4 changes: 2 additions & 2 deletions eox_tagging/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def create(self, validated_data):

try:
return Tag.objects.create_tag(**tag_object)
except ValidationError as e:
raise serializers.ValidationError({"Tag": _(f"{e.message}")})
except ValidationError as validation_error:
raise serializers.ValidationError({"Tag": _(f"{validation_error.message}")})

@staticmethod
def _convert_compound_keys(ids, object_type):
Expand Down
10 changes: 5 additions & 5 deletions eox_tagging/api/v1/test/test_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def setUp(self):
self.mock_request = Mock()
self.view = Mock()

def test_API_access_success(self):
def test_api_access_success(self):
"""Used to test that an authorized user can access to the Tag API."""
self.mock_request.get_host.return_value = "test.com"
self.mock_request.user = self.user_authorized
Expand All @@ -38,7 +38,7 @@ def test_API_access_success(self):

self.assertTrue(has_permission)

def test_API_access_denied(self):
def test_api_access_denied(self):
"""Used to test that a unauthorized user can't access to the Tag API."""
self.mock_request.get_host.return_value = "test.com"
self.mock_request.user = self.common_user
Expand All @@ -48,7 +48,7 @@ def test_API_access_denied(self):

self.assertFalse(has_permission)

def test_API_access_with_bad_host(self):
def test_api_access_with_bad_host(self):
"""Used to test that an authorized user without a matching host with client can't access the API."""
self.mock_request.get_host.return_value = "test_.com"
self.mock_request.user = self.user_authorized
Expand All @@ -58,7 +58,7 @@ def test_API_access_with_bad_host(self):
with self.assertRaises(exceptions.NotAuthenticated):
self.has_permission(self.mock_request, self.view)

def test_API_access_without_valid_host(self):
def test_api_access_without_valid_host(self):
"""Used to test that an authorized user without a valid host can't access the API."""
self.mock_request.get_host.return_value = None
self.mock_request.user = self.user_authorized
Expand All @@ -68,7 +68,7 @@ def test_API_access_without_valid_host(self):
with self.assertRaises(exceptions.NotAuthenticated):
self.has_permission(self.mock_request, self.view)

def test_API_access_without_valid_client(self):
def test_api_access_without_valid_client(self):
"""Used to test that an authorized user without a valid client can't access the API."""
self.mock_request.get_host.return_value = "test_.com"
self.mock_request.user = self.user_authorized
Expand Down
Loading

0 comments on commit 9540f2a

Please sign in to comment.