Skip to content

Commit

Permalink
feat: add Django 3 test support (#106)
Browse files Browse the repository at this point in the history
Django 3.0 is out: https://docs.djangoproject.com/en/3.0/releases/3.0/ Let's see if we're compatible. It turns out no code changes are needed huzzah!
  • Loading branch information
crccheck authored Dec 3, 2019
1 parent 9169f0d commit 4eaf14c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ jobs:
- stage: test
python: 3.7
env: TOX_ENV=django22-py37
- stage: test
python: 3.6
env: TOX_ENV=django30-py36
- stage: test
python: 3.7
env: TOX_ENV=django30-py37
- stage: test
python: 3.8
env: TOX_ENV=django30-py38
- stage: lint
install: pip install black
script: black --check .
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,19 @@ resetdb: ## Delete and then recreate the dev sqlite database
python $(MANAGE) loaddata sample_data

docker/build: ## Build a full set of Docker images
docker/build: docker/build/2.2.6 docker/build/2.1.13 docker/build/2.0.13 docker/build/1.11.25 docker/build/1.10.8 docker/build/1.9.13 docker/build/1.8.18
docker/build: docker/build/3.0 docker/build/2.2.6 docker/build/2.1.13 docker/build/2.0.13 docker/build/1.11.25 docker/build/1.10.8 docker/build/1.9.13 docker/build/1.8.18

docker/build/%:
docker build --build-arg DJANGO_VERSION=$* \
-t $(IMAGE):$$(echo "$*" | cut -f 1-2 -d.) .

run: run/2.2
run: run/3.0

run/%:
docker run --rm -p 8000:8000 -it $(IMAGE):$*

docker/publish: ## Publish Docker images to the hub
docker push $(IMAGE):3.0
docker push $(IMAGE):2.2
docker push $(IMAGE):2.1
docker push $(IMAGE):2.0
Expand All @@ -77,7 +78,7 @@ test/%:
docker run --rm -p 8000:8000 -t $(IMAGE):$* make test

bash:
docker run --rm -it $(IMAGE):2.2 /bin/sh
docker run --rm -it $(IMAGE):3.0 /bin/sh

.PHONY: version
version:
Expand All @@ -92,7 +93,7 @@ version:
# 3. `make release`
# 4. `git push --follow-tags origin master`
# 5. `chandler push`
# 6. `make build docker/publish`
# 6. `make docker/build docker/publish`
release: clean
@-pip install twine wheel > /dev/null
python setup.py sdist bdist_wheel
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ArticleAdmin(DjangoObjectActions, admin.ModelAdmin):
change_actions = ('publish_this', )
```


Usage
-----

Expand Down Expand Up @@ -189,6 +190,12 @@ Limitations
security is planned for the future.


Python and Django compatibility
-------------------------------

See [`tox.ini`](./tox.ini) for which Python and Django versions this supports.


Demo Admin & Docker images
--------------------------

Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ envlist =
django20-{py34,py35,py36,py37},
django21-{py35,py36,py37},
django22-{py36,py37},
django30-{py36,py37,py38},
# run one of the tests again but with coverage
coveralls-django21-py37,
skipsdist = True
Expand All @@ -27,6 +28,7 @@ deps =
django20: Django<2.1
django21: Django<2.2
django22: Django<2.3
django30: Django<3.1

[testenv:coveralls-django21-py37]
commands =
Expand Down

0 comments on commit 4eaf14c

Please sign in to comment.