mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-22 01:27:01 +03:00
Tox & actions updates (#1143)
* Update Django's main branch name * Add Python 3.9 to tox * Update base gh action versions * Add Django 3.2 to tests * Remove redundant Django 1.11 references * Update setup.py for new Django and Python versions
This commit is contained in:
parent
594ca6e25e
commit
3058118e8f
8
.github/workflows/deploy.yml
vendored
8
.github/workflows/deploy.yml
vendored
|
@ -10,11 +10,11 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
python-version: 3.9
|
||||
- name: Build wheel and source tarball
|
||||
run: |
|
||||
pip install wheel
|
||||
|
|
8
.github/workflows/lint.yml
vendored
8
.github/workflows/lint.yml
vendored
|
@ -7,11 +7,11 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
python-version: 3.9
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
|
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
|
@ -8,13 +8,13 @@ jobs:
|
|||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
django: ["2.2", "3.0", "3.1"]
|
||||
python-version: ["3.6", "3.7", "3.8"]
|
||||
django: ["2.2", "3.0", "3.1", "3.2"]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
|
|
@ -281,7 +281,7 @@ from the command line.
|
|||
$ python ./manage.py runserver
|
||||
|
||||
Performing system checks...
|
||||
Django version 1.11, using settings 'cookbook.settings'
|
||||
Django version 3.1.7, using settings 'cookbook.settings'
|
||||
Starting development server at http://127.0.0.1:8000/
|
||||
Quit the server with CONTROL-C.
|
||||
|
||||
|
|
|
@ -238,10 +238,7 @@ def convert_onetoone_field_to_djangomodel(field, registry=None):
|
|||
if not _type:
|
||||
return
|
||||
|
||||
# We do this for a bug in Django 1.8, where null attr
|
||||
# is not available in the OneToOneRel instance
|
||||
null = getattr(field, "null", True)
|
||||
return Field(_type, required=not null)
|
||||
return Field(_type, required=not field.null)
|
||||
|
||||
return Dynamic(dynamic_type)
|
||||
|
||||
|
|
|
@ -16,10 +16,7 @@ from __future__ import unicode_literals
|
|||
from django.conf import settings
|
||||
from django.test.signals import setting_changed
|
||||
|
||||
try:
|
||||
import importlib # Available in Python 3.1+
|
||||
except ImportError:
|
||||
from django.utils import importlib # Will be removed in Django 1.9
|
||||
import importlib # Available in Python 3.1+
|
||||
|
||||
|
||||
# Copied shamelessly from Django REST Framework
|
||||
|
|
4
setup.py
4
setup.py
|
@ -49,11 +49,13 @@ setup(
|
|||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
"Framework :: Django",
|
||||
"Framework :: Django :: 1.11",
|
||||
"Framework :: Django :: 2.2",
|
||||
"Framework :: Django :: 3.0",
|
||||
"Framework :: Django :: 3.1",
|
||||
"Framework :: Django :: 3.2",
|
||||
],
|
||||
keywords="api graphql protocol rest relay graphene",
|
||||
packages=find_packages(exclude=["tests", "examples", "examples.*"]),
|
||||
|
|
15
tox.ini
15
tox.ini
|
@ -1,6 +1,6 @@
|
|||
[tox]
|
||||
envlist =
|
||||
py{36,37,38}-django{22,30,31,master},
|
||||
py{36,37,38,39}-django{22,30,31,32,main},
|
||||
black,flake8
|
||||
|
||||
[gh-actions]
|
||||
|
@ -8,13 +8,15 @@ python =
|
|||
3.6: py36
|
||||
3.7: py37
|
||||
3.8: py38
|
||||
3.9: py39
|
||||
|
||||
[gh-actions:env]
|
||||
DJANGO =
|
||||
2.2: django22
|
||||
3.0: django30
|
||||
3.1: django31
|
||||
master: djangomaster
|
||||
3.2: django32
|
||||
main: djangomain
|
||||
|
||||
[testenv]
|
||||
passenv = *
|
||||
|
@ -24,24 +26,23 @@ setenv =
|
|||
deps =
|
||||
-e.[test]
|
||||
psycopg2-binary
|
||||
django111: Django>=1.11,<2.0
|
||||
django111: djangorestframework<3.12
|
||||
django20: Django>=2.0,<2.1
|
||||
django21: Django>=2.1,<2.2
|
||||
django22: Django>=2.2,<3.0
|
||||
django30: Django>=3.0a1,<3.1
|
||||
django31: Django>=3.1,<3.2
|
||||
djangomaster: https://github.com/django/django/archive/master.zip
|
||||
django32: Django>=3.2a1,<3.3
|
||||
djangomain: https://github.com/django/django/archive/main.zip
|
||||
commands = {posargs:py.test --cov=graphene_django graphene_django examples}
|
||||
|
||||
[testenv:black]
|
||||
basepython = python3.8
|
||||
basepython = python3.9
|
||||
deps = -e.[dev]
|
||||
commands =
|
||||
black --exclude "/migrations/" graphene_django examples setup.py --check
|
||||
|
||||
[testenv:flake8]
|
||||
basepython = python3.8
|
||||
basepython = python3.9
|
||||
deps = -e.[dev]
|
||||
commands =
|
||||
flake8 graphene_django examples setup.py
|
||||
|
|
Loading…
Reference in New Issue
Block a user