Skip to content

Django 3 & reshape the repo #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d1181f3
Adding github actions
mike-perdide Jan 11, 2022
6b61884
Update versions tested
mike-perdide Jan 11, 2022
c9ebec8
Configuring pytest in setup.cfg
mike-perdide Jan 11, 2022
17268ca
Enabling pytest in tox.ini
mike-perdide Jan 11, 2022
58a364c
Enable CI for all branches
mike-perdide Jan 11, 2022
f281083
Remove lint test
mike-perdide Jan 11, 2022
e8b941f
Include pytest in test deps
mike-perdide Jan 11, 2022
62d5cac
Adding coverage to tox.ini
mike-perdide Jan 11, 2022
23bf508
Adding pytest-cov and pytest to requirements_test.txt
mike-perdide Jan 11, 2022
fcfb9ce
Unpinning coverage
mike-perdide Jan 11, 2022
d4c5496
Setup DATABASE_URL env var
mike-perdide Jan 11, 2022
d277968
Change test instruction
mike-perdide Jan 11, 2022
c98abca
Remove python_2_unicode_compatible
mike-perdide Jan 11, 2022
45bf988
Fix requirements.txt
mike-perdide Jan 11, 2022
3bd7012
Fix django.urls to path
mike-perdide Jan 11, 2022
16057a7
Add print before failing test
mike-perdide Jan 11, 2022
edf919b
Revert "Add print before failing test"
mike-perdide Jan 11, 2022
da7d744
Remove makefile
Jan 17, 2022
a41e09d
Fix license: software belogs to PeopleDoc
Jan 17, 2022
c15ee1b
Fix contributing: tests are run with Pytest
Jan 17, 2022
6e768ec
Fix warning in recent Django versions
Jan 17, 2022
25cde5a
Use alabaster by default for the doc
Jan 17, 2022
2ddf6ec
Rerun sphinx-apidoc
Jan 17, 2022
12b9ce0
Redo packaging
Jan 17, 2022
2e06f9c
Fix migrations
Jan 17, 2022
35253dc
Lint & fix settings
Jan 17, 2022
b5b84ee
Lint app
Jan 17, 2022
19ed742
Fix app
Jan 17, 2022
2ed95e1
remove unused test_manage.py
Jan 17, 2022
6b2f51b
move tests outside of django app
Jan 17, 2022
1c55541
Add docker-compose
Jan 17, 2022
4aca80f
Lint in CI
Jan 17, 2022
9f20e8c
Build doc in CI
Jan 17, 2022
65fc090
Remove artifacts from the python 2 past
Jan 17, 2022
10fe4e0
Fix warning when running with a recent setuptools & old django
Jan 17, 2022
05fd14e
Don't run twice on PRs
Jan 17, 2022
2b1f6e1
Dix docs tox target & ci
Jan 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI

on:
pull_request:
push:
branches:
- 'master'
tags:
- '*'

jobs:
build:

# When testing new Python or Django versions, one should use the
# filterwarnings definition of setup.cfg to turn deprecation warnings
# into errors.
strategy:
matrix:
include:

- name: Python 3.7 / Django 3.2
python_version: "3.7"
tox_env: py37-django32

- name: Python 3.8 / Django 3.2
python_version: "3.8"
tox_env: py38-django32

- name: Python 3.9 / Django 2.2
python_version: "3.9"
tox_env: py39-django22

- name: Python 3.9 / Django 3.0
python_version: "3.9"
tox_env: py39-django30

- name: Python 3.9 / Django 3.1
python_version: "3.9"
tox_env: py39-django31

- name: Python 3.9 / Django 3.2
python_version: "3.9"
tox_env: py39-django32

- name: Python 3.9 / Django 4.0
python_version: "3.9"
tox_env: py39-django40

- name: Python 3.10 / Django 3.2
python_version: "3.10"
tox_env: py310-django32

- name: Lint
python_version: "3"
tox_env: lint

- name: Docs
python_version: "3"
tox_env: docs

name: "${{ matrix.name }}"
runs-on: ubuntu-latest

services:
postgres:
image: postgres
# Set health checks to wait until postgres has started
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2

- name: Set up Python
id: setup-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}

- name: Pip cache
uses: actions/cache@v2
with:
path: |
~/.cache/
key: ${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('setup.py') }}

- name: Install Tox
run: pip install tox

- name: Run ${{ matrix.name }}
run: tox -e ${{ matrix.tox_env }}
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test

report-status:
name: success
runs-on: ubuntu-latest
needs: build
steps:

- name: Report success
run: echo 'Success !'
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ Tips

To run a subset of tests::

$ python -m unittest tests.test_django_readonly_field
$ pytest tests/test_django_readonly_field
6 changes: 1 addition & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@

MIT License

Copyright (c) 2016, Joachim Jablon
Copyright (c) 2016, PeopleDoc

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:

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

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.




44 changes: 0 additions & 44 deletions Makefile

This file was deleted.

6 changes: 5 additions & 1 deletion django_readonly_field/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import django

__version__ = "1.0.6dev0"

default_app_config = "django_readonly_field.apps.Readonly"

if django.VERSION[:2] < (3, 2):
default_app_config = "django_readonly_field.apps.Readonly"
2 changes: 0 additions & 2 deletions django_readonly_field/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from django.apps import AppConfig


Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '2.1'
services:

postgres:
image: postgres
ports: ["5432:5432"]
environment:
POSTGRES_DB: db
POSTGRES_PASSWORD: password
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

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

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
31 changes: 15 additions & 16 deletions docs/django_readonly_field.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
django_readonly_field package
=============================
django\_readonly\_field package
===============================

Submodules
----------

django_readonly_field.apps module
---------------------------------
django\_readonly\_field.apps module
-----------------------------------

.. automodule:: django_readonly_field.apps
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

django_readonly_field.compiler module
-------------------------------------
django\_readonly\_field.compiler module
---------------------------------------

.. automodule:: django_readonly_field.compiler
:members:
:undoc-members:
:show-inheritance:

:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: django_readonly_field
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
django>=1.11
-e .
-e .[dev]
5 changes: 0 additions & 5 deletions requirements_dev.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements_test.txt

This file was deleted.

46 changes: 0 additions & 46 deletions runtests.py

This file was deleted.

68 changes: 68 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
[metadata]
name = django-readonly-field
description = Make Django model fields readonly
author = PeopleDoc
author_email = peopledoc-python@ukg.com
url = https://github.com/peopledoc/django-readonly-field
long_description = file: README.rst
keywords = django posgresql read-only
license = MIT
classifiers =
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',

[options]
zip_safe = True
include_package_data = True
packages = find:
install_requires =
Django

[options.extras_require]

dev =
build
dj_database_url
flake8
psycopg2
pytest
pytest-cov
pytest-django
requests
sphinx
tox
twine

[isort]
profile = black

[flake8]
ignore = E501

[wheel]
universal = 1

[doc8]
max-line-length=88
ignore-path=docs/_build


[tool:pytest]
DJANGO_SETTINGS_MODULE = tests.readonly_project.settings
addopts =
--cov-report term-missing --cov-branch --cov-report html --cov-report term
--cov=django_readonly_field -vv --strict-markers -rfE -s
testpaths =
tests/
filterwarnings =
error
ignore:.*distutils Version classes are deprecated.*:DeprecationWarning
Loading