Skip to content

Commit

Permalink
feat: add support for django python
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram committed Sep 18, 2023
1 parent b4b04f3 commit 08691d9
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

# Allows you to run this workflow manually from the Actions tab
on: [push, pull_request, workflow_dispatch]
# Controls when the action will run.
# Controls when the action will run.

jobs:
# Allows you to run this workflow manually from the Actions tab
Expand All @@ -11,7 +11,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: python
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"

install: pip install tox-travis
script: tox
Expand All @@ -13,8 +13,8 @@ cache: pip
matrix:
fast_finish: true
include:
- dist: bionic
python: 3.6
- dist: jammy
python: "3.11"

notifications:
webhooks:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ exist without a domain, so you need it "nested" inside the domain.

## Requirements & Compatibility

- Python (3.7, 3.8, 3.9, 3.10, 3.11)
- Django (2.2, 3.0, 3.1, 3.2, 4.0)
- Django REST Framework (3.11, 3.12, 3.13)
- Python (3.8, 3.9, 3.10, 3.11)
- Django (3.2, 4.1, 4.2)
- Django REST Framework (3.14)

It may work with lower versions, but since the release **0.93.5** is no more tested on CI for Python 3.6 or lower.<br/>
And since **0.92.1** is no more tested on CI for Pythons 2.7 to 3.5, Django 1.11 to 2.1 or DRF 3.6 to 3.10.<br/>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Nested resources for the Django Rest Framework

## Requirements

* Python (2.7, 3.3, 3.4, 3.5, 3.6)
* Django (1.8, 1.9, 1.10)
* Python (3.8, 3.9, 3.10, 3.11)
* Django (3.2, 4.1, 4.2)

## Installation

Expand Down
10 changes: 4 additions & 6 deletions requirements-tox.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Test requirements
pytest==7.4.0
pytest==7.4.2
pytest-cov==4.1.0
pytest-django==4.5.2
flake8==5.0.4
flake8==6.1.0
ipdb==0.13.13
pytz==2023.3

# wheel for PyPI installs
wheel==0.40.0
wheel==0.41.2

# MkDocs for documentation previews/deploys
mkdocs==1.2.4; python_version < '3.8'
markdown==3.2.1; python_version < '3.8'
mkdocs==1.4.1; python_version >= '3.8'
mkdocs==1.5.2
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
-r requirements-tox.txt

# Minimum Django and REST framework version
Django>=2.2
djangorestframework>=3.11.0
Django>=3.2
djangorestframework>=3.14.0

9 changes: 0 additions & 9 deletions rest_framework_nested/runtests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''
Expand Down Expand Up @@ -152,11 +148,6 @@
AUTH_USER_MODEL = 'auth.User'

import django

if django.VERSION < (1, 3):
INSTALLED_APPS += ('staticfiles',)


# If we're running on the Jenkins server we want to archive the coverage reports as XML.
import os
if os.environ.get('HUDSON_URL', None):
Expand Down
15 changes: 7 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,26 @@ def get_package_data(package):
packages=get_packages(package),
package_data=get_package_data(package),
install_requires=[
'djangorestframework>=3.11.0',
'Django>=2.2',
'djangorestframework>=3.14.0',
'Django>=3.2',
],
python_requires=">=3.5",
python_requires=">=3.8",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'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',
'Programming Language :: Python :: 3.11',
'Topic :: Internet :: WWW/HTTP',
]
)
27 changes: 10 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
[tox]
envlist =
{py36,py37,py38,py39,py310,py311}-django{2.2,3.0,3.1,3.2}-drf{3.11,3.12,3.13}
{py38,py39,py310,py311}-django{4.0}-drf{3.12,3.13}
py{38,39,310,311}-django{3.2,4.1,4.2}-drf3.14

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[testenv]
commands = ./runtests.py --nolint
allowlist_externals = *
setenv =
PYTHONDONTWRITEBYTECODE=1
deps =
django2.2: Django>=2.2,<2.3
django3.0: Django>=3.0,<3.1
django3.1: Django>=3.1,<3.2
django3.2: Django>=3.2,<3.3
django4.0: Django>=4.0,<4.1
drf3.11: djangorestframework>=3.11,<3.12
drf3.12: djangorestframework>=3.12,<3.13
drf3.13: djangorestframework>=3.13,<3.14
django4.1: Django>=4.1,<4.2
django4.2: Django>=4.2,<4.3
drf3.14: djangorestframework>=3.14,<3.15
-rrequirements-tox.txt

[testenv:py39-flake8]
[testenv:py311-flake8]
commands = ./runtests.py --lintonly
deps =
-rrequirements-tox.txt

[testenv:py39-docs]
[testenv:py311-docs]
commands = mkdocs build
deps =
mkdocs>=1.3.0

0 comments on commit 08691d9

Please sign in to comment.