Skip to content

Commit

Permalink
renovate, remove python<3.8 and django<4.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lociii committed Jun 27, 2024
1 parent 8ff16be commit aa8d9a6
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 51 deletions.
72 changes: 36 additions & 36 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ env:

jobs:
flake8:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install required packages
run: pip install flake8 pep8-naming
Expand All @@ -26,7 +26,7 @@ jobs:

test:
name: Test and coverage
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand All @@ -36,19 +36,24 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
django:
- "3.2"
- "4.0"
- "4.1"
- "4.2"
- "5.0"
database:
- sqlite
- mysql
- postgres
exclude:
- python-version: "3.8"
django: "5.0"
- python-version: "3.9"
django: "5.0"

services:
# postgres service
postgres:
image: postgres:13-alpine
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand Down Expand Up @@ -76,34 +81,31 @@ jobs:
--health-retries=5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Update pip
run: python -m pip install --upgrade pip

- name: Install Django 3.2
if: matrix.django == 3.2
run: pip install "Django>=3.2,<4.0"
- name: Install Django 4.0
if: matrix.django == 4.0
run: pip install "Django>=4.0,<4.1"
- name: Install Django 4.1
if: matrix.django == 4.1
run: pip install "Django>=4.1,<4.2"
- name: Install Django 4.2
if: matrix.django == 4.2
run: pip install "Django>=4.2,<5.0"
- name: Install Django 5.0
if: matrix.django == 5.0
run: pip install "Django>=5.0,<5.1"
- name: Install MySQL libs
if: matrix.database == 'mysql'
run: pip install mysqlclient>=2.1.0 django-mysql>=4.5.0
run: pip install mysqlclient>=2.2.4 django-mysql>=4.14.0
- name: Install postgres libs
if: matrix.database == 'postgres'
run: pip install psycopg2==2.9.5
run: pip install psycopg==3.1.19

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

- name: Install package
run: pip install -e .
Expand Down Expand Up @@ -132,27 +134,25 @@ jobs:
run: coveralls

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Build and publish to PyPI
name: Build and publish Python 🐍 distributions 📦 to PyPI
needs: test
runs-on: ubuntu-22.04

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: 3.12

- name: Install build packages
- name: Install deployment packages
run: python -m pip install -U setuptools wheel

- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel

- name: Publish Package on Pypi
- name: Publish Package on PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_SECRET }}
password: ${{ secrets.PYPI_API_TOKEN }}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
-->

## [Unreleased]
### Changed
- **BREAKING**: Remove support for `Django` below version `4.2`
- **BREAKING**: Remove support for `Python` below version `3.8`
- **BREAKING**: Minimum required `Faker` version is now `20.0.0`, released 11/2023
- Added support for `Django` version `5.0`
- Added support for `Python` version `3.12`
- Add docker compose setup to run tests

## [1.3.0] - 2024-06-05
### Added
- Add support for regular expressions in `SCRUBBER_REQUIRED_FIELD_MODEL_WHITELIST` - Thanks @fbinz
Expand Down
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM debian:bookworm

ENV PYTHONUNBUFFERED 1
ENV LC_ALL=C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get -y update && apt-get -y install \
build-essential \
gcc \
python3-venv \
python3-dev \
libffi-dev \
libssl-dev \
&& \
apt-get clean && \
mkdir /app && \
useradd -m app

USER app

WORKDIR /app

ADD requirements.txt /app/

ENV PATH /home/app/venv/bin:${PATH}

RUN python3 -m venv ~/venv && \
pip install --upgrade pip && \
pip install wheel && \
pip install -r requirements.txt && \
pip install Django

ENV DJANGO_SETTINGS_MODULE tests.settings

EXPOSE 8000
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
app:
build: .
user: app
command: /app/manage.py test
volumes:
- .:/app
environment:
IPYTHONDIR: /app/.ipython
HISTFILE: /app/.bash_history
restart: "no"
Empty file modified manage.py
100644 → 100755
Empty file.
9 changes: 6 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
django-model-utils>=2.0,<5.0.0
# Additional requirements go here
faker>=0.8.0
coverage==6.5.0
coveralls==3.3.1
factory_boy==3.3.0
faker==26.0.0
flake8>=7.1.0
mock==5.1.0
7 changes: 0 additions & 7 deletions requirements_test.txt

This file was deleted.

9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,15 @@ def get_version(*file_paths):
],
include_package_data=True,
install_requires=[
"django-model-utils>=2.0,<5",
"faker>=0.8.0",
"faker>=20.0.0",
],
license="BSD",
zip_safe=False,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
Expand All @@ -82,6 +80,7 @@ def get_version(*file_paths):
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Security',
'Topic :: Software Development',
],
Expand Down
1 change: 1 addition & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"django.contrib.sessions",
"django.contrib.sites",
"django_scrubber",
"tests",
]

SITE_ID = 1
Expand Down

0 comments on commit aa8d9a6

Please sign in to comment.