Skip to content

Commit d84c6df

Browse files
Drop support for Python 2 and clarify the fork and upstream distinction (#105)
1 parent 87553fa commit d84c6df

39 files changed

Lines changed: 112 additions & 163 deletions

‎AUTHORS‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Codespeed is written and maintained by Miquel Torres Barceló and various contributors:
1+
Codespeed was written by Miquel Torres Barceló and various contributors:
22

33
Frank Becker
44
Chris Adams
@@ -32,3 +32,7 @@ Codespeed is written and maintained by Miquel Torres Barceló and various contri
3232
Octavian Moraru
3333
Iskander (Alex) Sharipov
3434
Tim (Timmmm)
35+
36+
This fork, which powers speed.python.org and speed.pypy.org, is developed
37+
independently of tobami/codespeed at https://github.com/python/codespeed.
38+
Its contributors are recorded in the Git history.

‎CHANGELOG‎

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

3+
This file records the releases of the original tobami/codespeed project and
4+
ends with its last release, 0.13.0. The python/codespeed fork does not cut
5+
releases, its changes since then are described by Git history.
6+
37
=== Version 0.13.0, February 23, 2019 ===
48
* NEW #263: Added support for Django 2.1, drop support for Django 1.8
59
* NEW #255: Allow partial requests of timeline grid

‎README.md‎

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# Codespeed
22
[![Tests](https://github.com/python/codespeed/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/python/codespeed/actions/workflows/test.yml)
3-
[![PyPI version](https://img.shields.io/pypi/v/codespeed.svg)](https://pypi.python.org/pypi/codespeed)
43

54
Codespeed is a web application to monitor and analyze the performance of your code.
65

7-
Known to be used by [CPython](https://speed.python.org), [PyPy](http://speed.pypy.org), [Twisted](http://speed.twistedmatrix.com) and others.
6+
This started as a fork of [tobami/codespeed](https://github.com/tobami/codespeed),
7+
however it is now developed independently here, and has different requirements.
8+
The `codespeed` Django app is still generic and could possibly be used for other
9+
projects. `speed_python` and `speed_pypy` hold what is specific to the two sites.
810

9-
For an overview of some application concepts see the [wiki page](https://github.com/tobami/codespeed/wiki/Overview)
11+
For an overview of some application concepts see the original project's
12+
[wiki page](https://github.com/tobami/codespeed/wiki/Overview).
1013

1114
## Installation
1215

13-
You will need Python 2.7 or 3.5+.
16+
You will need Python 3.10 or newer.
1417

15-
To install dependencies and the codespeed Django app:
18+
Clone this repository and install the dependencies:
1619

17-
pip install codespeed
20+
git clone https://github.com/python/codespeed.git
21+
cd codespeed
22+
pip install -r requirements.txt
1823

1924
If you want version control integration, there are additional requirements:
2025

@@ -27,8 +32,6 @@ If you want version control integration, there are additional requirements:
2732
Codespeed will try to clone the repo, which depending on the size of the project
2833
can take a long time. Please be patient.
2934

30-
* Download the last stable release from
31-
[github.com/tobami/codespeed/tags](https://github.com/tobami/codespeed/tags), unpack it and install it with `python setup.py install`.
3235
* To get started, you can use the `sample_project` directory as a starting point for your Django project, which can be normally configured by editing `sample_project/settings.py`.
3336
* For simplicity, you can use the default sqlite configuration, which will save
3437
the data to a database named `data.db`
@@ -48,7 +51,6 @@ The codespeed installation can now be accessed by navigating to `http://localhos
4851

4952
**Note**: for production, you should configure a real server like Apache or nginx (refer to the [Django docs](http://docs.djangoproject.com/en/dev/howto/deployment/)). You should also
5053
modify `sample_project/settings.py` and set `DEBUG = False`.
51-
[`sample_project/README.md`](https://github.com/tobami/codespeed/tree/master/sample_project/README.md) also describes some production settings.
5254

5355
### Running the tests
5456

@@ -245,13 +247,14 @@ COMP_EXECUTABLES = [
245247
which have low rate limits so an exception may be thrown when retrieving info
246248
from the Github API due to the rate limit being reached.
247249

248-
## Getting help
250+
## Getting help and reporting bugs
249251

250-
For help regarding the configuration of Codespeed, or to share any ideas or
251-
suggestions you may have, please post on Codespeed's [discussion
252-
group](http://groups.google.com/group/codespeed)
252+
Questions, suggestions and bug reports for this fork belong on the
253+
[GitHub issue tracker](https://github.com/python/codespeed/issues).
254+
The original project's Google group and issue tracker are no longer active.
253255

254-
## Reporting bugs
256+
## History and license
255257

256-
If you find any bug in Codespeed please report it on the
257-
[Github issue tracker](https://github.com/tobami/codespeed/issues)
258+
Codespeed was written by Miquel Torres and contributors (see `AUTHORS`). It is
259+
licensed under the GNU Lesser General Public License v2.1 (see `LICENSE`), this
260+
fork keeps that license.

‎codespeed/admin.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
from django import forms
42
from django.contrib import admin
53

‎codespeed/commits/exceptions.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import absolute_import, unicode_literals
3-
41

52
class CommitLogError(Exception):
63
"""An error when trying to display commit log messages"""

‎codespeed/commits/github.py‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
# encoding: utf-8
21
"""
32
Specialized Git backend which uses Github.com for all of the heavy work
43
54
Among other things, this means that the codespeed server doesn't need to have
65
git installed, the ability to write files, etc.
76
"""
8-
from __future__ import absolute_import
97

108
import logging
11-
try:
12-
# Python 3
13-
from urllib.request import urlopen
14-
from urllib.request import Request
15-
except ImportError:
16-
# Python 2
17-
from urllib2 import urlopen
18-
from urllib2 import Request
9+
from urllib.request import Request, urlopen
1910
import re
2011
import json
2112

‎codespeed/commits/logs.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import absolute_import, unicode_literals
3-
41
import datetime
52
import logging
63

‎codespeed/commits/mercurial.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import absolute_import
3-
41
import os
52
import datetime
63
from subprocess import Popen, PIPE

‎codespeed/commits/subversion.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# -*- coding: utf-8 -*-
21
"""Subversion commit logs support"""
3-
from __future__ import absolute_import
42

53
from datetime import datetime
64

‎codespeed/models.py‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import absolute_import, unicode_literals
3-
41
import logging
52
import os
63
import json
@@ -77,10 +74,10 @@ def save(self, *args, **kwargs):
7774
m.group('username'), m.group('project')
7875
)
7976
self.commit_browsing_url = url
80-
super(Project, self).save(*args, **kwargs)
77+
super().save(*args, **kwargs)
8178

8279

83-
class HistoricalValue(object):
80+
class HistoricalValue:
8481
def __init__(self, name=None, val=0, color='none'):
8582
self.name = name
8683
self.val = val
@@ -241,7 +238,7 @@ class Result(models.Model):
241238
Environment, on_delete=models.CASCADE, related_name="results")
242239

243240
def __str__(self):
244-
return u"%s: %s" % (self.benchmark.name, self.value)
241+
return "%s: %s" % (self.benchmark.name, self.value)
245242

246243
class Meta:
247244
unique_together = ("revision", "executable", "benchmark", "environment")
@@ -259,7 +256,7 @@ class Report(models.Model):
259256
_tablecache = models.TextField(blank=True)
260257

261258
def __str__(self):
262-
return u"Report for %s" % self.revision
259+
return "Report for %s" % self.revision
263260

264261
class Meta:
265262
unique_together = ("revision", "executable", "environment")
@@ -270,7 +267,7 @@ def save(self, *args, **kwargs):
270267
changes = self.aggregate_significant_changes(tablelist)
271268
self.update_to_highest_priority_change(changes)
272269

273-
super(Report, self).save(*args, **kwargs)
270+
super().save(*args, **kwargs)
274271

275272
def update_to_highest_priority_change(self, changes):
276273
average_change = changes['average_change']
@@ -367,7 +364,7 @@ def updown(self, val):
367364
direction = val >= 0 and "up" or "down"
368365
aval = abs(val)
369366
if aval == float("inf"):
370-
return u"%s ∞%%" % direction
367+
return "%s ∞%%" % direction
371368
else:
372369
return "%s %.1f%%" % (direction, aval)
373370

0 commit comments

Comments
 (0)