pkgsrc-Changes archive

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

CVS commit: pkgsrc/www



Module Name:    pkgsrc
Committed By:   joerg
Date:           Tue Aug 18 14:27:16 UTC 2020

Modified Files:
        pkgsrc/www: Makefile
Added Files:
        pkgsrc/www/py-django-binary-database-files: DESCR Makefile PLIST
            distinfo
        pkgsrc/www/py-django-binary-database-files/patches:
            patch-binary__database__files_storage.py
            patch-binary__database__files_tests_tests.py
Removed Files:
        pkgsrc/www/py-django-binary-database-file: DESCR Makefile PLIST
            distinfo
        pkgsrc/www/py-django-binary-database-file/patches:
            patch-binary__database__files_management_commands_database__files__cleanup.py
            patch-binary__database__files_management_commands_database__files__dump.py
            patch-binary__database__files_management_commands_database__files__load.py
            patch-binary__database__files_views.py

Log Message:
Rename py-django-binary-database-file to py-django-binary-database-files
and update to 1.0.13 with two additional fixes. Primarily merge the
changes and drop support for old Python versions.


To generate a diff of this commit:
cvs rdiff -u -r1.1480 -r1.1481 pkgsrc/www/Makefile
cvs rdiff -u -r1.1 -r0 pkgsrc/www/py-django-binary-database-file/DESCR \
    pkgsrc/www/py-django-binary-database-file/PLIST
cvs rdiff -u -r1.2 -r0 pkgsrc/www/py-django-binary-database-file/Makefile \
    pkgsrc/www/py-django-binary-database-file/distinfo
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/www/py-django-binary-database-file/patches/patch-binary__database__files_management_commands_database__files__cleanup.py \
    pkgsrc/www/py-django-binary-database-file/patches/patch-binary__database__files_management_commands_database__files__dump.py \
    pkgsrc/www/py-django-binary-database-file/patches/patch-binary__database__files_management_commands_database__files__load.py \
    pkgsrc/www/py-django-binary-database-file/patches/patch-binary__database__files_views.py
cvs rdiff -u -r0 -r1.1 pkgsrc/www/py-django-binary-database-files/DESCR \
    pkgsrc/www/py-django-binary-database-files/Makefile \
    pkgsrc/www/py-django-binary-database-files/PLIST \
    pkgsrc/www/py-django-binary-database-files/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py \
    pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_tests_tests.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/Makefile
diff -u pkgsrc/www/Makefile:1.1480 pkgsrc/www/Makefile:1.1481
--- pkgsrc/www/Makefile:1.1480  Sun Aug  9 17:25:37 2020
+++ pkgsrc/www/Makefile Tue Aug 18 14:27:15 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1480 2020/08/09 17:25:37 nia Exp $
+# $NetBSD: Makefile,v 1.1481 2020/08/18 14:27:15 joerg Exp $
 #
 
 COMMENT=       Packages related to the World Wide Web
@@ -655,7 +655,7 @@ SUBDIR+=    py-django-admin-rangefilter
 SUBDIR+=       py-django-admin-sortable2
 SUBDIR+=       py-django-appconf
 SUBDIR+=       py-django-appmedia
-SUBDIR+=       py-django-binary-database-file
+SUBDIR+=       py-django-binary-database-files
 SUBDIR+=       py-django-celery-beat
 SUBDIR+=       py-django-classy-tags
 SUBDIR+=       py-django-cms

Added files:

Index: pkgsrc/www/py-django-binary-database-files/DESCR
diff -u /dev/null pkgsrc/www/py-django-binary-database-files/DESCR:1.1
--- /dev/null   Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/DESCR    Tue Aug 18 14:27:16 2020
@@ -0,0 +1,3 @@
+This is a storage system for Django that stores uploaded files in binary
+fields in the database. Files can be served from the database (usually a
+bad idea), the file system, or a CDN.
\ No newline at end of file
Index: pkgsrc/www/py-django-binary-database-files/Makefile
diff -u /dev/null pkgsrc/www/py-django-binary-database-files/Makefile:1.1
--- /dev/null   Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/Makefile Tue Aug 18 14:27:16 2020
@@ -0,0 +1,32 @@
+# $NetBSD: Makefile,v 1.1 2020/08/18 14:27:16 joerg Exp $
+
+DISTNAME=      django-binary-database-files-1.0.13
+PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
+CATEGORIES=    www python
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=kimetrica/}
+
+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
+
+USE_LANGUAGES=         # none
+TEST_DEPENDS+= ${PYPKGPREFIX}-coverage-[0-9]*:../../devel/py-coverage
+
+USE_LANGUAGES=         # none
+
+PYTHON_VERSIONS_INCOMPATIBLE=  27
+
+do-test:
+       cd ${WRKSRC} && ${PREFIX}/bin/django-admin-${PYVERSSUFFIX} test \
+            --pythonpath=. \
+            --settings=binary_database_files.tests.settings \
+            binary_database_files.tests.tests.DatabaseFilesTestCase
+
+.include "../../lang/python/egg.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/www/py-django-binary-database-files/PLIST
diff -u /dev/null pkgsrc/www/py-django-binary-database-files/PLIST:1.1
--- /dev/null   Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/PLIST    Tue Aug 18 14:27:16 2020
@@ -0,0 +1,69 @@
+@comment $NetBSD: PLIST,v 1.1 2020/08/18 14:27:16 joerg Exp $
+${PYSITELIB}/binary_database_files/__init__.py
+${PYSITELIB}/binary_database_files/__init__.pyc
+${PYSITELIB}/binary_database_files/__init__.pyo
+${PYSITELIB}/binary_database_files/apps.py
+${PYSITELIB}/binary_database_files/apps.pyc
+${PYSITELIB}/binary_database_files/apps.pyo
+${PYSITELIB}/binary_database_files/management/__init__.py
+${PYSITELIB}/binary_database_files/management/__init__.pyc
+${PYSITELIB}/binary_database_files/management/__init__.pyo
+${PYSITELIB}/binary_database_files/management/commands/__init__.py
+${PYSITELIB}/binary_database_files/management/commands/__init__.pyc
+${PYSITELIB}/binary_database_files/management/commands/__init__.pyo
+${PYSITELIB}/binary_database_files/management/commands/database_files_cleanup.py
+${PYSITELIB}/binary_database_files/management/commands/database_files_cleanup.pyc
+${PYSITELIB}/binary_database_files/management/commands/database_files_cleanup.pyo
+${PYSITELIB}/binary_database_files/management/commands/database_files_dump.py
+${PYSITELIB}/binary_database_files/management/commands/database_files_dump.pyc
+${PYSITELIB}/binary_database_files/management/commands/database_files_dump.pyo
+${PYSITELIB}/binary_database_files/management/commands/database_files_load.py
+${PYSITELIB}/binary_database_files/management/commands/database_files_load.pyc
+${PYSITELIB}/binary_database_files/management/commands/database_files_load.pyo
+${PYSITELIB}/binary_database_files/management/commands/database_files_rehash.py
+${PYSITELIB}/binary_database_files/management/commands/database_files_rehash.pyc
+${PYSITELIB}/binary_database_files/management/commands/database_files_rehash.pyo
+${PYSITELIB}/binary_database_files/manager.py
+${PYSITELIB}/binary_database_files/manager.pyc
+${PYSITELIB}/binary_database_files/manager.pyo
+${PYSITELIB}/binary_database_files/migrations/0001_initial.py
+${PYSITELIB}/binary_database_files/migrations/0001_initial.pyc
+${PYSITELIB}/binary_database_files/migrations/0001_initial.pyo
+${PYSITELIB}/binary_database_files/migrations/__init__.py
+${PYSITELIB}/binary_database_files/migrations/__init__.pyc
+${PYSITELIB}/binary_database_files/migrations/__init__.pyo
+${PYSITELIB}/binary_database_files/models.py
+${PYSITELIB}/binary_database_files/models.pyc
+${PYSITELIB}/binary_database_files/models.pyo
+${PYSITELIB}/binary_database_files/settings.py
+${PYSITELIB}/binary_database_files/settings.pyc
+${PYSITELIB}/binary_database_files/settings.pyo
+${PYSITELIB}/binary_database_files/storage.py
+${PYSITELIB}/binary_database_files/storage.pyc
+${PYSITELIB}/binary_database_files/storage.pyo
+${PYSITELIB}/binary_database_files/tests/__init__.py
+${PYSITELIB}/binary_database_files/tests/__init__.pyc
+${PYSITELIB}/binary_database_files/tests/__init__.pyo
+${PYSITELIB}/binary_database_files/tests/models.py
+${PYSITELIB}/binary_database_files/tests/models.pyc
+${PYSITELIB}/binary_database_files/tests/models.pyo
+${PYSITELIB}/binary_database_files/tests/settings.py
+${PYSITELIB}/binary_database_files/tests/settings.pyc
+${PYSITELIB}/binary_database_files/tests/settings.pyo
+${PYSITELIB}/binary_database_files/tests/tests.py
+${PYSITELIB}/binary_database_files/tests/tests.pyc
+${PYSITELIB}/binary_database_files/tests/tests.pyo
+${PYSITELIB}/binary_database_files/urls.py
+${PYSITELIB}/binary_database_files/urls.pyc
+${PYSITELIB}/binary_database_files/urls.pyo
+${PYSITELIB}/binary_database_files/utils.py
+${PYSITELIB}/binary_database_files/utils.pyc
+${PYSITELIB}/binary_database_files/utils.pyo
+${PYSITELIB}/binary_database_files/views.py
+${PYSITELIB}/binary_database_files/views.pyc
+${PYSITELIB}/binary_database_files/views.pyo
+${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
+${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
+${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/requires.txt
+${PYSITELIB}/${EGG_INFODIR}/top_level.txt
Index: pkgsrc/www/py-django-binary-database-files/distinfo
diff -u /dev/null pkgsrc/www/py-django-binary-database-files/distinfo:1.1
--- /dev/null   Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/distinfo Tue Aug 18 14:27:16 2020
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2020/08/18 14:27:16 joerg 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) = a76139fecdee6af2a1fe12d886ad6e76d8ce599a
+SHA1 (patch-binary__database__files_tests_tests.py) = d578a3cbdfb53f8547f689c9e761113abc795fc3

Index: pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py
diff -u /dev/null pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py:1.1
--- /dev/null   Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py Tue Aug 18 14:27:16 2020
@@ -0,0 +1,53 @@
+$NetBSD: patch-binary__database__files_storage.py,v 1.1 2020/08/18 14:27:16 joerg Exp $
+
+1df96f9f7caf621c4c0d94bc09b27584e1c5aa9d
+b52960824eb95a3e98c8d0a8c8ac08b38a6821ca
+
+--- 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):
+@@ -110,15 +115,22 @@ class DatabaseStorage(FileSystemStorage)
+         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 = safe_join(settings.MEDIA_ROOT, 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 = safe_join(settings.MEDIA_ROOT, self.get_instance_name(name))
++        return os.path.exists(localpath)
+ 
+     def delete(self, name):
+         """Delete the file with filename `name` from the database and filesystem."""
Index: pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_tests_tests.py
diff -u /dev/null pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_tests_tests.py:1.1
--- /dev/null   Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_tests_tests.py     Tue Aug 18 14:27:16 2020
@@ -0,0 +1,35 @@
+$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