Simplified travis config and added Jazzband release config. (#281)

* Simplified travis config and added Jazzband release config.

* Migrate to travis-ci.com.

* Split requirements to prevent env spoilage.

* Add docs requirements.

* Huh

* type

* Add psycopg2 doc requirements.
This commit is contained in:
Jannis Leidel 2020-11-25 22:15:14 +01:00 committed by GitHub
parent 31418d54f2
commit 50da34125c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 69 additions and 69 deletions

View file

@ -1,48 +1,38 @@
# Config file for automatic testing at travis-ci.org
dist: xenial
sudo: required
language: python
services:
- postgresql
- postgresql
addons:
postgresql: "10"
matrix:
postgresql: '10'
cache:
pip: true
python:
- 3.5
- 3.6
- 3.7
- 3.8
jobs:
include:
- python: 3.5
env: TOXENV=py35-django-22
- python: 3.6
env: TOXENV=py36-django-22
- python: 3.6
env: TOXENV=py36-django-30
- python: 3.7
env: TOXENV=py37-django-22
- python: 3.7
env: TOXENV=py37-django-30
- python: 3.8
env: TOXENV=py38-django-22
- python: 3.8
env: TOXENV=py38-django-30
- stage: deploy
if: tag IS present
python: 3.8
script: skip
deploy:
provider: pypi
user: jazzband
server: https://jazzband.co/projects/django-auditlog/upload
distributions: sdist bdist_wheel
password:
secure: AD22a73v//OXpP8WgFscTQHQxpNE5Rup9+NhoxNRNYXszc+g9Z9yNO5cokPHD0HUL7pma/V31xK1tavFO7jHfvidcnx8mNwezoW7lQctNErxhtuAUN59654IaTPmTOU6vvdslmtNT1W/M/LDsp5hWyzaCbTNbl5Ag4+spUpSCq8=
skip_existing: true
on:
tags: true
repo: jazzband/django-auditlog
fast_finish: true
install: pip install -r requirements.txt
script: tox
install:
- travis_retry pip install -U pip
- travis_retry pip install tox-travis codecov
script: tox -v
after_success:
- codecov -e TOX_ENV
deploy:
provider: pypi
# PyPI credentials supplied with environment variables from repository settings
on:
repo: jazzband/django-auditlog
branch: stable
condition: $TOXENV = py38-django-30
edge: true
- codecov

View file

@ -1,3 +1,9 @@
__version__ = '1.0a1'
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("django-auditlog").version
except DistributionNotFound:
# package is not installed
pass
default_app_config = 'auditlog.apps.AuditlogConfig'

View file

@ -259,6 +259,7 @@ class AdditionalDataModelTest(TestCase):
log_entry = obj_with_additional_data.history.get()
self.assertIsNotNone(log_entry.additional_data)
extra_data = log_entry.additional_data
print(type(extra_data), extra_data)
self.assertTrue(extra_data['related_model_text'] == related_model.text,
msg="Related model's text is logged")
self.assertTrue(extra_data['related_model_id'] == related_model.id,

4
docs/requirements.txt Normal file
View file

@ -0,0 +1,4 @@
# Docs requirements
sphinx
sphinx_rtd_theme
psycopg2-binary

View file

@ -9,6 +9,7 @@
import os
import sys
from datetime import date
from pkg_resources import get_distribution
# -- Path setup --------------------------------------------------------------
@ -30,9 +31,9 @@ project = 'django-auditlog'
author = 'Jan-Jelle Kester and contributors'
copyright = f'2013-{date.today().year}, {author}'
# The full version, including alpha/beta/rc tags
import auditlog
release = auditlog.__version__
release = get_distribution('django-auditlog').version
# for example take major/minor
version = '.'.join(release.split('.')[:2])
# -- General configuration ---------------------------------------------------
@ -65,4 +66,4 @@ html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

View file

@ -15,7 +15,7 @@ The repository can be found at https://github.com/jazzband/django-auditlog/.
- Django 2.2 or higher
Auditlog is currently tested with Python 3.5 - 3.8 and Django 2.2, 3.0 and 3.1. The latest test report can be found
at https://travis-ci.org/jazzband/django-auditlog.
at https://travis-ci.com/jazzband/django-auditlog.
Adding Auditlog to your Django application
------------------------------------------

View file

@ -1,17 +0,0 @@
# Library requirements
django-jsonfield
python-dateutil
# Build requirements
setuptools
wheel
# Docs requirements
sphinx
sphinx_rtd_theme
# Test requirements
coverage
tox
codecov
psycopg2-binary

View file

@ -2,15 +2,14 @@ import os
from setuptools import setup
import auditlog
# Readme as long description
with open(os.path.join(os.path.dirname(__file__), "README.md"), "r") as readme_file:
long_description = readme_file.read()
setup(
name='django-auditlog',
version=auditlog.__version__,
use_scm_version={"version_scheme": "post-release"},
setup_requires=["setuptools_scm"],
packages=['auditlog', 'auditlog.migrations', 'auditlog.management', 'auditlog.management.commands'],
url='https://github.com/jazzband/django-auditlog',
license='MIT',

22
tox.ini
View file

@ -3,17 +3,33 @@ envlist =
{py35,py36,py37,py38}-django-22
{py36,py37,py38}-django-30
{py36,py37,py38}-django-31
py38-docs
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/auditlog
commands = coverage run --source auditlog runtests.py
deps =
django-22: Django>=2.2,<2.3
django-30: Django>=3.0,<3.1
-r{toxinidir}/requirements.txt
# Test requirements
coverage
codecov
psycopg2-binary
basepython =
py38: python3.8
py37: python3.7
py36: python3.6
py35: python3.5
[testenv:py38-docs]
changedir = docs/source
deps = -rdocs/requirements.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[travis]
python =
2.7: py27
3.5: py35
3.6: py36
3.7: py37
3.8: py38