[arch-commits] Commit in python-pytest-django/repos (3 files)

Felix Yan fyan at archlinux.org
Tue Sep 22 02:56:10 UTC 2015


    Date: Tuesday, September 22, 2015 @ 04:56:10
  Author: fyan
Revision: 141424

archrelease: copy trunk to community-staging-any

Added:
  python-pytest-django/repos/community-staging-any/
  python-pytest-django/repos/community-staging-any/PKGBUILD
    (from rev 141423, python-pytest-django/trunk/PKGBUILD)
  python-pytest-django/repos/community-staging-any/remove-assertion-in-django_settings_is_configured.patch
    (from rev 141423, python-pytest-django/trunk/remove-assertion-in-django_settings_is_configured.patch)

---------------------------------------------------------+
 PKGBUILD                                                |   66 ++++++++++++++
 remove-assertion-in-django_settings_is_configured.patch |   27 +++++
 2 files changed, 93 insertions(+)

Copied: python-pytest-django/repos/community-staging-any/PKGBUILD (from rev 141423, python-pytest-django/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2015-09-22 02:56:10 UTC (rev 141424)
@@ -0,0 +1,66 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgbase=python-pytest-django
+pkgname=('python-pytest-django' 'python2-pytest-django')
+pkgver=2.8.0
+pkgrel=3
+pkgdesc="A Django plugin for py.test"
+arch=('any')
+license=('BSD')
+url="https://github.com/pytest-dev/pytest-django"
+makedepends=('python-pytest' 'python2-pytest' 'git')
+checkdepends=('python-django' 'python2-django' 'python-pytest-xdist' 'python2-pytest-xdist'
+              'twine' 'python2-twine' 'python-south' 'python2-south')
+source=("git+https://github.com/pytest-dev/pytest-django.git#tag=v$pkgver"
+        remove-assertion-in-django_settings_is_configured.patch)
+sha512sums=('SKIP'
+            '3f94b06e83c31a949b0bee5ec9220d137ee4c594e4428f6b22f9e73bb2dbdeb6c2e92561343b940acfda4408b5dc756d3d4c5828818f3554bca644b9bdca9781')
+
+prepare() {
+  # https://github.com/pytest-dev/pytest-django/issues/146
+  (cd pytest-django; patch -p1 -i ../remove-assertion-in-django_settings_is_configured.patch)
+
+  cp -a pytest-django{,-py2}
+}
+
+build() {
+  cd "$srcdir/pytest-django"
+  python setup.py build
+
+  cd "$srcdir/pytest-django-py2"
+  python2 setup.py build
+}
+
+check() {
+  # Hack entry points by installing it
+
+  cd "$srcdir/pytest-django"
+  python setup.py install --root="$PWD/tmp_install" --optimize=1
+  PYTHONPATH="$PWD/tmp_install/usr/lib/python3.5/site-packages:$PYTHONPATH:$PWD" \
+  DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite \
+    py.test tests || warning "Tests failed"
+
+  cd "$srcdir/pytest-django-py2"
+  python2 setup.py install --root="$PWD/tmp_install" --optimize=1
+  PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH:$PWD" \
+  DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite \
+    py.test2 tests || warning "Tests failed"
+  # failed with pytest 2.8, skipping for now.
+}
+
+package_python-pytest-django() {
+  depends=('python-pytest')
+
+  cd pytest-django
+  python setup.py install --root="${pkgdir}" --optimize=1
+  install -Dm664 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
+package_python2-pytest-django() {
+  depends=('python2-pytest')
+
+  cd pytest-django-py2
+  python2 setup.py install --root="${pkgdir}" --optimize=1
+  install -Dm664 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}

Copied: python-pytest-django/repos/community-staging-any/remove-assertion-in-django_settings_is_configured.patch (from rev 141423, python-pytest-django/trunk/remove-assertion-in-django_settings_is_configured.patch)
===================================================================
--- community-staging-any/remove-assertion-in-django_settings_is_configured.patch	                        (rev 0)
+++ community-staging-any/remove-assertion-in-django_settings_is_configured.patch	2015-09-22 02:56:10 UTC (rev 141424)
@@ -0,0 +1,27 @@
+From 963e04688a19e125b86ba026d3ef09e4afe17f69 Mon Sep 17 00:00:00 2001
+From: Daniel Hahler <git at thequod.de>
+Date: Mon, 2 Mar 2015 19:38:22 +0100
+Subject: [PATCH] Remove assertion in django_settings_is_configured
+
+django.conf.settings.configured is not necessarily True, in case DSM
+wasn't set during `pytest_load_initial_conftests`, but gets set in the
+project's conftest (via `pytest_configure`).
+
+Fixes https://github.com/pytest-dev/pytest-django/issues/146
+---
+ pytest_django/lazy_django.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/pytest_django/lazy_django.py b/pytest_django/lazy_django.py
+index 8458040..4ba4d5a 100644
+--- a/pytest_django/lazy_django.py
++++ b/pytest_django/lazy_django.py
+@@ -22,8 +22,6 @@ def django_settings_is_configured():
+ 
+     # If DJANGO_SETTINGS_MODULE is defined at this point, Django is assumed to
+     # always be loaded.
+-    from django.conf import settings
+-    assert settings.configured is True
+     return True
+ 
+ 



More information about the arch-commits mailing list