diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..90ce6ec --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +name: Tests + +on: [push] + +jobs: + tox: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + sudo apt-get install gdal-bin + - name: Run tests with tox + run: tox + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2.1.0 + with: + fail_ci_if_error: true + verbose: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fa6682a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: python - -dist: bionic - -python: - - "3.5" - - "3.6" - - "3.7" - - "3.8" - -install: - - pip install tox-travis - - pip install codecov - - sudo apt-get install gdal-bin - -script: - - tox - -notifications: - email: false - -after_success: - - codecov diff --git a/Dockerfile b/Dockerfile index b5b7b36..278e4a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,15 @@ -FROM ubuntu:18.04 - -MAINTAINER Marco Chiappetta +FROM ubuntu:latest # Needed to be able to install python versions. RUN apt-get update && apt-get install -y software-properties-common RUN add-apt-repository ppa:deadsnakes/ppa RUN apt-get update && apt-get install -y \ - python3.5 \ python3.6 \ python3.7 \ python3.8 \ + python3.9 \ + python3.10 \ gdal-bin \ python3-pip diff --git a/README.md b/README.md index 64efcf8..6da39a0 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,24 @@ DRF-EXTRA-FIELDS Extra Fields for Django Rest Framework -**Possible breaking change in v3.1.0**: In this version we have changed file class used in `Base64FileField` from `ContentFile` to `SimpleUploadedFile` (you may see the change [here](https://github.com/Hipo/drf-extra-fields/pull/149/files#diff-5f77bcb61083cd9c026f6dfb3b77bf8fa824c45e620cdb7826ad713bde7b65f8L72-R85)). - -[![Build Status](https://travis-ci.org/Hipo/drf-extra-fields.svg?branch=master)](https://travis-ci.org/Hipo/drf-extra-fields) +[![Build Status](https://github.com/Hipo/drf-extra-fields/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/Hipo/drf-extra-fields/actions) [![codecov](https://codecov.io/gh/Hipo/drf-extra-fields/branch/master/graph/badge.svg)](https://codecov.io/gh/Hipo/drf-extra-fields) [![PyPI Version](https://img.shields.io/pypi/v/drf-extra-fields.svg)](https://pypi.org/project/drf-extra-fields) [![Python Versions](https://img.shields.io/pypi/pyversions/drf-extra-fields.svg)](https://pypi.org/project/drf-extra-fields) +Latest Changes +============== + +- **v3.2.0** + - Support for Python 3.5 is ended. + - Python 3.9 and 3.10 are now supported. + - Django 3.2 is now supported. +- **v3.1.1** + - `psycopg2` dependency is made optional. +- **v3.1.0** + - **Possible Breaking Change**: + - In this version we have changed file class used in `Base64FileField` from `ContentFile` to `SimpleUploadedFile` (you may see the change [here](https://github.com/Hipo/drf-extra-fields/pull/149/files#diff-5f77bcb61083cd9c026f6dfb3b77bf8fa824c45e620cdb7826ad713bde7b65f8L72-R85)). + Usage ================ @@ -441,8 +452,7 @@ $ tox Or, if you prefer using Docker (recommended): ```bash -docker build -t drf_extra_fields . -docker run -v $(pwd):/app -it drf_extra_fields /bin/bash +source tools/run_development.sh tox ``` diff --git a/setup.py b/setup.py index 03676cd..d3acdd3 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name='drf-extra-fields', - version='3.1.1', + version='3.2.0', packages=['drf_extra_fields', 'drf_extra_fields.runtests'], include_package_data=True, @@ -27,7 +27,7 @@ author='hipo', author_email='pypi@hipolabs.com', url='https://github.com/Hipo/drf-extra-fields', - python_requires=">=3.5", + python_requires=">3.6", install_requires=requirements, classifiers=[ 'Environment :: Web Environment', @@ -37,10 +37,11 @@ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], diff --git a/tools/run_development.sh b/tools/run_development.sh new file mode 100644 index 0000000..5637f16 --- /dev/null +++ b/tools/run_development.sh @@ -0,0 +1,2 @@ +docker build -t drf_extra_fields . +docker run -v $(pwd):/app -it drf_extra_fields /bin/bash \ No newline at end of file diff --git a/tox.ini b/tox.ini index c9a9549..5cb1011 100644 --- a/tox.ini +++ b/tox.ini @@ -1,28 +1,28 @@ +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310 + [tox] envlist = flake8, - py{35,36,37}-drf3-django{22}, - py{36,37,38}-drf3-django{30,31} + py{36,37,38,39,310}-drf3-django{22,30,31,32} [testenv] deps = django22: Django>=2.2,<2.3 django30: Django>=3.0,<3.1 django31: Django>=3.1,<3.2 + django32: Django>=3.2,<3.3 drf3: djangorestframework>=3 -r requirements_dev.txt commands = py.test {posargs} --cov-report=xml --cov -passenv = - CI - TRAVIS - TRAVIS_* [testenv:flake8] deps = flake8 commands = flake8 -passenv = - CI - TRAVIS - TRAVIS_*