Skip to content

Commit

Permalink
Merge pull request #435 from creativecommons/python-3-11-and-django-4-2
Browse files Browse the repository at this point in the history
upgrade to Python 3.11 and Django 4.2
  • Loading branch information
TimidRobot authored Apr 17, 2024
2 parents 61ce958 + d302b7e commit 556605d
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 268 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/django-app-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
git config --global user.name "Testing User"
# https://github.com/actions/setup-python
- name: Install Python 3.10
- name: Install Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- name: Install pipenv
run: |
Expand All @@ -49,31 +49,25 @@ jobs:
path: cc-legal-tools-data

- name: Install Python dependencies
run: |
pipenv sync --dev --system
run: pipenv sync --dev --system
working-directory: ./cc-legal-tools-app

- name: Check for missing Django migrations
run: |
./manage.py makemigrations --check
run: ./manage.py makemigrations --check
working-directory: ./cc-legal-tools-app

- name: Update Django database schema
run: |
./manage.py migrate
run: ./manage.py migrate
working-directory: ./cc-legal-tools-app

- name: Coverage Test
run: |
coverage run manage.py test --noinput --parallel 4
run: coverage run manage.py test --noinput --parallel 4
working-directory: ./cc-legal-tools-app

- name: Coverage Combine
run: |
coverage combine
run: coverage combine
working-directory: ./cc-legal-tools-app

- name: Coverage Report
run: |
coverage report
run: coverage report
working-directory: ./cc-legal-tools-app
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
steps:

# https://github.com/actions/setup-python
- name: Install Python 3.10
- name: Install Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'

- name: Install pipenv
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
exclude: \\.coverage.*
default_language_version:
python: python3.10
python: python3.11

repos:

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://docs.docker.com/engine/reference/builder/

# https://hub.docker.com/_/python/
FROM python:3.10-slim
FROM python:3.11-slim

# Configure apt not to prompt during docker build
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
16 changes: 8 additions & 8 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "pypi"

[packages]
Babel = "*"
Django = ">=3.2.25,<3.3"
Django = ">=4.2.11,<4.3"
GitPython = ">=3.1.41"
PyYAML = "*"
beautifulsoup4 = "*"
Expand All @@ -26,17 +26,17 @@ black = ">=24.3.0" # Sync version with [static-analysis], below
coverage = "*"
django-debug-toolbar = "*"
factory-boy = "*"
flake8 = "*" # Sync version with [static-analysis], below
isort = "*" # Sync version with [static-analysis], below
pre-commit = "*" # Sync version with [static-analysis], below
flake8 = "*" # Sync version with [static-analysis], below
isort = "*" # Sync version with [static-analysis], below
pre-commit = "*" # Sync version with [static-analysis], below
tblib = "*" # Dependency of coverage (with --parallel)

[static-analysis]
# Also see: .github/workflows/static-analysis.yml
black = ">=24.3.0" # Sync version with [dev-packages], above
flake8 = "*" # Sync version with [dev-packages], above
isort = "*" # Sync version with [dev-packages], above
pre-commit = "*" # Sync version with [dev-packages], above
flake8 = "*" # Sync version with [dev-packages], above
isort = "*" # Sync version with [dev-packages], above
pre-commit = "*" # Sync version with [dev-packages], above

[requires]
python_version = "3.10"
python_version = "3.11"
418 changes: 182 additions & 236 deletions Pipfile.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ site (served as static files).

## Software Versions

- [Python 3.10][python310] specified in:
- [Python 3.11][python311] specified in:
- [`.github/workflows/django-app-coverage.yml`][django-app-coverage]
- [`.github/workflows/static-analysis.yml`][static-analysis]
- [`.pre-commit-config.yaml`](.pre-commit-config.yaml)
- [`Dockerfile`](Dockerfile)
- [`Pipfile`](Pipfile)
- [`pyproject.toml`](pyproject.toml)
- [Django 3.2 (LTS)][django32]
- [Django 4.2 (LTS)][django42]
- [`Pipfile`](Pipfile)

[django-app-coverage]: .github/workflows/django-app-coverage.yml
[static-analysis]: .github/workflows/static-analysis.yml
[python310]: https://docs.python.org/3.10/
[django32]: https://docs.djangoproject.com/en/3.2/
[python310]: https://docs.python.org/3.11/
[django42]: https://docs.djangoproject.com/en/4.2/


## Setting up the Project
Expand Down
2 changes: 1 addition & 1 deletion legal_tools/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# See Converter functions, below, for a description of the following regex:
RE_CATEGORY = r"licenses|publicdomain"
RE_JURISDICTION = r"[a-z]{2}|igo|scotland"
RE_UNIT = r"(?i)[-a-z0-9+]+"
RE_UNIT = r"[-a-z0-9+]+"
RE_VERSION = r"[0-9]+[.][0-9]+"


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ force-exclude = '''
)
'''
line-length = 79
target-version = ['py310', 'py311']
target-version = ['py311', 'py312']


[tool.coverage.run]
Expand Down

0 comments on commit 556605d

Please sign in to comment.