diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 4025daf..42bba31 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -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 @@ -26,7 +26,7 @@ jobs: test: name: Test and coverage - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -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 @@ -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 . @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a1cbd..aa8c5f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eb07684 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..2988614 --- /dev/null +++ b/docker-compose.yaml @@ -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" diff --git a/manage.py b/manage.py old mode 100644 new mode 100755 diff --git a/requirements.txt b/requirements.txt index b053d2d..552f92d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/requirements_test.txt b/requirements_test.txt deleted file mode 100644 index 7bfea37..0000000 --- a/requirements_test.txt +++ /dev/null @@ -1,7 +0,0 @@ --r requirements.txt -coverage>=6.3.2 -coveralls>=3.3.1 -mock>=4.0.3 -flake8>=4.0.1 -codecov>=2.1.12 -factory_boy>=3.2.1 diff --git a/setup.py b/setup.py index a80650c..837be52 100755 --- a/setup.py +++ b/setup.py @@ -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', @@ -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', ], diff --git a/tests/settings.py b/tests/settings.py index 497ab4a..d3f1fe8 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -50,6 +50,7 @@ "django.contrib.sessions", "django.contrib.sites", "django_scrubber", + "tests", ] SITE_ID = 1