Skip to content

Commit e3efed1

Browse files
GitHub actions v2 (#10)
* Try tox * Correct use of py310 * Try tox-gh * Up docs * Blackify * Blackify * Clean up * Clean up * Up docs
1 parent 2c1e8c1 commit e3efed1

35 files changed

+357
-130
lines changed

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install Dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
- name: Install tox-gh
24+
run: python -m pip install tox-gh
25+
- name: Setup test suite
26+
run: tox4 r -vv --notest
27+
- name: Run test suite
28+
run: tox4 r --skip-pkg-install
29+
env:
30+
PYTEST_ADDOPTS: "-vv --durations=10"
31+
- name: Coveralls
32+
uses: AndreMiras/coveralls-python-action@develop
33+
with:
34+
parallel: true
35+
flag-name: Run Tests
36+
37+
coveralls_finish:
38+
needs: test
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Coveralls Finished
42+
env:
43+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
44+
GITHUB_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
45+
uses: AndreMiras/coveralls-python-action@develop
46+
with:
47+
parallel-finished: true
48+
debug: True

CHANGELOG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ are used for versioning (schema follows below):
1717

1818
0.2.12
1919
------
20-
2021-11-25
20+
2021-12-06
2121

2222
- Tested against Django 3.1 and 3.2.
2323
- Tested against Python 3.9 and 3.10.
2424
- Tested against Django REST Framework 3.12.
2525
- Drop Python 2.x support.
2626
- Drop Python 3.5 support.
2727
- Drop Django < 2.2 support.
28-
- Drop Django REST Framework < 3.9.x support.
28+
- Drop Django REST Framework < 3.9 support.
2929

3030
0.2.11
3131
------

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Dependencies
3434
============
3535

3636
- djangorestframework: Initially written with 3.6.3, but nowadays tested
37-
with >=3.9.2,<=3.11.0. May (still) work on earlier- or (even) support
37+
with >=3.9,<3.13. May (still) work on earlier- or (even) support
3838
later- versions, although not guaranteed.
3939

4040
Installation

docs/changelog.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ are used for versioning (schema follows below):
1515
0.3.4 to 0.4).
1616
- All backwards incompatible changes are mentioned in this document.
1717

18+
0.2.12
19+
------
20+
2021-12-06
21+
22+
- Tested against Django 3.1 and 3.2.
23+
- Tested against Python 3.9 and 3.10.
24+
- Tested against Django REST Framework 3.12.
25+
- Drop Python 2.x support.
26+
- Drop Python 3.5 support.
27+
- Drop Django < 2.2 support.
28+
- Drop Django REST Framework < 3.9 support.
29+
1830
0.2.11
1931
------
2032
2019-12-27

docs/index.rst

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ Collection of various tricks for
2727
Prerequisites
2828
=============
2929

30-
- Django 1.8, 1.9, 1.10, 1.11, 2.0, 2.1, 2.2 and 3.0.
31-
- Python 2.7, 3.5, 3.6, 3.7, 3.8
30+
- Django 2.2, 3.0, 3.1 and 3.2.
31+
- Python 3.6, 3.7, 3.8, 3.9 and 3.10.
3232

3333
Dependencies
3434
============
3535

36-
- djangorestframework: Written with 3.6.3, tested with >=3.5.0,<=3.11.0. May
37-
work on earlier versions, although not guaranteed.
36+
- djangorestframework: Initially written with 3.6.3, but nowadays tested
37+
with >=3.9,<3.13. May (still) work on earlier- or (even) support
38+
later- versions, although not guaranteed.
3839

3940
Installation
4041
============
@@ -45,17 +46,11 @@ Installation
4546
4647
pip install django-rest-framework-tricks
4748
48-
or latest stable version from GitHub:
49+
or latest development version from GitHub:
4950

5051
.. code-block:: sh
5152
52-
pip install https://github.com/barseghyanartur/django-rest-framework-tricks/archive/stable.tar.gz
53-
54-
or latest stable version from BitBucket:
55-
56-
.. code-block:: sh
57-
58-
pip install https://bitbucket.org/barseghyanartur/django-rest-framework-tricks/get/stable.tar.gz
53+
pip install https://github.com/barseghyanartur/django-rest-framework-tricks/archive/master.tar.gz
5954
6055
(2) Add ``rest_framework`` and ``rest_framework_tricks`` to ``INSTALLED_APPS``:
6156

@@ -81,7 +76,7 @@ Documentation is available on `Read the Docs
8176
Main features and highlights
8277
============================
8378

84-
- `Nested serializers`_: Nested serializers for non-relational fields.
79+
- `Nested serializers`_: Nested (writable) serializers for non-relational fields.
8580
- `Ordering filter`_: Developer friendly names for ordering options (for
8681
instance, for related field names).
8782

@@ -705,28 +700,19 @@ To test against specific environment, type:
705700

706701
.. code-block:: sh
707702
708-
tox -e py38-django30
703+
tox -e py39-django32
709704
710705
To test just your working environment type:
711706

712707
.. code-block:: sh
713708
714-
./runtests.py
709+
pytest -vvv
715710
716711
To run a single test in your working environment type:
717712

718713
.. code-block:: sh
719714
720-
./runtests.py src/rest_framework_tricks/tests/test_nested_proxy_field.py
721-
722-
Or:
723-
724-
.. code-block:: sh
725-
726-
./manage.py test rest_framework_tricks.tests.test_nested_proxy_field
727-
728-
It's assumed that you have all the requirements installed. If not, first
729-
install the test requirements:
715+
pytest -vvv src/rest_framework_tricks/tests/test_nested_proxy_field.py
730716
731717
.. code-block:: sh
732718

examples/requirements/base.in

Whitespace-only changes.

examples/simple/books/models/author.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ class Author(models.Model):
2424
phone_number = models.CharField(max_length=200, null=True, blank=True)
2525
website = models.URLField(null=True, blank=True)
2626
company = models.CharField(max_length=200, null=True, blank=True)
27-
company_phone_number = models.CharField(max_length=200, null=True, blank=True)
27+
company_phone_number = models.CharField(
28+
max_length=200, null=True, blank=True
29+
)
2830
company_email = models.EmailField(null=True, blank=True)
2931
company_website = models.URLField(null=True, blank=True)
3032

examples/simple/books/models/book.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ class Book(models.Model):
4242
price = models.DecimalField(max_digits=10, decimal_places=2)
4343
pages = models.PositiveIntegerField(default=200)
4444
stock_count = models.PositiveIntegerField(default=30)
45-
tags = models.ManyToManyField("books.Tag", related_name="books", blank=True)
45+
tags = models.ManyToManyField(
46+
"books.Tag", related_name="books", blank=True
47+
)
4648

4749
# This does not cause a model change
4850
publishing_information = NestedProxyField(

examples/simple/books/models/order.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
class Order(models.Model):
1313
"""Order."""
1414

15-
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
15+
owner = models.ForeignKey(
16+
settings.AUTH_USER_MODEL, on_delete=models.CASCADE
17+
)
1618
lines = models.ManyToManyField("books.OrderLine", blank=True)
1719
created = models.DateField(auto_now_add=True)
1820
updated = models.DateField(auto_now=True)

examples/simple/books/models/profile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ class Profile(models.Model):
2121
phone_number = models.CharField(max_length=200, null=True, blank=True)
2222
website = models.URLField(null=True, blank=True)
2323
company = models.CharField(max_length=200, null=True, blank=True)
24-
company_phone_number = models.CharField(max_length=200, null=True, blank=True)
24+
company_phone_number = models.CharField(
25+
max_length=200, null=True, blank=True
26+
)
2527
company_email = models.EmailField(null=True, blank=True)
2628
company_website = models.URLField(null=True, blank=True)
2729

2830
bank_name = models.CharField(max_length=200, null=True, blank=True)
2931
bank_account_name = models.CharField(max_length=200, null=True, blank=True)
30-
bank_account_number = models.CharField(max_length=200, null=True, blank=True)
32+
bank_account_number = models.CharField(
33+
max_length=200, null=True, blank=True
34+
)
3135

3236
# This does not cause a model change
3337
personal_information = NestedProxyField(

0 commit comments

Comments
 (0)