Skip to content

Commit

Permalink
Merge branch 'master' into feature/ctk21/ocamlspeed_beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ctk21 committed Mar 7, 2019
2 parents 0eaa2e3 + cb39a69 commit 6fbd0be
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 40 deletions.
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
language: python
python:
- 2.7
- 3.5
branches:
only:
- master
env:
global:
- DJANGO_SETTINGS_MODULE=sample_project.settings
matrix:
- DJANGO_VERSION=1.8
- DJANGO_VERSION=1.11
matrix:
include:
- python: "2.7"
env: DJANGO_VERSION=1.11
- python: "3.5"
env: DJANGO_VERSION=1.11
- python: "3.5"
env: DJANGO_VERSION=2.1
install:
- pip install flake8
- pip install -q Django==$DJANGO_VERSION
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ Codespeed is written and maintained by Miquel Torres Barceló and various contri
Mark Watts
Catalin G. Manciu
Octavian Moraru
Iskander (Alex) Sharipov
Tim (Timmmm)
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
== Change Log ==

=== Version 0.13.0, February 23, 2019 ===
* NEW #263: Added support for Django 2.1, drop support for Django 1.8
* NEW #255: Allow partial requests of timeline grid
* FIX #233: Ensure missing data points don’t lead to infinite loop
* FIX #242: Revision.tag field is not trimmed before insert
* FIX #250: All doesn't work after clicking None in comparison


=== Version 0.12.0, November 11, 2017 ===
* NEW #230: Added support for Django 1.11
* NEW #226: Added previous and next commit navigation to the changes view
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For an overview of some application concepts see the [wiki page](https://github.

# Installation

You will need Python 2.7 or 3.4+.
You will need Python 2.7 or 3.5+.

To install dependencies and the codespeed Django app:

Expand Down
24 changes: 12 additions & 12 deletions codespeed/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Migration(migrations.Migration):
('units', models.CharField(default='seconds', max_length=20)),
('lessisbetter', models.BooleanField(default=True, verbose_name='Less is better')),
('default_on_comparison', models.BooleanField(default=True, verbose_name='Default on comparison page')),
('parent', models.ForeignKey(default=None, to='codespeed.Benchmark', blank=True, help_text='allows to group benchmarks in hierarchies', null=True, verbose_name='parent')),
('parent', models.ForeignKey(default=None, to='codespeed.Benchmark', on_delete=models.CASCADE, blank=True, help_text='allows to group benchmarks in hierarchies', null=True, verbose_name='parent')),
],
),
migrations.CreateModel(
Expand Down Expand Up @@ -73,8 +73,8 @@ class Migration(migrations.Migration):
('summary', models.CharField(max_length=64, blank=True)),
('colorcode', models.CharField(default='none', max_length=10)),
('_tablecache', models.TextField(blank=True)),
('environment', models.ForeignKey(related_name='reports', to='codespeed.Environment')),
('executable', models.ForeignKey(related_name='reports', to='codespeed.Executable')),
('environment', models.ForeignKey(related_name='reports', to='codespeed.Environment', on_delete=models.CASCADE)),
('executable', models.ForeignKey(related_name='reports', to='codespeed.Executable', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
Expand All @@ -86,9 +86,9 @@ class Migration(migrations.Migration):
('val_min', models.FloatField(null=True, blank=True)),
('val_max', models.FloatField(null=True, blank=True)),
('date', models.DateTimeField(null=True, blank=True)),
('benchmark', models.ForeignKey(related_name='results', to='codespeed.Benchmark')),
('environment', models.ForeignKey(related_name='results', to='codespeed.Environment')),
('executable', models.ForeignKey(related_name='results', to='codespeed.Executable')),
('benchmark', models.ForeignKey(related_name='results', to='codespeed.Benchmark', on_delete=models.CASCADE)),
('environment', models.ForeignKey(related_name='results', to='codespeed.Environment', on_delete=models.CASCADE)),
('executable', models.ForeignKey(related_name='results', to='codespeed.Executable', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
Expand All @@ -100,29 +100,29 @@ class Migration(migrations.Migration):
('date', models.DateTimeField(null=True)),
('message', models.TextField(blank=True)),
('author', models.CharField(max_length=100, blank=True)),
('branch', models.ForeignKey(related_name='revisions', to='codespeed.Branch')),
('project', models.ForeignKey(related_name='revisions', blank=True, to='codespeed.Project', null=True)),
('branch', models.ForeignKey(related_name='revisions', to='codespeed.Branch', on_delete=models.CASCADE)),
('project', models.ForeignKey(related_name='revisions', blank=True, to='codespeed.Project', on_delete=models.CASCADE, null=True)),
],
),
migrations.AddField(
model_name='result',
name='revision',
field=models.ForeignKey(related_name='results', to='codespeed.Revision'),
field=models.ForeignKey(related_name='results', to='codespeed.Revision', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='report',
name='revision',
field=models.ForeignKey(related_name='reports', to='codespeed.Revision'),
field=models.ForeignKey(related_name='reports', to='codespeed.Revision', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='executable',
name='project',
field=models.ForeignKey(related_name='executables', to='codespeed.Project'),
field=models.ForeignKey(related_name='executables', to='codespeed.Project', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='branch',
name='project',
field=models.ForeignKey(related_name='branches', to='codespeed.Project'),
field=models.ForeignKey(related_name='branches', to='codespeed.Project', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='revision',
Expand Down
39 changes: 25 additions & 14 deletions codespeed/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json

from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
Expand Down Expand Up @@ -105,7 +105,8 @@ def is_less_important_than(self, val, color):
@python_2_unicode_compatible
class Branch(models.Model):
name = models.CharField(max_length=32)
project = models.ForeignKey(Project, related_name="branches")
project = models.ForeignKey(
Project, on_delete=models.CASCADE, related_name="branches")

def __str__(self):
return self.project.name + ":" + self.name
Expand All @@ -122,10 +123,12 @@ class Revision(models.Model):
tag = models.CharField(max_length=20, blank=True)
date = models.DateTimeField(null=True)
message = models.TextField(blank=True)
project = models.ForeignKey(Project, related_name="revisions",
null=True, blank=True)
project = models.ForeignKey(
Project, on_delete=models.CASCADE, related_name="revisions",
null=True, blank=True)
author = models.CharField(max_length=100, blank=True)
branch = models.ForeignKey(Branch, related_name="revisions")
branch = models.ForeignKey(
Branch, on_delete=models.CASCADE, related_name="revisions")

def get_short_commitid(self):
return self.commitid[:10]
Expand Down Expand Up @@ -163,7 +166,8 @@ def clean(self):
class Executable(models.Model):
name = models.CharField(max_length=30)
description = models.CharField(max_length=200, blank=True)
project = models.ForeignKey(Project, related_name="executables")
project = models.ForeignKey(
Project, on_delete=models.CASCADE, related_name="executables")

class Meta:
unique_together = ('name', 'project')
Expand All @@ -185,7 +189,7 @@ class Benchmark(models.Model):

name = models.CharField(unique=True, max_length=100)
parent = models.ForeignKey(
'self', verbose_name="parent",
'self', on_delete=models.CASCADE, verbose_name="parent",
help_text="allows to group benchmarks in hierarchies",
null=True, blank=True, default=None)
benchmark_type = models.CharField(max_length=1, choices=B_TYPES, default='C')
Expand Down Expand Up @@ -228,10 +232,14 @@ class Result(models.Model):
q1 = models.FloatField(blank=True, null=True)
q3 = models.FloatField(blank=True, null=True)
date = models.DateTimeField(blank=True, null=True)
revision = models.ForeignKey(Revision, related_name="results")
executable = models.ForeignKey(Executable, related_name="results")
benchmark = models.ForeignKey(Benchmark, related_name="results")
environment = models.ForeignKey(Environment, related_name="results")
revision = models.ForeignKey(
Revision, on_delete=models.CASCADE, related_name="results")
executable = models.ForeignKey(
Executable, on_delete=models.CASCADE, related_name="results")
benchmark = models.ForeignKey(
Benchmark, on_delete=models.CASCADE, related_name="results")
environment = models.ForeignKey(
Environment, on_delete=models.CASCADE, related_name="results")

def __str__(self):
return u"%s: %s" % (self.benchmark.name, self.value)
Expand All @@ -242,9 +250,12 @@ class Meta:

@python_2_unicode_compatible
class Report(models.Model):
revision = models.ForeignKey(Revision, related_name="reports")
environment = models.ForeignKey(Environment, related_name="reports")
executable = models.ForeignKey(Executable, related_name="reports")
revision = models.ForeignKey(
Revision, on_delete=models.CASCADE, related_name="reports")
environment = models.ForeignKey(
Environment, on_delete=models.CASCADE, related_name="reports")
executable = models.ForeignKey(
Executable, on_delete=models.CASCADE, related_name="reports")
summary = models.CharField(max_length=64, blank=True)
colorcode = models.CharField(max_length=10, default="none")
_tablecache = models.TextField(blank=True)
Expand Down
2 changes: 1 addition & 1 deletion codespeed/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json

from django.test import TestCase, override_settings
from django.core.urlresolvers import reverse
from django.urls import reverse

from codespeed.models import (Project, Benchmark, Revision, Branch, Executable,
Environment, Result, Report)
Expand Down
2 changes: 1 addition & 1 deletion codespeed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import django

from django.conf import settings
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.http import HttpResponse, Http404, HttpResponseBadRequest, \
HttpResponseNotFound, StreamingHttpResponse
Expand Down
2 changes: 1 addition & 1 deletion codespeed/views_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def getcomparisonexes():
maxlen = 20
# add all tagged revs for any project
for exe in baselines:
if exe['key'] is not "none" and exe['executable'].project == proj:
if exe['key'] != "none" and exe['executable'].project == proj:
executablekeys.append(exe['key'])
executables.append(exe)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django>=1.7,<2.0
Django>=1.11,<2.2
isodate>=0.4.7,<0.6
matplotlib>=1.4.3,<2.0
2 changes: 1 addition & 1 deletion sample_project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.contrib import admin

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/', admin.site.urls),
url(r'^', include('codespeed.urls'))
]

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

setup(
name='codespeed',
version='0.12.0',
version='0.13.0',
author='Miquel Torres',
author_email='[email protected]',
url='https://github.com/tobami/codespeed',
download_url="https://github.com/tobami/codespeed/tags",
license='GNU Lesser General Public License version 2.1',
keywords=['benchmarking', 'visualization'],
install_requires=['django>=1.8,<2.0', 'isodate>=0.4.7,<0.6', 'matplotlib>=1.4.3,<2.0'],
install_requires=['django>=1.11<2.2', 'isodate>=0.4.7,<0.6', 'matplotlib>=1.4.3,<2.0'],
packages=find_packages(exclude=['ez_setup', 'sample_project']),
setup_requires=['setuptools-markdown'],
long_description_markdown_filename='README.md',
Expand All @@ -28,6 +28,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)

0 comments on commit 6fbd0be

Please sign in to comment.