dev-python/django: treeclean
This commit is contained in:
parent
9a455f2d8f
commit
5d5e7e6693
|
@ -1,7 +0,0 @@
|
|||
AUX django-3.1-bashcomp.patch 2085 BLAKE2B 36a0aa4d3413f13089ac104f5d3f98ecbb152a9a5a35f8c1ff2e5ffc9824153b0ac89f1cbca76c31a1afefde471e4d6ed801e405551b25cb31da89c20f3019cc SHA512 82dceede4292bad6e3e4966a6dba01bd2bbc7db494fce592e25dc4a64236485d88d8ad67b247239a80f8fe96dff054d20afea6f48a5518b67cf88404d399e61c
|
||||
AUX django-3.2.3-py310-repr.patch 3827 BLAKE2B 42f68fecf8fba65ffc23d19f95b5232ed020005d347fce1b30bd6a18755e649bc00ebd6aa7235810564e8954726dda4f541c58c599a9433d3ecd539717b97284 SHA512 6cfc9ee5f8c5c9a59bfeb5311e853604a6f77c7c747deb48780122f06e7634ea783f5ae82c4935a2a25f1cac358175cb8cbaa6285bd26da5e6fd35d3e3958e1c
|
||||
DIST Django-3.1.tar.gz 9382872 BLAKE2B 31f2a45cf31f87401ac1834be81cf207ca48f720bf6d6885b774fb51f42616be1346b8ab71d6c0b605d99bc7422f27b21665729b78e00c9cc0ba9cf3e4d788f3 SHA512 31f0821966f4ebc6b2a719b69f1137a32a7228414221e8938a66c9b940465c008761bd380ba9ea603e3693d38c233d6f23afe0cbe5647eb2478844ce2d0e7fd4
|
||||
DIST Django-3.2.4.tar.gz 9824343 BLAKE2B 25123c228171953e057fe6ba75afadc49c49567e167045c292606e914538f58f9628e48485f611afaacd7e173f36c720391c06662f8dcd796e966f7557f60216 SHA512 5891f77c884cb4bc74f4c9759e2e7be463fc0c661b8dd4d889be0ec46919e59b81f5ce1585c28075b15f03355e66d4b8e7b09001f0c2bea15f8c8aac77d1ea16
|
||||
EBUILD django-3.1.ebuild 2571 BLAKE2B f53c757edabfc8c9f200bad0b2dc86aa0bfd9944588602b5ec09e6d664ec79b25dff38f15cd21dc472ea4a5c000b60efdf6b2f2c30b83bb6486d0366d4afae3d SHA512 79578127bd01525ef21cb579107044a0ddbd9c035516bf5785abf2a858264a7cec9d20d352fc04a6d78589b6841034b3597da3ba98e5d0f980bab06673065962
|
||||
EBUILD django-3.2.4.ebuild 2569 BLAKE2B deb699905cfefa78f050325ea1a564d12c21b3343977d993c2acd431f8792c4da51c449a6b2a2c5acff424012c1885dfaf70150d84278a2e983ac3a31a5565fc SHA512 09ef28504fcca958f0619bda3bb45dc4d2094683a5d09f3a947ce88dd410a34f54753c671314508d75d5938716c864c0e29cd5439d62ccf254a68626fd0fb6f0
|
||||
MISC metadata.xml 473 BLAKE2B 6cac5d67c4fe83a1e06040e023799bfccc56e9b79d53a4d3ceecd56f4ae3a6f5871c98df991111c74a1018aac26ee67e2318f1ed1f92533c44a6046adc1dcca9 SHA512 3f8475b63bcbc565f0c7f0f5a4a81aa7b35bbf08b23589a6f9282681dbb4fd5f38d893e4e18dedb12858b1e76e72d6185ef6e5dbcf40b392422a0d7d1e52d9af
|
|
@ -1,91 +0,0 @@
|
|||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
PYTHON_REQ_USE='sqlite?,threads(+)'
|
||||
|
||||
inherit bash-completion-r1 distutils-r1 eutils
|
||||
|
||||
MY_PN="Django"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
|
||||
DESCRIPTION="High-level Python web framework"
|
||||
HOMEPAGE="https://www.djangoproject.com/ https://pypi.org/project/Django/"
|
||||
SRC_URI="https://www.djangoproject.com/m/releases/$(ver_cut 1-2)/${MY_P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
# admin fonts: Roboto (media-fonts/roboto)
|
||||
LICENSE+=" Apache-2.0"
|
||||
# admin icons, jquery, xregexp.js
|
||||
LICENSE+=" MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
||||
IUSE="doc sqlite test"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/sqlparse[${PYTHON_USEDEP}]"
|
||||
BDEPEND="
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
|
||||
test? (
|
||||
$(python_gen_impl_dep sqlite)
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/numpy[${PYTHON_USEDEP}]
|
||||
dev-python/pillow[webp,${PYTHON_USEDEP}]
|
||||
dev-python/pyyaml[${PYTHON_USEDEP}]
|
||||
dev-python/tblib[${PYTHON_USEDEP}]
|
||||
)"
|
||||
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-2.0.7-bashcomp.patch
|
||||
)
|
||||
|
||||
python_prepare_all() {
|
||||
# Prevent d'loading in the doc build
|
||||
sed -e '/^ "sphinx.ext.intersphinx",/d' -i docs/conf.py || die
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile_all() {
|
||||
use doc && emake -C docs html
|
||||
}
|
||||
|
||||
python_test() {
|
||||
# Tests have non-standard assumptions about PYTHONPATH,
|
||||
# and don't work with ${BUILD_DIR}/lib.
|
||||
PYTHONPATH=. "${PYTHON}" tests/runtests.py --settings=test_sqlite -v2 \
|
||||
|| die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
newbashcomp extras/django_bash_completion ${PN}-admin
|
||||
bashcomp_alias ${PN}-admin django-admin.py
|
||||
|
||||
if use doc; then
|
||||
rm -fr docs/_build/html/_sources || die
|
||||
local HTML_DOCS=( docs/_build/html/. )
|
||||
fi
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "Additional Backend support can be enabled via"
|
||||
optfeature "MySQL backend support" dev-python/mysqlclient
|
||||
optfeature "PostgreSQL backend support" dev-python/psycopg:2
|
||||
echo ""
|
||||
elog "Other features can be enhanced by"
|
||||
optfeature "GEO Django" sci-libs/gdal[geos]
|
||||
optfeature "Memcached support" dev-python/pylibmc dev-python/python-memcached
|
||||
optfeature "ImageField Support" dev-python/pillow
|
||||
optfeature "Password encryption" dev-python/bcrypt
|
||||
optfeature "High-level abstractions for Django forms" dev-python/django-formtools
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
PYTHON_REQ_USE='sqlite?,threads(+)'
|
||||
|
||||
inherit bash-completion-r1 distutils-r1 eutils
|
||||
|
||||
MY_PN="Django"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
|
||||
DESCRIPTION="High-level Python web framework"
|
||||
HOMEPAGE="https://www.djangoproject.com/ https://pypi.org/project/Django/"
|
||||
SRC_URI="https://www.djangoproject.com/m/releases/$(ver_cut 1-2)/${MY_P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
# admin fonts: Roboto (media-fonts/roboto)
|
||||
LICENSE+=" Apache-2.0"
|
||||
# admin icons, jquery, xregexp.js
|
||||
LICENSE+=" MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
||||
IUSE="doc sqlite test"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/sqlparse[${PYTHON_USEDEP}]"
|
||||
BDEPEND="
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
|
||||
test? (
|
||||
$(python_gen_impl_dep sqlite)
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/numpy[${PYTHON_USEDEP}]
|
||||
dev-python/pillow[webp,${PYTHON_USEDEP}]
|
||||
dev-python/pyyaml[${PYTHON_USEDEP}]
|
||||
dev-python/tblib[${PYTHON_USEDEP}]
|
||||
)"
|
||||
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-3.1-bashcomp.patch
|
||||
)
|
||||
|
||||
python_prepare_all() {
|
||||
# Prevent d'loading in the doc build
|
||||
sed -e '/^ "sphinx.ext.intersphinx",/d' -i docs/conf.py || die
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile_all() {
|
||||
use doc && emake -C docs html
|
||||
}
|
||||
|
||||
python_test() {
|
||||
# Tests have non-standard assumptions about PYTHONPATH,
|
||||
# and don't work with ${BUILD_DIR}/lib.
|
||||
PYTHONPATH=. "${PYTHON}" tests/runtests.py --settings=test_sqlite -v2 \
|
||||
|| die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
newbashcomp extras/django_bash_completion ${PN}-admin
|
||||
bashcomp_alias ${PN}-admin django-admin.py
|
||||
|
||||
if use doc; then
|
||||
rm -fr docs/_build/html/_sources || die
|
||||
local HTML_DOCS=( docs/_build/html/. )
|
||||
fi
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "Additional Backend support can be enabled via"
|
||||
optfeature "MySQL backend support" dev-python/mysqlclient
|
||||
optfeature "PostgreSQL backend support" dev-python/psycopg:2
|
||||
echo ""
|
||||
elog "Other features can be enhanced by"
|
||||
optfeature "GEO Django" sci-libs/gdal[geos]
|
||||
optfeature "Memcached support" dev-python/pylibmc dev-python/python-memcached
|
||||
optfeature "ImageField Support" dev-python/pillow
|
||||
optfeature "Password encryption" dev-python/bcrypt
|
||||
optfeature "High-level abstractions for Django forms" dev-python/django-formtools
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
From e0a8c0663debeb222bf78b97678f60929313b60a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Wed, 6 May 2020 07:24:05 +0200
|
||||
Subject: [PATCH] Remove completions unsuitable for autoloading
|
||||
|
||||
The override of 'python*' completions, as well as the attempt
|
||||
to './manage.py' completion are not going to work with autoloader.
|
||||
Strip them.
|
||||
---
|
||||
extras/django_bash_completion | 33 +--------------------------------
|
||||
1 file changed, 1 insertion(+), 32 deletions(-)
|
||||
|
||||
diff --git a/extras/django_bash_completion b/extras/django_bash_completion
|
||||
index fa77d59aff..dfeb439a2e 100755
|
||||
--- a/extras/django_bash_completion
|
||||
+++ b/extras/django_bash_completion
|
||||
@@ -37,35 +37,4 @@ _django_completion()
|
||||
DJANGO_AUTO_COMPLETE=1 $1 ) )
|
||||
}
|
||||
# When the django-admin.py deprecation ends, remove django-admin.py.
|
||||
-complete -F _django_completion -o default django-admin.py manage.py django-admin
|
||||
-
|
||||
-_python_django_completion()
|
||||
-{
|
||||
- if [[ ${COMP_CWORD} -ge 2 ]]; then
|
||||
- local PYTHON_EXE=${COMP_WORDS[0]##*/}
|
||||
- if echo "$PYTHON_EXE" | grep -qE "python([3-9]\.[0-9])?"; then
|
||||
- local PYTHON_SCRIPT=${COMP_WORDS[1]##*/}
|
||||
- if echo "$PYTHON_SCRIPT" | grep -qE "manage\.py|django-admin(\.py)?"; then
|
||||
- COMPREPLY=( $( COMP_WORDS=( "${COMP_WORDS[*]:1}" )
|
||||
- COMP_CWORD=$(( COMP_CWORD-1 ))
|
||||
- DJANGO_AUTO_COMPLETE=1 ${COMP_WORDS[*]} ) )
|
||||
- fi
|
||||
- fi
|
||||
- fi
|
||||
-}
|
||||
-
|
||||
-# Support for multiple interpreters.
|
||||
-unset pythons
|
||||
-if command -v whereis &>/dev/null; then
|
||||
- python_interpreters=$(whereis python | cut -d " " -f 2-)
|
||||
- for python in $python_interpreters; do
|
||||
- [[ $python != *-config ]] && pythons="${pythons} ${python##*/}"
|
||||
- done
|
||||
- unset python_interpreters
|
||||
- pythons=$(echo "$pythons" | tr " " "\n" | sort -u | tr "\n" " ")
|
||||
-else
|
||||
- pythons=python
|
||||
-fi
|
||||
-
|
||||
-complete -F _python_django_completion -o default $pythons
|
||||
-unset pythons
|
||||
+complete -F _django_completion -o default django-admin.py django-admin
|
||||
--
|
||||
2.28.0
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
diff --git a/django/db/models/constraints.py b/django/db/models/constraints.py
|
||||
index b073df17636a..6dfc42942f79 100644
|
||||
--- a/django/db/models/constraints.py
|
||||
+++ b/django/db/models/constraints.py
|
||||
@@ -4,6 +4,7 @@
|
||||
from django.db.models.indexes import IndexExpression
|
||||
from django.db.models.query_utils import Q
|
||||
from django.db.models.sql.query import Query
|
||||
+from django.utils.version import PY310
|
||||
|
||||
__all__ = ['CheckConstraint', 'Deferrable', 'UniqueConstraint']
|
||||
|
||||
@@ -85,6 +86,11 @@ class Deferrable(Enum):
|
||||
DEFERRED = 'deferred'
|
||||
IMMEDIATE = 'immediate'
|
||||
|
||||
+ # A similar format is used in Python 3.10+.
|
||||
+ if not PY310:
|
||||
+ def __repr__(self):
|
||||
+ return '%s.%s' % (self.__class__.__qualname__, self._name_)
|
||||
+
|
||||
|
||||
class UniqueConstraint(BaseConstraint):
|
||||
def __init__(
|
||||
@@ -218,7 +224,7 @@ def __repr__(self):
|
||||
'' if not self.expressions else ' expressions=%s' % repr(self.expressions),
|
||||
' name=%s' % repr(self.name),
|
||||
'' if self.condition is None else ' condition=%s' % self.condition,
|
||||
- '' if self.deferrable is None else ' deferrable=%s' % self.deferrable,
|
||||
+ '' if self.deferrable is None else ' deferrable=%r' % self.deferrable,
|
||||
'' if not self.include else ' include=%s' % repr(self.include),
|
||||
'' if not self.opclasses else ' opclasses=%s' % repr(self.opclasses),
|
||||
)
|
||||
diff --git a/django/db/models/enums.py b/django/db/models/enums.py
|
||||
index 7082a397c237..dd9088597d4d 100644
|
||||
--- a/django/db/models/enums.py
|
||||
+++ b/django/db/models/enums.py
|
||||
@@ -2,6 +2,7 @@
|
||||
from types import DynamicClassAttribute
|
||||
|
||||
from django.utils.functional import Promise
|
||||
+from django.utils.version import PY310
|
||||
|
||||
__all__ = ['Choices', 'IntegerChoices', 'TextChoices']
|
||||
|
||||
@@ -74,6 +75,11 @@ def __str__(self):
|
||||
"""
|
||||
return str(self.value)
|
||||
|
||||
+ # A similar format is used in Python 3.10+.
|
||||
+ if not PY310:
|
||||
+ def __repr__(self):
|
||||
+ return '%s.%s' % (self.__class__.__qualname__, self._name_)
|
||||
+
|
||||
|
||||
class IntegerChoices(int, Choices):
|
||||
"""Class for creating enumerated integer choices."""
|
||||
diff --git a/tests/model_enums/tests.py b/tests/model_enums/tests.py
|
||||
index 78f8b146be92..cda835010d7e 100644
|
||||
--- a/tests/model_enums/tests.py
|
||||
+++ b/tests/model_enums/tests.py
|
||||
@@ -48,7 +48,7 @@ def test_integerchoices(self):
|
||||
self.assertEqual(Suit.values, [1, 2, 3, 4])
|
||||
self.assertEqual(Suit.names, ['DIAMOND', 'SPADE', 'HEART', 'CLUB'])
|
||||
|
||||
- self.assertEqual(repr(Suit.DIAMOND), '<Suit.DIAMOND: 1>')
|
||||
+ self.assertEqual(repr(Suit.DIAMOND), 'Suit.DIAMOND')
|
||||
self.assertEqual(Suit.DIAMOND.label, 'Diamond')
|
||||
self.assertEqual(Suit.DIAMOND.value, 1)
|
||||
self.assertEqual(Suit['DIAMOND'], Suit.DIAMOND)
|
||||
@@ -89,7 +89,7 @@ def test_textchoices(self):
|
||||
self.assertEqual(YearInSchool.values, ['FR', 'SO', 'JR', 'SR', 'GR'])
|
||||
self.assertEqual(YearInSchool.names, ['FRESHMAN', 'SOPHOMORE', 'JUNIOR', 'SENIOR', 'GRADUATE'])
|
||||
|
||||
- self.assertEqual(repr(YearInSchool.FRESHMAN), "<YearInSchool.FRESHMAN: 'FR'>")
|
||||
+ self.assertEqual(repr(YearInSchool.FRESHMAN), 'YearInSchool.FRESHMAN')
|
||||
self.assertEqual(YearInSchool.FRESHMAN.label, 'Freshman')
|
||||
self.assertEqual(YearInSchool.FRESHMAN.value, 'FR')
|
||||
self.assertEqual(YearInSchool['FRESHMAN'], YearInSchool.FRESHMAN)
|
||||
diff --git a/django/utils/version.py b/django/utils/version.py
|
||||
index 4b26586b36..b84ca7db27 100644
|
||||
--- a/django/utils/version.py
|
||||
+++ b/django/utils/version.py
|
||||
@@ -13,7 +13,7 @@ PY36 = sys.version_info >= (3, 6)
|
||||
PY37 = sys.version_info >= (3, 7)
|
||||
PY38 = sys.version_info >= (3, 8)
|
||||
PY39 = sys.version_info >= (3, 9)
|
||||
-
|
||||
+PY310 = sys.version_info >= (3, 10)
|
||||
|
||||
def get_version(version=None):
|
||||
"""Return a PEP 440-compliant version number from VERSION."""
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="project">
|
||||
<email>b@edevau.net</email>
|
||||
<name>Andreas Billmeier</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="pypi">Django</remote-id>
|
||||
<maintainer status="unknown">
|
||||
<email>foundation@djangoproject.com</email>
|
||||
<name>Django Software Foundation</name>
|
||||
</maintainer>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
Loading…
Reference in New Issue