Skip to content

Commit 2a008a3

Browse files
authored
Test against Python 3.9 (#2)
* support for Python 3.9
1 parent 938a02d commit 2a008a3

File tree

3 files changed

+38
-48
lines changed

3 files changed

+38
-48
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on: [push]
44

55
jobs:
66
build:
7-
87
runs-on: ubuntu-latest
98
services:
109
postgres:
@@ -14,36 +13,36 @@ jobs:
1413
POSTGRES_PASSWORD: postgres
1514
POSTGRES_DB: dadv
1615
ports:
17-
# will assign a random free host port
18-
- 5432/tcp
16+
# will assign a random free host port
17+
- 5432/tcp
1918
# needed because the postgres container does not provide a healthcheck
2019
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2120
strategy:
2221
matrix:
23-
python-version: [3.6, 3.7, 3.8]
22+
python-version: [3.6, 3.7, 3.8, 3.9]
2423

2524
steps:
26-
- uses: actions/checkout@v2
27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v1
29-
with:
30-
python-version: ${{ matrix.python-version }}
31-
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install pipenv
35-
pipenv install --dev
36-
- name: Lint with flake8
37-
run: |
38-
# stop the build if there are Python syntax errors or undefined names
39-
pipenv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41-
pipenv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42-
- name: Test with pytest
43-
env:
44-
POSTGRES_HOST: localhost
45-
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
46-
POSTGRES_USER: postgres
47-
POSTGRES_PASSWORD: postgres
48-
run: |
49-
pipenv run tox
25+
- uses: actions/checkout@v2
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v1
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install pipenv
34+
pipenv install --dev
35+
- name: Lint with flake8
36+
run: |
37+
# stop the build if there are Python syntax errors or undefined names
38+
pipenv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40+
pipenv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
- name: Test with pytest
42+
env:
43+
POSTGRES_HOST: localhost
44+
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
45+
POSTGRES_USER: postgres
46+
POSTGRES_PASSWORD: postgres
47+
run: |
48+
pipenv run tox

README.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,20 @@ to the database scheme.
55

66
Based on [django-add-default-value](https://github.com/3YOURMIND/django-add-default-value/) by [3YOURMIND](https://github.com/3YOURMIND). This variant drops support for other databases, specifically the Azure ODBC driver which does not support current versions of Django.
77

8-
98
[![CI](https://github.com/Mariana-Tek/django-add-default-value-postgresql/workflows/Python%20package/badge.svg)](https://github.com/Mariana-Tek/django-add-default-value-postgresql/actions?query=workflow%3A%22Python+package%22)
109
[![PyPi](https://img.shields.io/pypi/v/django-add-default-value-postgresql.svg?branch=master)](https://pypi.org/project/django-add-default-value-postgresql/)
1110

12-
1311
## Dependencies
1412

15-
* Python 3.6, 3.7, or 3.8
16-
* Django 2.2 or 3.0
17-
13+
- Python 3.6, 3.7, 3.8, or 3.9
14+
- Django 2.2 or 3.0
1815

1916
## Installation
2017

2118
`pip install django-add-default-value-postgresql`
2219

23-
You can then use ``AddDefaultValue`` in your migration file to transfer the default
24-
values to your database. Afterwards, it's just the usual ``./manage.py migrate``.
20+
You can then use `AddDefaultValue` in your migration file to transfer the default
21+
values to your database. Afterwards, it's just the usual `./manage.py migrate`.
2522

2623
## Usage
2724

@@ -33,7 +30,6 @@ Add this manually to an autogenerated Migration that adds a new field:
3330
value='my_default'
3431
)
3532

36-
3733
### Example
3834

3935
Given the following migration:
@@ -48,7 +44,6 @@ Given the following migration:
4844

4945
Modify the migration to add a default value:
5046

51-
5247
+from django_add_default_value import AddDefaultValue
5348
+
5449
operations = [
@@ -64,25 +59,21 @@ Modify the migration to add a default value:
6459
+ )
6560
]
6661

67-
If you check ``python manage.py sqlmigrate [app name] [migration]``,
62+
If you check `python manage.py sqlmigrate [app name] [migration]`,
6863
you will see that the default value now gets set.
6964

70-
71-
7265
## Testing
7366

7467
You can test against multiple versions of Django using `tox`. To test across Python versions, use pyenv to run `tox` under each version.
7568

76-
77-
7869
## License
7970

8071
django-add-default-value-postgresql is released under the Apache 2.0 License, based on [django-add-default-value](https://github.com/3YOURMIND/django-add-default-value/) by [3YOURMIND](https://github.com/3YOURMIND) which is also released under the Apache 2.0 License.
8172

8273
### Changes from original source
8374

84-
* removed MySQL-related code
85-
* removed MSSQL-related code
86-
* added allow_migrate_model check on database_forwards and database_backwards
87-
* added support for Python 3.7 and 3.8, dropped support for <3.6
88-
* added support for Django 2.2 and 3.0, dropped support for <2.2
75+
- removed MySQL-related code
76+
- removed MSSQL-related code
77+
- added allow_migrate_model check on database_forwards and database_backwards
78+
- added support for Python 3.7, 3.8, and 3.9, dropped support for <3.6
79+
- added support for Django 2.2 and 3.0, dropped support for <2.2

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ classifiers =
1414
License :: OSI Approved :: Apache Software License
1515
Programming Language :: Python
1616
Programming Language :: Python :: 3
17-
Programming Language :: Python :: 3.5
1817
Programming Language :: Python :: 3.6
1918
Programming Language :: Python :: 3.7
2019
Programming Language :: Python :: 3.8
20+
Programming Language :: Python :: 3.9
2121
Topic :: Software Development :: Libraries :: Python Modules
2222
keywords =
2323
django

0 commit comments

Comments
 (0)