pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/py-django-binary-database-files py-django-binary-d...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7d453c017824
branches:  trunk
changeset: 448991:7d453c017824
user:      adam <adam%pkgsrc.org@localhost>
date:      Fri Mar 19 10:09:52 2021 +0000

description:
py-django-binary-database-files: updated to 1.0.14

1.0.14:
Bug fixes

diffstat:

 www/py-django-binary-database-files/Makefile                                             |  12 +-
 www/py-django-binary-database-files/distinfo                                             |  12 +-
 www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py     |  73 ----------
 www/py-django-binary-database-files/patches/patch-binary__database__files_tests_tests.py |  35 ----
 4 files changed, 9 insertions(+), 123 deletions(-)

diffs (164 lines):

diff -r c6ede570bf0f -r 7d453c017824 www/py-django-binary-database-files/Makefile
--- a/www/py-django-binary-database-files/Makefile      Fri Mar 19 10:05:30 2021 +0000
+++ b/www/py-django-binary-database-files/Makefile      Fri Mar 19 10:09:52 2021 +0000
@@ -1,23 +1,19 @@
-# $NetBSD: Makefile,v 1.3 2020/09/11 09:40:24 adam Exp $
+# $NetBSD: Makefile,v 1.4 2021/03/19 10:09:52 adam Exp $
 
-DISTNAME=      django-binary-database-files-1.0.13
+DISTNAME=      django-binary-database-files-1.0.14
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
-PKGREVISION=   1
 CATEGORIES=    www python
-MASTER_SITES=  ${MASTER_SITE_GITHUB:=kimetrica/}
+MASTER_SITES=  ${MASTER_SITE_PYPI:=d/django-binary-database-files/}
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      https://github.com/kimetrica/django-binary-database-files
 COMMENT=       In-database file storage backend for Django
 LICENSE=       modified-bsd
 
-GITHUB_PROJECT=        django-binary-database-files
-GITHUB_TAG=    cedd9f4608eb0da343cf15cfcaf5400a0754cc28
-
 DEPENDS+=      ${PYPKGPREFIX}-django>=2.2:../../www/py-django2
 TEST_DEPENDS+= ${PYPKGPREFIX}-coverage-[0-9]*:../../devel/py-coverage
 
-USE_LANGUAGES=         # none
+USE_LANGUAGES= # none
 
 PYTHON_VERSIONS_INCOMPATIBLE=  27
 
diff -r c6ede570bf0f -r 7d453c017824 www/py-django-binary-database-files/distinfo
--- a/www/py-django-binary-database-files/distinfo      Fri Mar 19 10:05:30 2021 +0000
+++ b/www/py-django-binary-database-files/distinfo      Fri Mar 19 10:09:52 2021 +0000
@@ -1,8 +1,6 @@
-$NetBSD: distinfo,v 1.2 2020/08/19 00:29:46 joerg Exp $
+$NetBSD: distinfo,v 1.3 2021/03/19 10:09:52 adam Exp $
 
-SHA1 (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 74c359eff5cd2039a9bc2badf7f4de581439c4ad
-RMD160 (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 880660c927751ba1cb0def0b97f3b10915a8f893
-SHA512 (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 
a275dc6763f98baf1170c0e160e3b9f2c515af7ee1bfb1229d0106c634c9a77af3b399d8cac781692fad56355f83cc260fd7a22f610600dcd1bbaebd3ce11598
-Size (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 31835 bytes
-SHA1 (patch-binary__database__files_storage.py) = 76eed8510370dd17bddc671b13251581db556181
-SHA1 (patch-binary__database__files_tests_tests.py) = d578a3cbdfb53f8547f689c9e761113abc795fc3
+SHA1 (django-binary-database-files-1.0.14.tar.gz) = 3ddd06b8228b0f4ed95befd57c7734ef911c8789
+RMD160 (django-binary-database-files-1.0.14.tar.gz) = 9f2b4a94d696f3076eabefc83cf58caff35b7892
+SHA512 (django-binary-database-files-1.0.14.tar.gz) = a78baaf3a337e1c14710ccb5b652e887d6969f5541ca99fe5bf14794dbe590422640a48218598156236034a563c9238753b8475798d76fb035a51c58b57ce06e
+Size (django-binary-database-files-1.0.14.tar.gz) = 34576 bytes
diff -r c6ede570bf0f -r 7d453c017824 www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py
--- a/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py      Fri Mar 19 10:05:30 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-$NetBSD: patch-binary__database__files_storage.py,v 1.2 2020/08/19 00:29:46 joerg Exp $
-
-1df96f9f7caf621c4c0d94bc09b27584e1c5aa9d
-73cd278717a4dd9020979d6d08eb56365a728357
-
---- binary_database_files/storage.py.orig      2020-08-10 14:31:32.000000000 +0000
-+++ binary_database_files/storage.py
-@@ -12,6 +12,11 @@ from binary_database_files import utils
- from binary_database_files import settings as _settings
- 
- 
-+class DatabaseFile(files.File):
-+    def close(self):
-+        pass
-+
-+
- class DatabaseStorage(FileSystemStorage):
-     """Subclass of FileSystemStorage that implements the necessary methods to use the database for files."""
- 
-@@ -63,7 +68,7 @@ class DatabaseStorage(FileSystemStorage)
-         fh.name = name
-         fh.mode = mode
-         fh.size = size
--        o = files.File(fh)
-+        o = DatabaseFile(fh)
-         return o
- 
-     def _save(self, name, content):
-@@ -109,21 +109,31 @@ class DatabaseStorage(FileSystemStorage):
-         full_path = safe_join(self.location, name)
-         return full_path[len(root_path) + 1 :]
- 
-+    def _path(self, instance_name):
-+        return safe_join(settings.MEDIA_ROOT, instance_name)
-+
-     def path(self, name):
-         """
-         Return a local filesystem path where the file can be retrieved using
-         Python's built-in open() function.
- 
-         File names are normalized to the MEDIA_ROOT.
-+
-+        If the file has not been saved to disk, a NotImplementedError will
-+        be raised.
-         """
--        return safe_join(settings.MEDIA_ROOT, self.get_instance_name(name))
-+        localpath = self._path(self.get_instance_name(name))
-+        if not os.path.exists(localpath):
-+            raise NotImplementedError
-+        return localpath
- 
-     def exists(self, name):
-         """Return True if a file with the given filename exists in the database. Return False otherwise."""
-         name = self.get_instance_name(name)
-         if models.File.objects.filter(name=name).exists():
-             return True
--        return super(DatabaseStorage, self).exists(name)
-+        localpath = self._path(name)
-+        return os.path.exists(localpath)
- 
-     def delete(self, name):
-         """Delete the file with filename `name` from the database and filesystem."""
-@@ -135,7 +145,9 @@ class DatabaseStorage(FileSystemStorage):
-                 os.remove(hash_fn)
-         except models.File.DoesNotExist:
-             pass
--        return super(DatabaseStorage, self).delete(name)
-+        localpath = self._path(name)
-+        if os.path.exists(localpath):
-+            return super(DatabaseStorage, self).delete(name)
- 
-     def url(self, name):
-         """Return the web-accessible URL for the file with filename `name`.
diff -r c6ede570bf0f -r 7d453c017824 www/py-django-binary-database-files/patches/patch-binary__database__files_tests_tests.py
--- a/www/py-django-binary-database-files/patches/patch-binary__database__files_tests_tests.py  Fri Mar 19 10:05:30 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-$NetBSD: patch-binary__database__files_tests_tests.py,v 1.1 2020/08/18 14:27:16 joerg Exp $
-
-1df96f9f7caf621c4c0d94bc09b27584e1c5aa9d
-
---- binary_database_files/tests/tests.py.orig  2020-08-10 14:31:32.000000000 +0000
-+++ binary_database_files/tests/tests.py
-@@ -313,12 +313,7 @@ class DatabaseFilesTestCase(TestCase):
-         self.assertTrue(t1.upload.storage.exists(t1.upload.name))
-         os.remove(t1.upload.path)
-         self.assertTrue(t1.upload.storage.exists(t1.upload.name))
--        self.assertEqual(
--            t1.upload.path, os.path.join(t1.upload.storage.location, "dummy.txt")
--        )
--        self.assertEqual(
--            t1.upload.path, Location1Thing.objects.get(pk=t1.pk).upload.path
--        )
-+        self.assertRaises(NotImplementedError, lambda t1: t1.upload.path, t1)
-         data2 = b"22222222"
-         open(os.path.join(tmpdir, "dummy.txt"), "wb").write(data2)
-         t2 = Location2Thing.objects.create(
-@@ -326,13 +321,7 @@ class DatabaseFilesTestCase(TestCase):
-         )
-         os.remove(t2.upload.path)
-         self.assertTrue(t2.upload.storage.exists(t2.upload.name))
--        self.assertEqual(
--            t2.upload.path, os.path.join(t2.upload.storage.location, "dummy.txt")
--        )
--        self.assertEqual(
--            t2.upload.path, Location2Thing.objects.get(pk=t2.pk).upload.path
--        )
--
-+        self.assertRaises(NotImplementedError, lambda t2: t2.upload.path, t2)
-         self.assertEqual(File.objects.count(), 2)
-         self.assertEqual(Location2Thing.objects.get(pk=t2.pk).upload.file.read(), data2)
-         self.assertEqual(Location1Thing.objects.get(pk=t1.pk).upload.file.read(), data1)



Home | Main Index | Thread Index | Old Index