diff --git a/codespeed/urls.py b/codespeed/urls.py index e8976a45..cd83233e 100644 --- a/codespeed/urls.py +++ b/codespeed/urls.py @@ -1,14 +1,12 @@ # -*- coding: utf-8 -*- from django.urls import re_path -from django.views.generic import TemplateView from codespeed import views from codespeed.feeds import LatestEntries, LatestSignificantEntries urlpatterns = [ re_path(r'^$', views.HomeView.as_view(), name='home'), - re_path(r'^about/$', - TemplateView.as_view(template_name='about.html'), name='about'), + re_path(r'^about/$', views.about, name='about'), # RSS for reports re_path(r'^feeds/latest/$', LatestEntries(), name='latest-results'), re_path(r'^feeds/latest_significant/$', LatestSignificantEntries(), diff --git a/codespeed/views.py b/codespeed/views.py index a66c62c6..05aabb47 100644 --- a/codespeed/views.py +++ b/codespeed/views.py @@ -3,6 +3,8 @@ import json import logging +import os +import subprocess import django from django.conf import settings @@ -288,7 +290,7 @@ def comparison(request): enviros = Environment.objects.all() if not enviros: return no_environment_error(request) - checkedenviros = get_default_environment(enviros, data) + checkedenviros = get_default_environment(enviros, data, multi=True) if not len(Project.objects.filter(track=True)): return no_default_project_error(request) @@ -1118,4 +1120,22 @@ def makeimage(request): response['Content-Length'] = len(image_data) response['Content-Disposition'] = 'attachment; filename=image.png' + +def _get_current_commit(): + try: + repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + return subprocess.check_output( + ['git', 'rev-parse', 'HEAD'], + cwd=repo_root, + stderr=subprocess.DEVNULL, + ).decode().strip() + except Exception: + return None + +_CURRENT_COMMIT = _get_current_commit() + + +def about(request): + return render(request, 'about.html', {'commit': _CURRENT_COMMIT}) + return response diff --git a/speed_pypy/templates/about.html b/speed_pypy/templates/about.html index ead38b43..d932553a 100644 --- a/speed_pypy/templates/about.html +++ b/speed_pypy/templates/about.html @@ -6,21 +6,27 @@
We have nightly benchmark runs of PyPy, together with CPython data for -comparison. The current benchmarks have run since 2016 on a dedicated machine +comparison. The benchmarks have run since 2016 on a dedicated machine named benchmarker. Previously, we had other machines (tannit and briefly speed-python). The benchmarker machine is generously donated by Baroque Software. The specs are:
-Benchmarks are also run on benchmarker2:
+The benchmark code can be found here.
This is a benchmark suite based on Unladen Swallow, adapted for PyPy and
-runs on Python2 and Python3. Also see the
+runs on Python2 and Python3.
Also see the
speed.python.org site.
The source code of this website can be found on the
PyPy
-branch of the Python fork of codespeed.
{{ commit|slice:":12" }}{% endif %}.
For problems or suggestions about this website, please file an issue in the