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

fix: Python 3.8 dropped and support for 3.12 added #471

Merged
merged 6 commits into from
Oct 28, 2024
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
124 changes: 61 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ on:
branches: [master]
pull_request:
branches:
- '**'
- "**"
workflow_dispatch:
branches:
CodeWithEmad marked this conversation as resolved.
Show resolved Hide resolved
- '**'

defaults:
run:
Expand All @@ -22,26 +20,26 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version:
- '3.12'
- "3.12"
toxenv: [py, quality]

steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt
- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt
- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

# Tests that used to be in the cookiecutter-django-ida Makefile but
# that have not yet been moved into the regular unit tests (which
Expand All @@ -52,50 +50,50 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version:
- '3.12'
- "3.12"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Generate demo project
run: |
make requirements
cookiecutter cookiecutter-django-ida --no-input

- name: "Post-gen: Virtualenv, and set up requirements"
working-directory: repo_name
run: |
virtualenv .venv
source .venv/bin/activate

make upgrade # TODO should be part of initial cookiecutter setup
make requirements

- name: "Post-gen: Migrations"
working-directory: repo_name
run: |
source .venv/bin/activate
python manage.py makemigrations
make migrate

- name: "Quality checks"
working-directory: repo_name
run: |
source .venv/bin/activate
make validate

- name: "Ensure translations can be compiled"
working-directory: repo_name
run: |
source .venv/bin/activate
sudo apt install gettext # required for msguniq, called by makemessages management command
make fake_translations

- name: "Ensure docker can build a container"
working-directory: repo_name
run: |
source .venv/bin/activate
docker build . --target app
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Generate demo project
run: |
make requirements
cookiecutter cookiecutter-django-ida --no-input

- name: "Post-gen: Virtualenv, and set up requirements"
working-directory: repo_name
run: |
virtualenv .venv
source .venv/bin/activate

make upgrade # TODO should be part of initial cookiecutter setup
make requirements

- name: "Post-gen: Migrations"
working-directory: repo_name
run: |
source .venv/bin/activate
python manage.py makemigrations
make migrate

- name: "Quality checks"
working-directory: repo_name
run: |
source .venv/bin/activate
make validate

- name: "Ensure translations can be compiled"
working-directory: repo_name
run: |
source .venv/bin/activate
sudo apt install gettext # required for msguniq, called by makemessages management command
make fake_translations

- name: "Ensure docker can build a container"
working-directory: repo_name
run: |
source .venv/bin/activate
docker build . --target app
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Change Log
This file loosely adheres to the structure of https://keepachangelog.com/,
but in reStructuredText instead of Markdown.

2024-08-03
**********

- Dropped support for Python 3.8 and Django 3.2

2024-05-25
**********

Expand Down
2 changes: 1 addition & 1 deletion cookiecutter-django-app/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Enter the project and take a look around:
ls

Generate a virtualenv and generate requirements files with dependencies
pinned to current versions (make sure you're using pip 9.0.2+ and Python 3.8):
pinned to current versions (make sure you're using pip 23.2+ and Python 3.12):

.. code-block:: bash

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches: [main]
pull_request:
branches:
- '**'

- "**"

jobs:
run_tests:
Expand All @@ -15,31 +14,30 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8']
toxenv: [quality, docs, pii_check, django32, django40]

python-version: ["3.12"]
toxenv: [quality, docs, pii_check, django42]
steps:
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run coverage
if: matrix.python-version == '3.12' && matrix.toxenv == 'django42'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion cookiecutter-django-ida/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A cookiecutter_ template for Open edX Django projects.

.. _cookiecutter: https://cookiecutter.readthedocs.org/en/latest/index.html

**This template produces a Python 3.8 project.**
**This template produces a Python 3.12 project.**

This cookiecutter template is intended for new edX independently deployable apps (IDAs). It includes the following packages:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install pip
run: pip install -r requirements/pip.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FROM ubuntu:focal as app
# If you add a package here please include a comment above describing what it is used for
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qy install --no-install-recommends \
language-pack-en locales \
python3.8 python3-dev python3-pip \
python3.12 python3-dev python3-pip \
# The mysqlclient Python package has install-time dependencies
libmysqlclient-dev libssl-dev pkg-config \
gcc
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter-python-library/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A cookiecutter_ template for edX python projects. For django-related cookiecutte

.. _cookiecutter: https://cookiecutter.readthedocs.org/en/latest/index.html

**This template produces a Python 3.8 project.**
**This template produces a Python 3.12 project.**

This cookiecutter template is intended for new edX python libraries.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches: [main]
pull_request:
branches:
- '**'

- "**"

jobs:
run_tests:
Expand All @@ -15,31 +14,30 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8']
toxenv: [quality, docs, django32, django40]

python-version: ["3.12"]
toxenv: [quality, docs, django42]
steps:
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run coverage
if: matrix.python-version == '3.12' && matrix.toxenv == 'django42'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
12 changes: 12 additions & 0 deletions cookiecutter-xblock/{{cookiecutter.repo_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ dev.build:
dev.run: dev.clean dev.build ## Clean, build and run test image
docker run -p 8000:8000 -v $(CURDIR):/usr/local/src/$(REPO_NAME) --name $(REPO_NAME)-dev $(REPO_NAME)-dev

dev.stop: ## Stop the running container
docker stop $(REPO_NAME)-dev

dev.migrate: ## Run migrations in the container
docker exec -it $(REPO_NAME)-dev python manage.py migrate

dev.logs: ## View logs from the container
docker logs -f $(REPO_NAME)-dev

dev.exec: ## Execute to the dev container
docker exec -it $(REPO_NAME)-dev /bin/bash

## Localization targets

extract_translations: ## extract strings to be translated, outputting .po files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ django-statici18n
edx-i18n-tools
Mako
XBlock
xblock-utils
Loading