Skip to content

Commit 5f9df80

Browse files
authored
Version 2.0.0 (#53)
1 parent 123da6e commit 5f9df80

22 files changed

+384
-379
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 79
3+
extend-ignore = E203, E501

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [jpadilla]

.github/workflows/main.yml

Lines changed: 77 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,77 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
4-
name: Python package
5-
6-
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
11-
12-
jobs:
13-
build:
14-
15-
runs-on: ubuntu-latest
16-
strategy:
17-
matrix:
18-
python-version: [3.5, 3.6, 3.7, 3.8]
19-
20-
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v1
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install -r requirements.txt
30-
- name: Lint with flake8
31-
run: |
32-
pip install flake8
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37-
- name: Test with pytest
38-
run: |
39-
pip install pytest
40-
pytest
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: ["master"]
7+
pull_request:
8+
branches: ["master"]
9+
# Allow rebuilds via API.
10+
repository_dispatch:
11+
types: rebuild
12+
13+
jobs:
14+
tests:
15+
name: "Python ${{ matrix.python-version }} on ${{ matrix.platform }}"
16+
runs-on: "${{ matrix.platform }}"
17+
env:
18+
USING_COVERAGE: '3.8'
19+
20+
strategy:
21+
matrix:
22+
platform: ["ubuntu-latest"]
23+
python-version: ["3.5", "3.6", "3.7", "3.8"]
24+
25+
steps:
26+
- uses: "actions/checkout@v2"
27+
- uses: "actions/setup-python@v1"
28+
with:
29+
python-version: "${{ matrix.python-version }}"
30+
- name: "Install dependencies"
31+
run: |
32+
python -VV
33+
python -m site
34+
python -m pip install --upgrade pip setuptools wheel
35+
python -m pip install --upgrade virtualenv tox tox-gh-actions
36+
37+
- name: "Run tox targets for ${{ matrix.python-version }}"
38+
run: "python -m tox"
39+
env:
40+
PLATFORM: ${{ matrix.platform }}
41+
42+
package:
43+
name: "Build & verify package"
44+
runs-on: "ubuntu-latest"
45+
46+
steps:
47+
- uses: "actions/checkout@v2"
48+
- uses: "actions/setup-python@v1"
49+
with:
50+
python-version: "3.8"
51+
52+
- name: "Install pep517 and twine"
53+
run: "python -m pip install pep517 twine"
54+
- name: "Build package"
55+
run: "python -m pep517.build --source --binary ."
56+
- name: "List result"
57+
run: "ls -l dist"
58+
- name: "Check long_description"
59+
run: "python -m twine check dist/*"
60+
61+
install-dev:
62+
strategy:
63+
matrix:
64+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
65+
66+
name: "Verify dev env"
67+
runs-on: "${{ matrix.os }}"
68+
69+
steps:
70+
- uses: "actions/checkout@v2"
71+
- uses: "actions/setup-python@v1"
72+
with:
73+
python-version: "3.8"
74+
- name: "Install in dev mode"
75+
run: "python -m pip install -e .[dev]"
76+
- name: "Import package"
77+
run: "python -c 'import rest_framework_xml; print(rest_framework_xml.__version__)'"

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@ lib/
1717
local/
1818

1919
!.gitignore
20-
!.travis.yml
20+
!.github
21+
!.flake8
22+
!.isort.cfg
23+
!.pre-commit-config.yaml
24+
25+
pip-wheel-metadata

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
known_third_party = django,rest_framework,setuptools

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 19.10b0
4+
hooks:
5+
- id: black
6+
language_version: python3.8
7+
8+
- repo: https://gitlab.com/pycqa/flake8
9+
rev: 3.7.9
10+
hooks:
11+
- id: flake8
12+
language_version: python3.8
13+
14+
- repo: https://github.com/asottile/seed-isort-config
15+
rev: v1.9.4
16+
hooks:
17+
- id: seed-isort-config
18+
19+
- repo: https://github.com/pre-commit/mirrors-isort
20+
rev: v4.3.21
21+
hooks:
22+
- id: isort
23+
additional_dependencies: [toml]
24+
language_version: python3.8
25+
26+
- repo: https://github.com/pre-commit/pre-commit-hooks
27+
rev: v2.4.0
28+
hooks:
29+
- id: trailing-whitespace
30+
- id: end-of-file-fixer
31+
- id: debug-statements

.travis.yml

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

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
recursive-exclude * __pycache__
22
recursive-exclude * *.py[co]
3-
include requirements.txt

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REST Framework XML
22

3-
[![build-status-image]][travis]
3+
[![build-status-image]][github-action]
44
[![pypi-version]][pypi]
55

66
**XML support for Django REST Framework**
@@ -84,8 +84,8 @@ Full documentation for the project is available at [http://jpadilla.github.io/dj
8484
You may also want to follow the [author][jpadilla] on Twitter.
8585

8686

87-
[build-status-image]: https://secure.travis-ci.org/jpadilla/django-rest-framework-xml.svg?branch=master
88-
[travis]: http://travis-ci.org/jpadilla/django-rest-framework-xml?branch=master
87+
[build-status-image]: https://github.com/jpadilla/django-rest-framework-xml/workflows/CI/badge.svg
88+
[github-action]: https://github.com/jpadilla/django-rest-framework-xml/actions?query=workflow%3ACI
8989
[pypi-version]: https://img.shields.io/pypi/v/djangorestframework-xml.svg
9090
[pypi]: https://pypi.python.org/pypi/djangorestframework-xml
9191
[defusedxml]: https://pypi.python.org/pypi/defusedxml

docs/index.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="badges">
2-
<a href="http://travis-ci.org/jpadilla/django-rest-framework-xml?branch=master">
3-
<img src="https://travis-ci.org/jpadilla/django-rest-framework-xml.svg?branch=master">
2+
<a href="https://github.com/jpadilla/django-rest-framework-xml/actions?query=workflow%3ACI">
3+
<img src="https://github.com/jpadilla/django-rest-framework-xml/workflows/CI/badge.svg">
44
</a>
55
<a href="https://pypi.python.org/pypi/djangorestframework-xml">
66
<img src="https://img.shields.io/pypi/v/djangorestframework-xml.svg">
@@ -90,14 +90,13 @@ class UserViewSet(viewsets.ModelViewSet):
9090
Install testing requirements.
9191

9292
```bash
93-
$ pip install -r requirements.txt
94-
$ pip install -r requirements-test.txt
93+
$ pip install -e '.[dev]'
9594
```
9695

97-
Run with runtests.
96+
Run with pytest.
9897

9998
```bash
100-
$ ./runtests.py
99+
$ pytest
101100
```
102101

103102
You can also use the excellent [tox](http://tox.readthedocs.org/en/latest/) testing tool to run the tests against all supported versions of Python and Django. Install tox globally, and then simply run:

0 commit comments

Comments
 (0)