Skip to content

Commit

Permalink
Merge pull request #163 from Hipo/replace-travis-with-github-actions
Browse files Browse the repository at this point in the history
Replace Travis with GitHub Actions and add support for Python 3.9-3.10 and Django 3.2
  • Loading branch information
omerfarukabaci authored Nov 4, 2021
2 parents e9c1aec + 9c65cc4 commit 4e446eb
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 45 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
fail_ci_if_error: true
verbose: true
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM ubuntu:18.04

MAINTAINER Marco Chiappetta <[email protected]>
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

Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
================

Expand Down Expand Up @@ -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
```

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -27,7 +27,7 @@
author='hipo',
author_email='[email protected]',
url='https://github.com/Hipo/drf-extra-fields',
python_requires=">=3.5",
python_requires=">3.6",
install_requires=requirements,
classifiers=[
'Environment :: Web Environment',
Expand All @@ -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',
],
Expand Down
2 changes: 2 additions & 0 deletions tools/run_development.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker build -t drf_extra_fields .
docker run -v $(pwd):/app -it drf_extra_fields /bin/bash
20 changes: 10 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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_*

0 comments on commit 4e446eb

Please sign in to comment.