[copr] master: [frontend] specify python3 dependencies (5047329)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 5047329a99f470ce0f30be279f2b2bb4ec4a0b37
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Oct 13 13:55:34 2015 +0200
[frontend] specify python3 dependencies
>---------------------------------------------------------------
frontend/copr-frontend.spec | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec
index c826967..c0cecf2 100644
--- a/frontend/copr-frontend.spec
+++ b/frontend/copr-frontend.spec
@@ -94,6 +94,28 @@ BuildRequires: python-marshmallow >= 2.0.0
BuildRequires: python-sphinx
BuildRequires: python-sphinxcontrib-httpdomain
+%if 0%{?with_python3}
+Requires: python3-flask
+Requires: python3-flask-wtf
+Requires: python3-flask-sqlalchemy
+Requires: python3-flask-script
+Requires: python3-flask-whooshee
+Requires: python3-pytz
+Requires: python3-markdown
+Requires: python3-netaddr
+Requires: python3-redis
+Requires: python3-pylibravatar
+Requires: python3-wtforms
+Requires: python3-flask-wtf
+Requires: python3-flask-restful
+Requires: python3-marshmallow
+Requires: python3-flexmock
+
+# Not packaged yet:
+# Requires: python3-flask-openid # https://bugzilla.redhat.com/show_bug.cgi?id=1010810
+# Requires: python3-openid-teams # https://bugzilla.redhat.com/show_bug.cgi?id=1271176
+%endif # with_python3
+
%description
COPR is lightweight build system. It allows you to create new project in WebUI,
and submit new builds and COPR will create yum repository from latests builds.
8 years, 6 months
[copr] master: [frontend] still run on python2 until we get all py3 dependencies (b9825ef)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b9825ef8398a7b331b4c677338c975fbb4114ff9
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Mon Oct 19 14:59:24 2015 +0200
[frontend] still run on python2 until we get all py3 dependencies
>---------------------------------------------------------------
frontend/coprs_frontend/application | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/application b/frontend/coprs_frontend/application
index 5980a2c..151ec5b 100755
--- a/frontend/coprs_frontend/application
+++ b/frontend/coprs_frontend/application
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python2
import logging
import os
import sys
8 years, 6 months
[copr] master: [frontend] run tests in python3 interpreter (788c3f7)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 788c3f7ecdba40ecc1a30ebf85fa07051a58e573
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Wed Oct 7 11:07:59 2015 +0200
[frontend] run tests in python3 interpreter
>---------------------------------------------------------------
frontend/run_tests.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/frontend/run_tests.sh b/frontend/run_tests.sh
index 839f1f6..b66bd43 100755
--- a/frontend/run_tests.sh
+++ b/frontend/run_tests.sh
@@ -6,7 +6,7 @@ redis-server --port $REDIS_PORT &> _redis.log &
cd coprs_frontend
-COPR_CONFIG="$(pwd)/config/copr_unit_test.conf" python -m pytest tests -s $@ # \
+COPR_CONFIG="$(pwd)/config/copr_unit_test.conf" python3 -m pytest tests -s $@ # \
#--cov-report term-missing --cov coprs $@
kill %1
8 years, 6 months
[copr] master: [frontend] run on python3 from apache (b66fa9d)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b66fa9d480af4d152d16e46d19f26380292266c1
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Oct 13 14:42:11 2015 +0200
[frontend] run on python3 from apache
>---------------------------------------------------------------
frontend/coprs_frontend/application | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/application b/frontend/coprs_frontend/application
index 32d4ff0..5980a2c 100755
--- a/frontend/coprs_frontend/application
+++ b/frontend/coprs_frontend/application
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
import logging
import os
import sys
8 years, 6 months
[copr] master: [frontend] use print function instead of statement (65ab9e0)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 65ab9e048bbc975ef3a37e423dae337bf6bf7c32
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Oct 13 12:55:49 2015 +0200
[frontend] use print function instead of statement
>---------------------------------------------------------------
.../versions/52e53e7b413e_add_build_chroot.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/coprs_frontend/alembic/versions/52e53e7b413e_add_build_chroot.py b/frontend/coprs_frontend/alembic/versions/52e53e7b413e_add_build_chroot.py
index f2bbebe..3d8e444 100644
--- a/frontend/coprs_frontend/alembic/versions/52e53e7b413e_add_build_chroot.py
+++ b/frontend/coprs_frontend/alembic/versions/52e53e7b413e_add_build_chroot.py
@@ -68,8 +68,8 @@ def upgrade():
def downgrade():
- print "Why are you downgrading? You will just lost some data."
+ print("Why are you downgrading? You will just lost some data.")
op.add_column(u"build", sa.Column(u"chroots", sa.TEXT(), nullable=False))
op.add_column(u"build", sa.Column(u"status", sa.INTEGER(), nullable=True))
op.drop_table("build_chroot")
- print "Data about chroots for builds are gone!"
+ print("Data about chroots for builds are gone!")
8 years, 6 months
[copr] master: [frontend] use integers division (526bc71)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 526bc713e28c073dbb2cdc242a2e61f016b91bd5
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Oct 13 16:06:34 2015 +0200
[frontend] use integers division
>---------------------------------------------------------------
frontend/coprs_frontend/coprs/filters.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/filters.py b/frontend/coprs_frontend/coprs/filters.py
index 04f6693..2db8620 100644
--- a/frontend/coprs_frontend/coprs/filters.py
+++ b/frontend/coprs_frontend/coprs/filters.py
@@ -108,19 +108,19 @@ def time_ago(time_in, until=None):
return "1 minute"
elif secdiff < 7200:
# less than 2 hours
- return str(secdiff / 60) + " minutes"
+ return str(secdiff // 60) + " minutes"
elif secdiff < 172800:
# less than 2 days
- return str(secdiff / 3600) + " hours"
+ return str(secdiff // 3600) + " hours"
elif secdiff < 5184000:
# less than 2 months
- return str(secdiff / 86400) + " days"
+ return str(secdiff // 86400) + " days"
elif secdiff < 63072000:
# less than 2 years
- return str(secdiff / 2592000) + " months"
+ return str(secdiff // 2592000) + " months"
else:
# more than 2 years
- return str(secdiff / 31536000) + " days"
+ return str(secdiff // 31536000) + " days"
@app.template_filter("markdown")
8 years, 6 months
[copr] master: [frontend] explicitly cast map results to list On python3, the result of a map function is an iterator, not list (daaafdb)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit daaafdbfa18b23f461abc6f6441ff8f98b2549b7
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Sep 29 12:21:37 2015 +0200
[frontend] explicitly cast map results to list
On python3, the result of a map function is an iterator, not list
>---------------------------------------------------------------
frontend/coprs_frontend/coprs/forms.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/forms.py b/frontend/coprs_frontend/coprs/forms.py
index 1e1fef0..e53c08e 100644
--- a/frontend/coprs_frontend/coprs/forms.py
+++ b/frontend/coprs_frontend/coprs/forms.py
@@ -236,10 +236,10 @@ class CoprFormFactory(object):
have_any = True
return have_any
- F.chroots_list = map(lambda x: x.name,
+ F.chroots_list = list(map(lambda x: x.name,
models.MockChroot.query.filter(
models.MockChroot.is_active == True
- ).all())
+ ).all()))
F.chroots_list.sort()
# sets of chroots according to how we should print them in columns
F.chroots_sets = {}
@@ -309,7 +309,7 @@ class BuildFormFactory(object):
enable_net = wtforms.BooleanField()
- F.chroots_list = map(lambda x: x.name, active_chroots)
+ F.chroots_list = list(map(lambda x: x.name, active_chroots))
F.chroots_list.sort()
F.chroots_sets = {}
for ch in F.chroots_list:
@@ -464,7 +464,7 @@ class BuildFormRebuildFactory(object):
enable_net = wtforms.BooleanField()
- F.chroots_list = map(lambda x: x.name, active_chroots)
+ F.chroots_list = list(map(lambda x: x.name, active_chroots))
F.chroots_list.sort()
F.chroots_sets = {}
for ch in F.chroots_list:
8 years, 6 months
[copr] master: [frontend] sort by argument 'key' instead of 'cmp' (281f8cd)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 281f8cd80d464bce77ee36539a634dc787dd8066
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Sep 29 12:46:13 2015 +0200
[frontend] sort by argument 'key' instead of 'cmp'
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_general.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 071ae37..75c0312 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -505,7 +505,7 @@ def copr_update_permissions(copr):
# if admin is changing his permissions, his must be changed last
# so that we don't get InsufficientRightsException
permissions.sort(
- cmp=lambda x, y: -1 if y.user_id == flask.g.user.id else 1)
+ key=lambda x: -1 if x.user_id == flask.g.user.id else 1)
for perm in permissions:
old_builder = perm.copr_builder
old_admin = perm.copr_admin
8 years, 6 months
[copr] master: [frontend][api 2] don't assert url parameters in fixed order Flask's url_for can generate them randomly (11f105c)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 11f105c68cf6742814a124ea60c5e2abb407157b
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Oct 6 14:53:31 2015 +0200
[frontend][api 2] don't assert url parameters in fixed order
Flask's url_for can generate them randomly
>---------------------------------------------------------------
.../tests/test_api/test_build_task_r.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/frontend/coprs_frontend/tests/test_api/test_build_task_r.py b/frontend/coprs_frontend/tests/test_api/test_build_task_r.py
index 31b1034..e84fe7c 100644
--- a/frontend/coprs_frontend/tests/test_api/test_build_task_r.py
+++ b/frontend/coprs_frontend/tests/test_api/test_build_task_r.py
@@ -3,6 +3,7 @@ import copy
import json
from marshmallow import pprint
+from six.moves.urllib.parse import urlparse, parse_qs
import pytest
import sqlalchemy
@@ -68,7 +69,9 @@ class TestBuildTaskResource(CoprsTestCase):
assert len(obj["build_tasks"]) == len(expected_chroots)
assert set(bt["build_task"]["chroot_name"]
for bt in obj["build_tasks"]) == expected_chroots
- assert obj["_links"]["self"]["href"] == href
+
+ assert parse_qs(urlparse(obj["_links"]["self"]["href"]).query) \
+ == parse_qs(urlparse(href).query)
def test_collection_ok_by_project(
self, f_users, f_coprs, f_mock_chroots, f_builds,
@@ -84,7 +87,8 @@ class TestBuildTaskResource(CoprsTestCase):
assert r0.status_code == 200
obj = json.loads(r0.data.decode("utf-8"))
assert len(obj["build_tasks"]) == len(bc_list)
- assert obj["_links"]["self"]["href"] == href
+ assert parse_qs(urlparse(obj["_links"]["self"]["href"]).query) \
+ == parse_qs(urlparse(href).query)
def test_collection_ok_by_owner(
self, f_users, f_coprs, f_mock_chroots, f_builds,
@@ -103,7 +107,8 @@ class TestBuildTaskResource(CoprsTestCase):
assert r0.status_code == 200
obj = json.loads(r0.data.decode("utf-8"))
assert len(obj["build_tasks"]) == bc_list_len
- assert obj["_links"]["self"]["href"] == href
+ assert parse_qs(urlparse(obj["_links"]["self"]["href"]).query) \
+ == parse_qs(urlparse(href).query)
def test_post_not_allowed(self, f_users, f_coprs, f_mock_chroots, f_builds, f_db,
f_users_api):
8 years, 6 months
[copr] master: [frontend] do the str/bytes/unicode py2/3 compatibility magic (c78520d)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit c78520db46990daf2d44608e9009006a0ef2e76d
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Sep 22 17:35:03 2015 +0200
[frontend] do the str/bytes/unicode py2/3 compatibility magic
>---------------------------------------------------------------
Diff suppressed because of size. To see it, use:
git diff --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol ^c78520db46990daf2d44608e9009006a0ef2e76d~1 c78520db46990daf2d44608e9009006a0ef2e76d
8 years, 6 months