Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Feb 15, 2022
2 parents 40bd3fb + 07528e7 commit 61267d0
Show file tree
Hide file tree
Showing 40 changed files with 919 additions and 428 deletions.
6 changes: 6 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[bumpversion]
commit = False
tag = False
current_version = 2.0.0

[bumpversion:file:setup.cfg]
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{scss,sass}]
indent_size = 2

[*.{yml,yaml}]
indent_size = 2
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Run CI

# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
- develop
tags:
- '*'
pull_request:
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
django: ['2.2', '3.2']

services:
postgres:
image: postgres:12
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# Needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }})

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: pip install tox tox-gh-actions codecov

- name: Run tests
run: |
export TOXENV=py${PYTHON_VERSION/./}-django${DJANGO/./}
tox
codecov -e TOXENV,DJANGO --file reports/coverage-${TOXENV}.xml
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO: ${{ matrix.django }}
PGHOST: localhost

- name: Publish coverage report
uses: codecov/codecov-action@v1

publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs: tests

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Build sdist and wheel
run: |
pip install pip setuptools wheel --upgrade
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code quality checks

# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
- develop
tags:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
workflow_dispatch:

jobs:
linting:
name: Code-quality checks
runs-on: ubuntu-latest
strategy:
matrix:
toxenv: [isort, black]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: pip install tox
- run: tox
env:
TOXENV: ${{ matrix.toxenv }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ coverage.xml
cover/*
.hypothesis/
junit*.xml
reports/

# Translations
*.pot
Expand Down
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

40 changes: 29 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@ django-timeline-logger

A reusable Django app to log actions and display them in a timeline

.. image:: https://travis-ci.org/maykinmedia/django-timeline-logger.svg?branch=master
:target: https://travis-ci.org/maykinmedia/django-timeline-logger

.. image:: https://codecov.io/gh/maykinmedia/django-timeline-logger/branch/develop/graph/badge.svg
:target: https://codecov.io/gh/maykinmedia/django-timeline-logger

.. image:: https://badge.fury.io/py/django-timeline-logger.svg
:target: https://badge.fury.io/py/django-timeline-logger
|build-status| |code-quality| |coverage| |black|

|python-versions| |django-versions| |pypi-version|

Prerequisites
=============

This project uses `django.contrib.postgres.JSONField`, and as such, you need:
This project uses ``django.contrib.postgres.JSONField``, and as such, you need:

* at least Django 1.11
* at least PostgreSQL 9.4
* at least Django 2.2+
* at least PostgreSQL 10
* at least psycopg2 2.5.4
* A modern setuptools version


Installation
Expand Down Expand Up @@ -66,3 +61,26 @@ Documentation
The extended documentation is available on `Read the Docs`_.

.. _Read the Docs: http://django-timeline-logger.readthedocs.io/en/latest/


.. |build-status| image:: https://github.com/maykinmedia/django-timeline-logger/actions/workflows/ci.yml/badge.svg
:alt: Build status
:target: https://github.com/maykinmedia/django-timeline-logger/actions/workflows/ci.yml

.. |code-quality| image:: https://github.com/maykinmedia/django-timeline-logger/actions//workflows/code_quality.yml/badge.svg
:alt: Code quality checks
:target: https://github.com/maykinmedia/django-timeline-logger/actions//workflows/code_quality.yml

.. |coverage| image:: https://codecov.io/gh/maykinmedia/django-timeline-logger/branch/master/graph/badge.svg
:target: https://codecov.io/gh/maykinmedia/django-timeline-logger
:alt: Coverage status

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. |python-versions| image:: https://img.shields.io/pypi/pyversions/django-timeline-logger.svg

.. |django-versions| image:: https://img.shields.io/pypi/djversions/django-timeline-logger.svg

.. |pypi-version| image:: https://img.shields.io/pypi/v/django-timeline-logger.svg
:target: https://pypi.org/project/django-timeline-logger/
88 changes: 43 additions & 45 deletions demo/demo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,72 +15,70 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

SECRET_KEY = 'such-secret-much-hiding-wow'
SECRET_KEY = "such-secret-much-hiding-wow"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS = ["*"]


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

'import_export',
'timeline_logger',

'demo_app.apps.DemoAppConfig',
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"import_export",
"timeline_logger",
"demo_app.apps.DemoAppConfig",
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]

ROOT_URLCONF = 'demo.urls'
ROOT_URLCONF = "demo.urls"

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]

WSGI_APPLICATION = 'demo.wsgi.application'
WSGI_APPLICATION = "demo.wsgi.application"


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('PGDATABASE', 'timeline_logger'),
'USER': os.getenv('PGUSER', 'postgres'),
'PASSWORD': os.getenv('PGPASSWORD', ''),
'HOST': os.getenv('PGHOST', ''),
'PORT': os.getenv('PGPORT', 5432),
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": os.getenv("PGDATABASE", "timeline_logger"),
"USER": os.getenv("PGUSER", "postgres"),
"PASSWORD": os.getenv("PGPASSWORD", ""),
"HOST": os.getenv("PGHOST", ""),
"PORT": os.getenv("PGPORT", 5432),
}
}

Expand All @@ -90,26 +88,26 @@

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = "en-us"

TIME_ZONE = 'UTC'
TIME_ZONE = "UTC"

USE_I18N = True

Expand All @@ -121,4 +119,4 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'
STATIC_URL = "/static/"
2 changes: 1 addition & 1 deletion demo/demo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
from django.contrib import admin

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r"^admin/", admin.site.urls),
]
3 changes: 2 additions & 1 deletion demo/demo_app/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from import_export.admin import ExportMixin
from import_export.formats import base_formats
from import_export_xml.formats import XML
from timeline_logger.models import TimelineLog

from timeline_logger.admin import TimelineLogAdmin
from timeline_logger.models import TimelineLog
from timeline_logger.resources import TimelineLogResource

admin.site.unregister(TimelineLog)
Expand Down
Loading

0 comments on commit 61267d0

Please sign in to comment.