Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmi committed Dec 1, 2020
1 parent 79764ca commit f529dbb
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 77 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8']

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
python -m pip install black flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
black --check django_geosource
flake8 django_geosource
build:
runs-on: ubuntu-latest
needs: [lint]
strategy:
matrix:
python-version: ['3.6', '3.7', '3.9']
django-version: [2.2.*, 3.1.*]
#include:
# - django-version: dev
# python-version: 3.6
# continue-on-error: true
# - django-version: dev
# python-version: 3.9
# continue-on-error: true
services:
postgres:
image: postgis/postgis:10-2.5
env:
POSTGRES_PASSWORD: travis_ci_test
POSTGRES_USER: travis_ci_test
POSTGRES_DB: travis_ci_test
ports:
- 5432:5432
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: |
sudo apt update && sudo apt-get -yq install libproj-dev binutils gdal-bin libgdal-dev
python -m pip install --upgrade pip setuptools wheel
pip install .[dev] -U
if [[ ${{ matrix.django-version }} == dev ]]; then
pip install -e git+https://github.com/django/django@master#egg=django;
else
pip install Django==${{ matrix.django-version }} -U;
fi
- name: Test with coverage
run: |
coverage run ./manage.py test
- name: Coverage upload
run: |
pip install codecov
codecov
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

9 changes: 6 additions & 3 deletions django_geosource/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@


class FieldTypes(Enum):

"""def _generate_next_value_(
name, start, count, last_values=None
): # pylint: disable=no-self-argument
return name.lower() # pylint: disable=no-member"""

String = auto()
Integer = auto()
Float = auto()
Boolean = auto()
Undefined = auto()
Date = auto()

def _generate_next_value_(self, name, start, count, last_values):
return name.lower()

@classmethod
def choices(cls):
return [(enum.value, enum) for enum in cls]
Expand Down

0 comments on commit f529dbb

Please sign in to comment.