Skip to content

Commit

Permalink
Merge pull request #430 from creativecommons/python-3-10
Browse files Browse the repository at this point in the history
update to python 3.10
  • Loading branch information
TimidRobot authored Apr 4, 2024
2 parents 36ff094 + b0150af commit 991c3e6
Show file tree
Hide file tree
Showing 8 changed files with 324 additions and 238 deletions.
4 changes: 2 additions & 2 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.9
- name: Install Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.10"

- name: Install pipenv
run: |
Expand Down
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.9
- name: Install Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'

- name: Install Python dependencies
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.9
python: python3.10

repos:

Expand Down
10 changes: 5 additions & 5 deletions 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.9-slim
FROM python:3.10-slim

# Configure apt not to prompt during docker build
ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -22,17 +22,17 @@ WORKDIR /root

# Configure apt to avoid installing recommended and suggested packages
RUN apt-config dump \
| grep -E '^APT::Install-(Recommends|Suggests)' \
| sed -e's/1/0/' \
| tee /etc/apt/apt.conf.d/99no-recommends-no-suggests
| grep -E '^APT::Install-(Recommends|Suggests)' \
| sed -e's/1/0/' \
| tee /etc/apt/apt.conf.d/99no-recommends-no-suggests

# Resynchronize the package index
RUN apt-get update

# Install apt packages missing from slim docker image
RUN apt-get install -y git ssh

# Install apt package dependencies
# Install apt package dependencies for App
RUN apt-get install -y gcc gettext sqlite3

## Install pipenv
Expand Down
11 changes: 5 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ name = "pypi"

[packages]
Babel = "*"
Django = ">=3.2.24,<3.3"
Django = ">=3.2.25,<3.3"
GitPython = ">=3.1.41"
PyYAML = "*"
beautifulsoup4 = "*"
certifi = ">=2023.7.22" # Ensure dependency is secure
colorlog = "*"
dealer = "*"
gitpython = ">=3.1.37" # Ensure dependency is secure
lxml = "*" # Used for RDF/XML processing and by beautifulsoup4
lxml = "*" # Dependency of beautifulsoup4 and RDF/XML processing
polib = "*"
python-dateutil = "*"
rdflib = "*"
Expand All @@ -22,15 +22,14 @@ urllib3 = ">=2.0.7" # Ensure dependency is secure
whitenoise = "*"

[dev-packages]
black = "*"
black = ">=24.3.0"
coverage = "*"
django-debug-toolbar = "*"
factory-boy = "*"
flake8 = "*"
isort = "*"
#link-checker = {file = "https://github.com/creativecommons/cc-link-checker/archive/v2020.09.1.zip"}
pre-commit = "*"
tblib = "*" # For use by coverage (with --parallel)
tblib = "*" # Dependency of coverage (with --parallel)

[requires]
python_version = "3.9"
python_version = "3.10"
508 changes: 293 additions & 215 deletions Pipfile.lock

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repository.

[repodata]:https://github.com/creativecommons/cc-legal-tools-data


## Code of conduct

[`CODE_OF_CONDUCT.md`][org-coc]:
Expand All @@ -28,6 +29,7 @@ See [`CONTRIBUTING.md`][org-contrib].

[org-contrib]: https://github.com/creativecommons/.github/blob/main/CONTRIBUTING.md


## Not the live site

This project is not intended to serve the legal tools directly. Instead, a
Expand All @@ -38,12 +40,19 @@ site (served as static files).

## Software Versions

- [Python 3.9][python39] (For parity with Debian GNU/Linux 11 [bullseye])
- [Django 3.2][django32]

Both versions are specified in the [`Pipfile`](Pipfile).

[python39]: https://docs.python.org/3.9/
- [Python 3.10][python310] 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]
- [`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/


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 = ['py39', 'py310']
target-version = ['py310', 'py311']


[tool.coverage.run]
Expand Down

0 comments on commit 991c3e6

Please sign in to comment.