Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/better compatibility and update ci cd #57

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ 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
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
python-version: "3.12"
cache: "pip"
- run: |
python -m pip install --upgrade pip
pip install ruff
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/publish-to-live-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
48 changes: 24 additions & 24 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
skip_existing: true
52 changes: 24 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,33 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12"] # latest release minus two
requirements-file: [
dj42_cms311.txt,
dj42_cms41.txt,
dj50_cms41.txt,
dj51_cms41.txt
]
os: [
ubuntu-20.04,
]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
requirements-file:
[dj42_cms311.txt, dj42_cms41.txt, dj50_cms41.txt, dj51_cms41.txt]
os: [ubuntu-20.04]
exclude:
- python-version: "3.9"
requirements-file: dj50_cms41.txt
- python-version: "3.9"
requirements-file: dj51_cms41.txt
- python-version: "3.9"
requirements-file: dj50_cms41.txt
- python-version: "3.9"
requirements-file: dj51_cms41.txt

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}

uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements/${{ matrix.requirements-file }}
python setup.py install
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements/${{ matrix.requirements-file }}
python setup.py install

- name: Run coverage
run: coverage run tests/settings.py
- name: Run coverage
run: coverage run tests/settings.py

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
15 changes: 4 additions & 11 deletions djangocms_attributes_field/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,10 @@ def formfield(self, **kwargs):
defaults["excluded_keys"] = self.excluded_keys
return super().formfield(**defaults)

# This was added to keep backwards compatibility with Django 2.2 while also
# avoiding a RemovedInDjango30Warning caused by the deprecation of
# context argument
if DJANGO_2_2:
def from_db_value(self, value,
expression=None, connection=None, context=None):
self._from_db_value(value)
else:
def from_db_value(self, value,
expression=None, connection=None):
self._from_db_value(value)

def from_db_value(self, value,
expression=None, connection=None):
self._from_db_value(value)

def _from_db_value(self, value):
"""
fsbraun marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading