Skip to content

Commit 999be9b

Browse files
author
Alexey Semashkevich
authored
Merge pull request #19 from peopledoc/django3compat
Django 3 & reshape the repo
2 parents 01c3896 + 2b1f6e1 commit 999be9b

23 files changed

+254
-248
lines changed

.github/workflows/ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'master'
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
14+
# When testing new Python or Django versions, one should use the
15+
# filterwarnings definition of setup.cfg to turn deprecation warnings
16+
# into errors.
17+
strategy:
18+
matrix:
19+
include:
20+
21+
- name: Python 3.7 / Django 3.2
22+
python_version: "3.7"
23+
tox_env: py37-django32
24+
25+
- name: Python 3.8 / Django 3.2
26+
python_version: "3.8"
27+
tox_env: py38-django32
28+
29+
- name: Python 3.9 / Django 2.2
30+
python_version: "3.9"
31+
tox_env: py39-django22
32+
33+
- name: Python 3.9 / Django 3.0
34+
python_version: "3.9"
35+
tox_env: py39-django30
36+
37+
- name: Python 3.9 / Django 3.1
38+
python_version: "3.9"
39+
tox_env: py39-django31
40+
41+
- name: Python 3.9 / Django 3.2
42+
python_version: "3.9"
43+
tox_env: py39-django32
44+
45+
- name: Python 3.9 / Django 4.0
46+
python_version: "3.9"
47+
tox_env: py39-django40
48+
49+
- name: Python 3.10 / Django 3.2
50+
python_version: "3.10"
51+
tox_env: py310-django32
52+
53+
- name: Lint
54+
python_version: "3"
55+
tox_env: lint
56+
57+
- name: Docs
58+
python_version: "3"
59+
tox_env: docs
60+
61+
name: "${{ matrix.name }}"
62+
runs-on: ubuntu-latest
63+
64+
services:
65+
postgres:
66+
image: postgres
67+
# Set health checks to wait until postgres has started
68+
env:
69+
POSTGRES_PASSWORD: postgres
70+
options: >-
71+
--health-cmd pg_isready
72+
--health-interval 10s
73+
--health-timeout 5s
74+
ports:
75+
- 5432:5432
76+
77+
steps:
78+
- uses: actions/checkout@v2
79+
80+
- name: Set up Python
81+
id: setup-python
82+
uses: actions/setup-python@v2
83+
with:
84+
python-version: ${{ matrix.python_version }}
85+
86+
- name: Pip cache
87+
uses: actions/cache@v2
88+
with:
89+
path: |
90+
~/.cache/
91+
key: ${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('setup.py') }}
92+
93+
- name: Install Tox
94+
run: pip install tox
95+
96+
- name: Run ${{ matrix.name }}
97+
run: tox -e ${{ matrix.tox_env }}
98+
env:
99+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
100+
101+
report-status:
102+
name: success
103+
runs-on: ubuntu-latest
104+
needs: build
105+
steps:
106+
107+
- name: Report success
108+
run: echo 'Success !'

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ Tips
109109

110110
To run a subset of tests::
111111

112-
$ python -m unittest tests.test_django_readonly_field
112+
$ pytest tests/test_django_readonly_field

LICENSE

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11

22
MIT License
33

4-
Copyright (c) 2016, Joachim Jablon
4+
Copyright (c) 2016, PeopleDoc
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
77

88
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
99

1010
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11-
12-
13-
14-

Makefile

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

django_readonly_field/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import django
2+
13
__version__ = "1.0.6dev0"
24

3-
default_app_config = "django_readonly_field.apps.Readonly"
5+
6+
if django.VERSION[:2] < (3, 2):
7+
default_app_config = "django_readonly_field.apps.Readonly"

django_readonly_field/apps.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import unicode_literals
2-
31
from django.apps import AppConfig
42

53

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '2.1'
2+
services:
3+
4+
postgres:
5+
image: postgres
6+
ports: ["5432:5432"]
7+
environment:
8+
POSTGRES_DB: db
9+
POSTGRES_PASSWORD: password

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100

101101
# The theme to use for HTML and HTML Help pages. See the documentation for
102102
# a list of builtin themes.
103-
html_theme = 'default'
103+
html_theme = 'alabaster'
104104

105105
# Theme options are theme-specific and customize the look and feel of a theme
106106
# further. For a list of options available for each theme, see the

docs/django_readonly_field.rst

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
django_readonly_field package
2-
=============================
1+
django\_readonly\_field package
2+
===============================
33

44
Submodules
55
----------
66

7-
django_readonly_field.apps module
8-
---------------------------------
7+
django\_readonly\_field.apps module
8+
-----------------------------------
99

1010
.. automodule:: django_readonly_field.apps
11-
:members:
12-
:undoc-members:
13-
:show-inheritance:
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
1414

15-
django_readonly_field.compiler module
16-
-------------------------------------
15+
django\_readonly\_field.compiler module
16+
---------------------------------------
1717

1818
.. automodule:: django_readonly_field.compiler
19-
:members:
20-
:undoc-members:
21-
:show-inheritance:
22-
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
2322

2423
Module contents
2524
---------------
2625

2726
.. automodule:: django_readonly_field
28-
:members:
29-
:undoc-members:
30-
:show-inheritance:
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
django>=1.11
2-
-e .
1+
-e .[dev]

0 commit comments

Comments
 (0)