8000 fix: #7662, add support for python 3.12 and upgrade github actions by vinitkumar · Pull Request #7680 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

fix: #7662, add support for python 3.12 and upgrade github actions #7680

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

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
42 changes: 42 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "CodeQL"

on:
push:
branches: [ "develop", "develop-4", "release/0.10.x", "release/2.1.x", "release/2.2.x", "release/2.3.x", "release/2.4.x", "release/3.0.x", "release/3.1.x", "release/3.2.x", "release/3.3.x", "release/3.4.x", "release/3.5.x", "release/3.6.x", "release/3.7.x", "release/3.8.x", "release/3.9.x", "release/3.10.x", "release/3.11.x", "release/4.0.x", "release/4.0.0.x", "release/4.0.1.x", "release/4.1.x" ]
pull_request:
branches: [ "develop" ]
schedule:
- cron: "40 4 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ python, javascript ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
if: ${{ matrix.language == 'python' || matrix.language == 'javascript' }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
11 changes: 7 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ jobs:
name: docs
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: "3.12"
cache: 'pip'
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: python -m pip install -r docs/requirements.txt
- run: python setup.py install
- run: codespell -w *.rst
- run: codespell -w --skip docs/spelling_wordlist docs
- name: Build docs
run: |
cd docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
node-version: ['18']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

# Validates PR titles against the conventional commit spec
# https://github.com/commitizen/conventional-commit-types

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pip'
- run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-live-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.12'

- name: Install pypa/build
run: >-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.12'

- name: Install pypa/build
run: >-
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: django CMS spelling

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
codespell:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: codespell
uses: codespell-project/actions-codespell@master
20 changes: 12 additions & 8 deletions .github/workflows/test.yml
< 1241 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.8, 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: [
django-2.2.txt,
django-3.2.txt,
Expand Down Expand Up @@ -57,6 +57,7 @@ jobs:
pip install pytest
pip install -r test_requirements/${{ matrix.requirements-file }}
pip install -r test_requirements/databases.txt
pip install -r docs/requirements.txt
python setup.py install

- name: Test with django test runner
Expand All @@ -71,7 +72,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.8, 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: [
django-2.2.txt,
django-3.2.txt,
Expand Down Expand Up @@ -115,6 +116,7 @@ jobs:
pip install pytest
pip install -r test_requirements/${{ matrix.requirements-file }}
pip install -r test_requirements/databases.txt
pip install -r docs/requirements.txt
python setup.py install


Expand All @@ -129,7 +131,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.8, 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: [
django-2.2.txt,
django-3.2.txt,
Expand All @@ -142,8 +144,6 @@ jobs:
ubuntu-20.04,
]
exclude:
- requirements-file: django-5.0.txt
python-version: 3.8
- requirements-file: django-5.0.txt
python-version: 3.9

Expand All @@ -161,6 +161,7 @@ jobs:
python -m pip install --upgrade pip
pip install pytest
pip install -r test_requirements/${{ matrix.requirements-file }}
pip install -r docs/requirements.txt
python setup.py install

- name: Test with django test runner
Expand All @@ -173,7 +174,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
python-version: ['3.12']
requirements-file: ['requirements_base.txt']
django-version: [
'https://github.com/django/django/archive/main.tar.gz'
Expand All @@ -195,6 +196,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r test_requirements/${{ matrix.requirements-file }}
pip install pytest ${{ matrix.django-version }}
pip install --upgrade setuptools
python setup.py install

- name: Test with django test runner
Expand All @@ -208,7 +210,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
python-version: ['3.12']
requirements-file: ['requirements_base.txt']
django-version: [
'https://github.com/django/django/archive/main.tar.gz'
Expand Down Expand Up @@ -244,6 +246,7 @@ jobs:
pip install -r test_requirements/${{ matrix.requirements-file }}
pip install pytest ${{ matrix.django-version }}
pip install -r test_requirements/databases.txt
pip install -r docs/requirements.txt
python setup.py install

- name: Test with django test runner
Expand All @@ -259,7 +262,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
python-version: ['3.12']
requirements-file: ['requirements_base.txt']
django-version: [
'https://github.com/django/django/archive/main.tar.gz'
Expand Down Expand Up @@ -294,6 +297,7 @@ jobs:
pip install -r test_requirements/${{ matrix.requirements-file }}
pip install pytest ${{ matrix.django-version }}
pip install -r test_requirements/databases.txt
pip install -r docs/requirements.txt
python setup.py install

- name: Test with django test runner
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ Thanks to all contributors for their efforts!
- Fix issue on django >= 1.6 with page form fields.
- Resolve jQuery namespace issues in admin page tree and changeform
- Fix issues for PageField in Firefox/Safari
- Fix some Python 3.4 compatibility issue when using proxy modles
- Fix some Python 3.4 compatibility issue when using proxy models
- Fix corner case in plugin copy
- Documentation fixes
- Minor code cleanups
Expand Down
2 changes: 1 addition & 1 deletion cms/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ class Meta:


class GenericCmsPermissionForm(forms.ModelForm):
"""Generic form for User & Grup permissions in cms
"""Generic form for User & Group permissions in cms
"""
_current_user = None

Expand Down
2 changes: 1 addition & 1 deletion cms/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
on the models and managers, because the direct API via models and managers is
slightly counterintuitive for developers.

Teh api for both Pages and Plugins has changed significantly since django CMS
The api for both Pages and Plugins has changed significantly since django CMS
Version 4.

Also, the functions defined in this module do sanity checks on arguments.
Expand Down
4 changes: 2 additions & 2 deletions cms/app_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CMSApp:
To create an AppHook subclass ``CMSApp`` in ``cms_apps.py``
::
class MyAppHook(CMSApp):
name = "Problem sovler"
name = "Problem solver"
"""
#: list of urlconfs: example: ``_urls = ["myapp.urls"]``
_urls = []
Expand Down Expand Up @@ -126,7 +126,7 @@ class CMSAppConfig():
CMSAppConfig live in a file called ``cms_config.py``.

Apps subclassing ``CMSAppConfig`` can set ``cms_enabled = True`` for their app config to
use django CMS' wizzard functionality. Additional wizzwards are listed in the app config's
use django CMS' wizard functionality. Additional wizzwards are listed in the app config's
``cms_wizzards`` property.

The second functionality that django CMS offers is attaching Model objects to the toolbar. To use
Expand Down
2 changes: 1 addition & 1 deletion cms/cms_menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_menu_node_for_page(renderer, page, language, fallbacks=None):
if fallbacks is None:
fallbacks = []

# Theses are simple to port over, since they are not calculated.
# These are simple to port over, since they are not calculated.
# Other attributes will be added conditionally later.
attr = {
'is_page': True,
Expand Down
2 changes: 1 addition & 1 deletion cms/models/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def current_content(self, **kwargs):

def latest_content(self, **kwargs):
"""If a versioning package is installed, returns the latest version that matches the
filter given in kwargs including discared or unpublished page content. Without versioning
filter given in kwargs including discarded or unpublished page content. Without versioning
every page content is the latest."""
return self.filter(**kwargs)

Expand Down
4 changes: 2 additions & 2 deletions cms/models/permissionmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
#: Access to page itself and immediate children (1 level)
ACCESS_PAGE_AND_CHILDREN = 3

#: Access to all children (first level and allso their children)
#: Access to all children (first level and also their children)
ACCESS_DESCENDANTS = 4

#: Access to page itself and all children (first level and allso their children)
#: Access to page itself and all children (first level and also their children)
ACCESS_PAGE_AND_DESCENDANTS = 5

# binary masks for ACCESS permissions
Expand Down
4 changes: 2 additions & 2 deletions cms/models/pluginmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _get_database_cursor(action):
@lru_cache(maxsize=None)
def plugin_supports_cte():
# This has to be as function because when it's a var it evaluates before
# db is connected and we get OperationalError. MySQL version is retrived
# db is connected and we get OperationalError. MySQL version is retrieved
# from db, and it's cached_property.
connection = _get_database_connection('write')
db_vendor = _get_database_vendor('write')
Expand Down Expand Up @@ -480,7 +480,7 @@ def get_plugin_media_path(instance, filename):
Django requires that unbound function used in fields' definitions to be
defined outside the parent class.
(see https://docs.djangoproject.com/en/dev/topics/migrations/#serializing-values)
This function is used withing field definition:
This function is used within field definition:

file = models.FileField(_("file"), upload_to=get_plugin_media_path)

Expand Down
2 changes: 1 addition & 1 deletion cms/signals/apphook.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def debug_server_restart(**kwargs):
try:
reload(cms.urls)
except NameError: # python3
from imp import reload
from importlib import reload
reload(cms.urls)
if 'test' not in sys.argv:
msg = 'Application url changed and urls_need_reloading signal fired. ' \
Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/js/select2/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html

Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.
2 changes: 1 addition & 1 deletion cms/templatetags/cms_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def get_page_display_name(cms_page):


class TreePublishRow(Tag):
"""New template tag that renders a pontential menu to be offered with the
"""New template tag that renders a potential menu to be offered with the
dirty indicators. The core will not display a menu."""
name = "tree_publish_row"
options = Options(
Expand Down
Loading
0