Skip to content

Commit 3634762

Browse files
authored
Merge pull request AltSchool#303 from AltSchool/drop-py2
Drop support for py2 and move to Github Actions
2 parents 325abf7 + 3904568 commit 3634762

File tree

10 files changed

+88
-104
lines changed

10 files changed

+88
-104
lines changed

.circleci/config.yml

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,15 @@ jobs:
66
parallelism: 1
77

88
docker:
9-
- image: circleci/python:2.7.16-stretch
9+
- image: circleci/python:3.6.9
1010
steps:
1111
- checkout
12-
- run:
13-
name: Update PATH variable
14-
command: echo 'export PATH="${HOME}/.local/bin:${PATH}"' >> ${BASH_ENV}
15-
- run:
16-
name: Install python3-devel
17-
command: sudo apt-get install python3-dev
1812
- run:
1913
name: Install from requirements.txt
2014
command: pip install --user --exists-action w -r requirements.txt
2115
- run:
2216
name: Run Setup
2317
command: python setup.py develop --user
24-
- run:
25-
name: Install pyenv
26-
command: |
27-
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
28-
sudo ln -s $HOME/.pyenv/bin/pyenv /usr/local/bin/pyenv && eval "$(pyenv init -)"
29-
eval "$(pyenv virtualenv-init -)"
30-
- restore_cache:
31-
name: Restore PyEnv Cache
32-
keys:
33-
- v1.1-pyenv-cache-{{ checksum ".circleci/python-versions.txt" }}
34-
- run:
35-
name: Install python versions for testing
36-
command: |
37-
echo "PyEnv Versions already installed:"
38-
pyenv versions
39-
python_versions=$(cat .circleci/python-versions.txt)
40-
echo "Python versions to install: $python_versions"
41-
for python_version in $python_versions; do
42-
echo "INSTALLING: Python $python_version"
43-
pyenv install -s $python_version
44-
done
45-
pyenv local $python_versions
46-
- save_cache:
47-
name: Save PyEnv Cache
48-
key: v1.1-pyenv-cache-{{ checksum ".circleci/python-versions.txt"}}
49-
paths:
50-
- "~/.pyenv"
51-
5218
- run:
5319
name: Run Integration tests
5420
command: ENABLE_INTEGRATION_TESTS=True py.test tests/integration
55-
- run:
56-
name: Run Tox Tests
57-
command: tox --parallel=4 -q
58-
59-
workflows:
60-
version: 2
61-
build-and-test:
62-
jobs:
63-
- build:
64-
context: org-global

.github/workflows/test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: [3.5, 3.6, 3.7]
16+
dj-version: ["1.11.*", "2.0.*", "2.1.*", "2.2.*"]
17+
drf-version: ["3.8.*", "3.9.*", "3.10.*", "3.11.*"]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install Dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
pip install 'django==${{ matrix.dj-version }}' 'djangorestframework==${{ matrix.drf-version }}'
31+
32+
- name: Run Tests
33+
run: |
34+
./runtests.py --fast --coverage -rw
35+
36+
lint:
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
42+
- name: Set up Python37
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: 3.7
46+
47+
- name: Install Dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install flake8==2.4.0
51+
52+
- name: Lint Code
53+
run: |
54+
flake8 dynamic_rest tests

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ but it can be used to provide fast and flexible CRUD operations to any consumer
5757

5858
## Maintainers
5959

60-
* [Anthony Leontiev](mailto:[email protected])
61-
* [Ryo Chijiiwa](mailto:[email protected])
60+
* [Anthony Leontiev](mailto:[email protected])
61+
* [Ryo Chijiiwa](mailto:[email protected])
62+
* [Savinay Nangalia](mailto:[email protected])
6263

6364
# Requirements
6465

65-
* Python (2.7, 3.4, 3.5, 3.6)
66-
* Django (1.8, 1.9, 1.10, 1.11, 2.0, 2.1)
67-
* Django REST Framework (3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9)
66+
* Python (3.5, 3.6, 3.7)
67+
* Django (1.11, 2.0, 2.1, 2.2)
68+
* Django REST Framework (3.8, 3.9, 3.10, 3.11)
6869

6970
# Installation
7071

install_requires.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Django>=1.8,<2.0
2-
djangorestframework>=3.1.0,<3.10
1+
Django>=1.11,<3.0.0
2+
djangorestframework>=3.8.0,<3.12.0
33
inflection==0.3.1
44
requests
5-
pytz

install_requires_python3.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

requirements.test.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Sphinx==1.6.5
2-
dj-database-url==0.4.2
3-
flake8==2.4.0
1+
dj-database-url==0.5.0
2+
djay>=0.0.8
3+
flake8==3.5.0
44
mock==2.0.0
5+
psycopg2==2.7.5
56
pytest-cov==2.5.1
6-
pytest-django==3.1.2
7-
pytest-sugar==0.9.0
8-
pytest==3.2.5 # last supported version python 2
9-
psycopg2==2.7.3.2
7+
pytest-django==3.4.1
8+
pytest-sugar==0.9.1
9+
pytest==3.7.1
10+
Sphinx==1.7.5
1011
tox-pyenv==1.1.0
1112
tox==3.14.6
12-
djay==0.0.8

setup.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import sys
21
from setuptools import find_packages, setup
32

43
NAME = 'dynamic-rest'
54
DESCRIPTION = 'Adds Dynamic API support to Django REST Framework.'
65
URL = 'http://github.com/AltSchool/dynamic-rest'
7-
VERSION = '1.9.7'
6+
VERSION = '1.9.8'
87
SCRIPTS = ['manage.py']
98

109
setup(
1110
description=DESCRIPTION,
1211
include_package_data=True,
13-
install_requires=open('install_requires.txt'
14-
if sys.version_info.major == 2
15-
else 'install_requires_python3.txt').readlines(),
12+
install_requires=open('install_requires.txt').readlines(),
1613
long_description=open('README.rst').read(),
1714
name=NAME,
1815
packages=find_packages(),
@@ -24,8 +21,6 @@
2421
'Intended Audience :: Developers',
2522
'License :: OSI Approved :: BSD License',
2623
'Programming Language :: Python',
27-
'Programming Language :: Python :: 2',
28-
'Programming Language :: Python :: 2.7',
2924
'Programming Language :: Python :: 3',
3025
'Programming Language :: Python :: 3.5',
3126
'Programming Language :: Python :: 3.6',

tests/integration/test_blueprints.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
from unittest import TestCase, skipIf
2-
from dj.test import TemporaryApplication
32
from django.conf import settings
43
import requests
54
import time
65
import json
76
import os
87

8+
try:
9+
from djay.test import TemporaryApplication
10+
except ImportError:
11+
from dj.test import TemporaryApplication
12+
913

1014
class DJBlueprintsTestCase(TestCase):
1115

@@ -14,8 +18,16 @@ class DJBlueprintsTestCase(TestCase):
1418
'Integration tests disabled'
1519
)
1620
def test_blueprints(self):
21+
params = {
22+
"app": "dummy",
23+
"description": "dummy",
24+
"author": "dummy",
25+
"email": "[email protected]",
26+
"version": "0.0.1",
27+
"django_version": "2.2",
28+
}
1729
# generate a test application
18-
application = TemporaryApplication()
30+
application = TemporaryApplication(params=params)
1931
# add a model
2032
application.execute('generate model foo --not-interactive')
2133
# create and apply migrations

tox.ini

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ addopts=--tb=short
33

44
[tox]
55
envlist =
6-
py27-lint,
76
py37-lint,
8-
{py27,py35,py36,py37}-django111-drf{37,38,39},
9-
{py35}-django{20,21,22}-drf{37,38,39,310,311},
10-
{py36,py37}-django{20,21,22}-drf{38,39,310,311},
7+
{py35,py36,py37}-django{111,20,21,22}-drf{38,39,310,311},
118

129
[testenv]
1310
commands = ./runtests.py --fast {posargs} --coverage -rw
@@ -18,30 +15,17 @@ deps =
1815
django20: Django==2.0.13
1916
django21: Django==2.1.15
2017
django22: Django==2.2.12
21-
drf37: djangorestframework==3.7.7
2218
drf38: djangorestframework==3.8.2
2319
drf39: djangorestframework==3.9.4
2420
drf310: djangorestframework==3.10.3
2521
drf311: djangorestframework==3.11.0
26-
-rrequirements.test.txt
27-
28-
[testenv:py27-lint]
29-
commands = ./runtests.py --lintonly
30-
deps =
3122
-rrequirements.txt
3223

3324
[testenv:py37-lint]
3425
commands = ./runtests.py --lintonly
3526
deps =
3627
-rrequirements.txt
3728

38-
[testenv:py27-drf39-benchmarks]
39-
commands = ./runtests.py --benchmarks
40-
deps =
41-
Django==1.11.29
42-
djangorestframework==3.9.4
43-
-rrequirements.benchmark.txt
44-
4529
[testenv:py37-drf311-benchmarks]
4630
commands = ./runtests.py --benchmarks
4731
deps =

0 commit comments

Comments
 (0)