Skip to content

Commit f234420

Browse files
committed
Merge branch 'master' into speed.python.org
2 parents 862e5b7 + 17cba4b commit f234420

52 files changed

Lines changed: 416 additions & 322 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
*.pyc
2+
*.swp
3+
*.swo
4+
.DS_Store
25
*.db
36
sample_project/repos/*
47
speed_python/repos/*
@@ -7,4 +10,5 @@ speed_python/secret_key
710
override
811
build
912
dist
10-
*.egg-info
13+
codespeed.egg-info/
14+

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ python:
33
- 2.7
44
- 3.4
55
env:
6-
- DJANGO_VERSION=1.8.5
6+
- DJANGO_VERSION=1.8.8
77
- DJANGO_VERSION=1.6.11
88
install:
99
- pip install -q Django==$DJANGO_VERSION
1010
- python setup.py install
1111
script:
1212
- python setup.py test
1313
- python manage.py test codespeed
14+

CHANGELOG

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
== Change Log ==
22

3-
=== Version 0.11a0 ===
3+
=== Version 0.11.0, July 31, 2016 ===
44
* NEW #191: Django 1.7 and 1.8 support
5-
* NEW #192: Python 3.4 support
6-
* FIX #190: Upgrade to jqPlot 1.0.8 and jQuery 1.8
7-
5+
* NEW #192: Initial Python 3.4 support
6+
* NEW #199: str4d upgraded all javascript libraries. Most importantly jqPlot to 1.0.9 and jQuery to 1.12.3
7+
* NEW #203: str4d implemented displaying of quartile and extrema bands on median benchmarks
8+
* NEW #295: javierhonduco gave the application a more modern look
89

910
=== Version 0.10.1, November 1, 2015 ===
1011
* NEW #169: nomeata added admin action to recalculate reports

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
All files in this work, are now covered by the following copyright notice.
22
Please note that included libraries in the media/ directory may have their own license.
33

4-
Copyright (c) 2009-2015 Miquel Torres <tobami@gmail.com>
4+
Copyright (c) 2009-2016 Miquel Torres <tobami@gmail.com>
55

66
This file is part of Codespeed.
77

codespeed/admin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ class ExecutableAdmin(admin.ModelAdmin):
3737

3838

3939
class BenchmarkAdmin(admin.ModelAdmin):
40-
list_display = ('name', 'benchmark_type', 'description', 'units_title',
41-
'units', 'lessisbetter', 'default_on_comparison')
42-
list_filter = ('lessisbetter',)
40+
list_display = ('name', 'benchmark_type', 'data_type', 'description',
41+
'units_title', 'units', 'lessisbetter',
42+
'default_on_comparison')
43+
list_filter = ('data_type','lessisbetter')
4344
ordering = ['name']
4445
search_fields = ('name', 'description')
4546

codespeed/commits/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import, unicode_literals
33

4+
45
class CommitLogError(Exception):
56
"""An error when trying to display commit log messages"""

codespeed/commits/git.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def updaterepo(project, update=True):
1616
return
1717

1818
p = Popen(['git', 'pull'], stdout=PIPE, stderr=PIPE,
19-
cwd=project.working_copy)
19+
cwd=project.working_copy)
2020

2121
stdout, stderr = p.communicate()
2222
if p.returncode != 0:
@@ -27,7 +27,7 @@ def updaterepo(project, update=True):
2727
else:
2828
cmd = ['git', 'clone', project.repo_path, project.repo_name]
2929
p = Popen(cmd, stdout=PIPE, stderr=PIPE,
30-
cwd=settings.REPOSITORY_BASE_PATH)
30+
cwd=settings.REPOSITORY_BASE_PATH)
3131
logger.debug('Cloning Git repo {0} for project {1}'.format(
3232
project.repo_path, project))
3333
stdout, stderr = p.communicate()
@@ -43,9 +43,9 @@ def getlogs(endrev, startrev):
4343
updaterepo(endrev.branch.project, update=False)
4444

4545
cmd = ["git", "log",
46-
# NULL separated values delimited by 0x1e record separators
47-
# See PRETTY FORMATS in git-log(1):
48-
'--format=format:%h%x00%H%x00%at%x00%an%x00%ae%x00%s%x00%b%x1e']
46+
# NULL separated values delimited by 0x1e record separators
47+
# See PRETTY FORMATS in git-log(1):
48+
'--format=format:%h%x00%H%x00%at%x00%an%x00%ae%x00%s%x00%b%x1e']
4949

5050
if endrev.commitid != startrev.commitid:
5151
cmd.append("%s...%s" % (startrev.commitid, endrev.commitid))
@@ -67,7 +67,7 @@ def getlogs(endrev, startrev):
6767
subject, body) = log.split("\x00", 7)
6868

6969
date = datetime.datetime.fromtimestamp(
70-
int(date_t)).strftime("%Y-%m-%d %H:%M:%S")
70+
int(date_t)).strftime("%Y-%m-%d %H:%M:%S")
7171

7272
logs.append({'date': date, 'message': subject, 'commitid': commit_id,
7373
'author': author_name, 'author_email': author_email,

codespeed/commits/github.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ def retrieve_revision(commit_id, username, project, revision=None):
4848
raise e
4949

5050
if commit_json["message"] in ("Not Found", "Server Error",):
51-
# We'll still cache these for a brief period of time to avoid making too many requests:
51+
# We'll still cache these for a brief period of time to avoid
52+
# making too many requests:
5253
cache.set(commit_url, commit_json, 300)
5354
else:
5455
# We'll cache successes for a very long period of time since
5556
# SCM diffs shouldn't change:
5657
cache.set(commit_url, commit_json, 86400 * 30)
5758

5859
if commit_json["message"] in ("Not Found", "Server Error",):
59-
raise CommitLogError("Unable to load %s: %s" % (commit_url, commit_json["message"]))
60+
raise CommitLogError(
61+
"Unable to load %s: %s" % (commit_url, commit_json["message"]))
6062

6163
date = isodate.parse_datetime(commit_json['committer']['date'])
6264

@@ -66,7 +68,8 @@ def retrieve_revision(commit_id, username, project, revision=None):
6668

6769
# We need to convert the timezone-aware date to a naive (i.e.
6870
# timezone-less) date in UTC to avoid killing MySQL:
69-
revision.date = date.astimezone(isodate.tzinfo.Utc()).replace(tzinfo=None)
71+
revision.date = date.astimezone(
72+
isodate.tzinfo.Utc()).replace(tzinfo=None)
7073
revision.author = commit_json['author']['name']
7174
revision.message = commit_json['message']
7275
revision.full_clean()
@@ -85,7 +88,7 @@ def retrieve_revision(commit_id, username, project, revision=None):
8588
def getlogs(endrev, startrev):
8689
if endrev != startrev:
8790
revisions = endrev.branch.revisions.filter(
88-
date__lte=endrev.date, date__gte=startrev.date)
91+
date__lte=endrev.date, date__gte=startrev.date)
8992
else:
9093
revisions = [i for i in (startrev, endrev) if i.commitid]
9194

@@ -105,23 +108,29 @@ def getlogs(endrev, startrev):
105108
last_rev_data = None
106109
revision_count = 0
107110
ancestor_found = False
108-
#TODO: get all revisions between endrev and startrev,
111+
# TODO: get all revisions between endrev and startrev,
109112
# not only those present in the Codespeed DB
110113

111114
for revision in revisions:
112-
last_rev_data = retrieve_revision(revision.commitid, username, project, revision)
115+
last_rev_data = retrieve_revision(
116+
revision.commitid, username, project, revision)
113117
logs.append(last_rev_data)
114118
revision_count += 1
115-
ancestor_found = (startrev.commitid in [rev['sha'] for rev in last_rev_data['parents']])
119+
ancestor_found = (
120+
startrev.commitid in [
121+
rev['sha'] for rev in last_rev_data['parents']])
116122

117123
# Simple approach to find the startrev, stop after found or after
118124
# #GITHUB_REVISION_LIMIT revisions are fetched
119125
while (revision_count < GITHUB_REVISION_LIMIT
120126
and not ancestor_found
121127
and len(last_rev_data['parents']) > 0):
122-
last_rev_data = retrieve_revision(last_rev_data['parents'][0]['sha'], username, project)
128+
last_rev_data = retrieve_revision(
129+
last_rev_data['parents'][0]['sha'], username, project)
123130
logs.append(last_rev_data)
124131
revision_count += 1
125-
ancestor_found = (startrev.commitid in [rev['sha'] for rev in last_rev_data['parents']])
132+
ancestor_found = (
133+
startrev.commitid in [
134+
rev['sha'] for rev in last_rev_data['parents']])
126135

127136
return sorted(logs, key=lambda i: i['date'], reverse=True)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('codespeed', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='benchmark',
16+
name='data_type',
17+
field=models.CharField(default='U', max_length=1, choices=[('U', 'Mean'), ('M', 'Median')]),
18+
),
19+
migrations.AddField(
20+
model_name='result',
21+
name='q1',
22+
field=models.FloatField(null=True, blank=True),
23+
),
24+
migrations.AddField(
25+
model_name='result',
26+
name='q3',
27+
field=models.FloatField(null=True, blank=True),
28+
),
29+
]

0 commit comments

Comments
 (0)