Skip to content

Commit

Permalink
Upgrade to Python 3.12 (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
whusterj authored Nov 12, 2024
1 parent 38bb4aa commit 26e6860
Show file tree
Hide file tree
Showing 14 changed files with 317 additions and 325 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
# Can't use cache because of https://github.com/actions/cache/issues/319
# cache: 'pipenv'
- name: Install bootstrapper dependencies
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- run: pipenv install --dev --deploy
- name: Run Black
Expand All @@ -21,7 +21,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- run: pipenv install --dev --deploy
- name: Run flake8
Expand All @@ -36,7 +36,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand All @@ -58,7 +58,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand All @@ -80,7 +80,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Mobile Deployment
on: [deployment_status, workflow_dispatch]
on: [deployment_status, workflow_dispatch]

jobs:
Setup:
Expand All @@ -10,7 +10,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.12"
# Can't use cache because of https://github.com/actions/cache/issues/319
# cache: 'pipenv'
- name: Install bootstrapper dependencies
Expand Down Expand Up @@ -44,7 +44,6 @@ jobs:
echo $(git diff --name-only origin/main -- | grep "/clients/mobile/react-native/" | wc -l)
echo "BUILD_MOBILE_APP=$(git diff --name-only origin/main -- | grep "/clients/mobile/react-native/" | wc -l)" >> $GITHUB_OUTPUT
fi
publish:
if: needs.configuremobile.outputs.BUILD_MOBILE_APP != 0
Expand Down Expand Up @@ -94,4 +93,4 @@ jobs:
echo "${{ env.BACKEND_SERVER_URL }} and ${{ github.event.deployment_status.environment_url }}"
env:
EXPO_PUBLIC_BACKEND_SERVER_URL: "${{ github.event.deployment_status.environment_url }}"
EXPO_PUBLIC_ROLLBAR_ACCESS_TOKEN: "1a19e5da05b2435b802d5a81aba2bbd7"
EXPO_PUBLIC_ROLLBAR_ACCESS_TOKEN: "1a19e5da05b2435b802d5a81aba2bbd7"
8 changes: 4 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pipenv'
python-version: "3.12"
cache: "pipenv"
- run: pipenv install --dev --deploy
- name: Test with pytest
run: pipenv run pytest
Expand All @@ -35,8 +35,8 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pipenv'
python-version: "3.12"
cache: "pipenv"
- name: Install bootstrapper dependencies
run: pipenv install --dev --deploy
- run: |
Expand Down
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ cookiecutter = "==2.1.1"
binaryornot = "==0.4.4"
black = "==22.3.0"
isort = "==5.9.3"
flake8 = "==3.9.2"
flake8-isort = "==4.0.0"
flake8 = "==7.1.1"
flake8-isort = "==6.1.1"
pre-commit = "==2.13.0"
tox = "==3.24.0"
pytest = "==6.2.4"
Expand All @@ -22,4 +22,4 @@ Jinja2 = "==3.0.1"
[dev-packages]

[requires]
python_version = "3.10"
python_version = "3.12"
582 changes: 290 additions & 292 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pipx run cookiecutter gh:thinknimble/tn-spa-bootstrapper

See: [Maintained Foundation fork]

- For Django 3.1
- Uses Python 3.10 by default
- For Django 4.2.\*
- Uses Python 3.12 by default
- Renders Django projects with 100% starting test coverage
- Secure by default. We believe in SSL.
- Optimized development and production settings
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
classifiers=[
"Development Status :: 1 - Beta",
"Environment :: Console",
"Framework :: Django :: 3.0",
"Framework :: Django :: 4.2",
"Client Framework :: Vue",
"Intended Audience :: Thinknimble Developers",
"Natural Language :: English",
"License :: Proprietary License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development",
],
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/.github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
cache: 'pipenv'
- run: pipenv install --dev --deploy
- run: pipenv run black --check server
Expand All @@ -19,7 +19,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
cache: 'pipenv'
- run: pipenv install --dev --deploy
- run: pipenv run flake8 server
Expand Down
3 changes: 1 addition & 2 deletions {{cookiecutter.project_slug}}/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name = "pypi"
Django = "==4.2.*"
django-extensions = "==3.2.3"
django-filter = "==2.4.0"
django-nose = "==1.4.7"
dj-rest-auth = "*"
dj-database-url = "==0.5.0"
django-storages = "==1.11.1" # https://github.com/jschneier/django-storages
Expand All @@ -33,7 +32,7 @@ premailer = "*"
drf-spectacular = "*"

[requires]
python_version = "3.10"
python_version = "3.12"

[dev-packages]
# Code quality
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/compose/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim-buster
FROM python:3.12-slim-bullseye

# These environment values help with watching for file changes
ENV PYTHONUNBUFFERED 1
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.10.7
python-3.12.7
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
# Third Party
"corsheaders",
"drf_spectacular",
"django_nose",
"rest_framework",
"rest_framework.authtoken",
"dj_rest_auth",
Expand Down Expand Up @@ -389,9 +388,6 @@ def filter(self, record):
LOGGING["loggers"]["django"]["handlers"].append("rollbar")
LOGGING["loggers"]["{{ cookiecutter.project_slug }}"]["handlers"].append("rollbar")

# Popular testing framework that allows logging to stdout while running unit tests
TEST_RUNNER = "django_nose.NoseTestSuiteRunner"

SWAGGER_SETTINGS = {
"LOGIN_URL": "/login",
"USE_SESSION_AUTH": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def test_get_site_url_negative(settings, custom_settings):
def test_password_reset_email_link(user):
context = user.reset_password_context()
html_body = get_html_body("registration/password_reset.html", context)
assert f"{ context['site_url'] }/password/reset/confirm/{ context['user'].id }/{ context['token'] }" in html_body
assert f"{context['site_url']}/password/reset/confirm/{context['user'].id}/{context['token']}" in html_body

0 comments on commit 26e6860

Please sign in to comment.