diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe8d8a3..3eecdf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,20 +35,20 @@ jobs: steps: - name: Checkout Open Forms - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: open-formulieren/open-forms path: open-forms - name: Checkout StUF-ZDS payments extension - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: extension - name: Set up backend environment uses: maykinmedia/setup-django-backend@v1.1 with: - apt-packages: 'libxml2-dev libxmlsec1-dev libxmlsec1-openssl gettext postgresql-client gdal-bin' + apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gettext postgresql-client gdal-bin' python-version: '3.12' optimize-postgres: 'yes' pg-service: 'postgres' @@ -77,71 +77,32 @@ jobs: working-directory: ${{ github.workspace }}/open-forms - name: Publish coverage report - uses: codecov/codecov-action@v3.1.4 + uses: codecov/codecov-action@v4 with: root_dir: ${{ github.workspace }}/extension working-directory: ${{ github.workspace }}/open-forms files: ./coverage-extension.xml - docker_build: - name: Build Docker image - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set tag - id: vars - run: | - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name (if present at all) - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - - # Use Docker `latest` tag convention - [ "$VERSION" == "main" ] && VERSION=latest - - # PRs result in version 'merge' -> transform that into 'latest' - [ "$VERSION" == "merge" ] && VERSION=latest - - echo ::set-output name=tag::${VERSION} - - - name: Build the Docker image - run: | - docker build . \ - --tag $IMAGE_NAME:$RELEASE_VERSION - env: - RELEASE_VERSION: ${{ steps.vars.outputs.tag }} - - - run: docker image save -o image.tar $IMAGE_NAME:${{ steps.vars.outputs.tag }} - - name: Store image artifact - uses: actions/upload-artifact@v3 - with: - name: docker-image - path: image.tar - retention-days: 1 - publish: name: Publish package to PyPI runs-on: ubuntu-latest needs: - tests - - docker_build + environment: release + permissions: + id-token: write if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.12' - name: Build sdist and wheel run: | - pip install pip setuptools wheel --upgrade - python setup.py sdist bdist_wheel + pip install pip build --upgrade + python -m build --sdist --wheel - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index d5b4a7e..2c574fb 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -21,13 +21,11 @@ jobs: strategy: matrix: toxenv: [isort, black, flake8] - env: - PIP_CONSTRAINT: pip-constraints.txt steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install dependencies run: pip install tox - run: tox diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5c38365..0000000 --- a/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# Stage 1 - Build stuf_zds_payments environment -FROM python:3.12-slim-bullseye AS stuf-zds-payments-build - -WORKDIR /app - -RUN pip install pip -U -COPY . /app -RUN pip install . - - -# Stage 2 - Build the production image with the stuf_zds_payments -FROM openformulieren/open-forms:latest AS production-build - -WORKDIR /app - -# Copy the dependencies of the stuf_zds_payments -COPY --from=stuf-zds-payments-build /usr/local/lib/python3.12 /usr/local/lib/python3.12 - -# Add stuf_zds_payments code to the image -COPY --chown=maykin:root ./stuf_zds_payments /app/src/stuf_zds_payments - -USER maykin \ No newline at end of file diff --git a/README.rst b/README.rst index ad9318a..66841c5 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ Welcome to stuf_zds_payments's documentation! :Version: 0.1.0 :Source: https://github.com/maykinmedia/stuf_zds_payments :Keywords: ```` -:PythonVersion: 3.11 +:PythonVersion: 3.12 |build-status| |code-quality| |black| |coverage| |docs| @@ -30,7 +30,7 @@ Installation Requirements ------------ -* Python 3.11 or above +* Python 3.12 or above * Django 4.2 or newer diff --git a/pip-constraints.txt b/pip-constraints.txt deleted file mode 100644 index 0685d33..0000000 --- a/pip-constraints.txt +++ /dev/null @@ -1 +0,0 @@ -setuptools<72 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1bb626e..cf45863 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,11 +20,10 @@ classifiers = [ "Operating System :: Unix", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Software Development :: Libraries :: Python Modules", ] -requires-python = ">=3.11" +requires-python = ">=3.12" dependencies = [ "django>=4.2" ] diff --git a/tox.ini b/tox.ini index 6c9462c..213b655 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{310,311,312}-django{42} + py{312}-django{42} isort black flake8 @@ -9,7 +9,6 @@ skip_missing_interpreters = true [gh-actions] python = - 3.11: py311 3.12: py312 [gh-actions:env]