pypi / warehouse

The Python Package Index
https://pypi.org
Apache License 2.0
3.59k stars 968 forks source link

Source tarball tar.gz not updated #9231

Closed frost-nzcr4 closed 3 years ago

frost-nzcr4 commented 3 years ago

Describe the bug Both projects have tarballs with an outdated sources on pypi.org:

Strictly speaking it could be just coincidence but any coincidence could reveals the deep problems. It could be documentation problem somewhere or just maintainers misconfigured their packages. I didn't find any related issues, so just leave it here as is.

Expected behavior Source in tarball should reflects state of project's tag.

ewdurbin commented 3 years ago

Hello @frost-nzcr4! I'm able to verify that what was uploaded to PyPI by the maintainers of both projects matches what is being served by files.pythonhosted.org and indexed by PyPI.

I do see that the tarball for 0.8.10 for python-docx contains differences from 0.8.9 so it does not appear that this is an issue on PyPI's side.

See full diff 0.8.9 -> 0.8.10
$ diff -uNr python-docx-0.8.9 python-docx-0.8.10
diff -uNr python-docx-0.8.9/HISTORY.rst python-docx-0.8.10/HISTORY.rst
--- python-docx-0.8.9/HISTORY.rst   2019-01-08 18:48:58.000000000 -0500
+++ python-docx-0.8.10/HISTORY.rst  2019-01-09 02:09:20.000000000 -0500
@@ -3,6 +3,13 @@
 Release History
 ---------------

+0.8.10 (2019-01-08)
++++++++++++++++++++
+
+- Revert use of expanded package directory for default.docx to work around setup.py
+  problem with filenames containing square brackets.
+
+
 0.8.9 (2019-01-08)
 ++++++++++++++++++

diff -uNr python-docx-0.8.9/PKG-INFO python-docx-0.8.10/PKG-INFO
--- python-docx-0.8.9/PKG-INFO  2019-01-08 18:50:14.000000000 -0500
+++ python-docx-0.8.10/PKG-INFO 2019-01-09 02:15:39.000000000 -0500
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: python-docx
-Version: 0.8.9
+Version: 0.8.10
 Summary: Create and update Microsoft Word .docx files.
 Home-page: https://github.com/python-openxml/python-docx
 Author: Steve Canny
@@ -43,6 +43,13 @@
         Release History
         ---------------

+        0.8.10 (2019-01-08)
+        +++++++++++++++++++
+        
+        - Revert use of expanded package directory for default.docx to work around setup.py
+          problem with filenames containing square brackets.
+        
+        
         0.8.9 (2019-01-08)
         ++++++++++++++++++

diff -uNr python-docx-0.8.9/docx/__init__.py python-docx-0.8.10/docx/__init__.py
--- python-docx-0.8.9/docx/__init__.py  2019-01-08 18:46:24.000000000 -0500
+++ python-docx-0.8.10/docx/__init__.py 2019-01-09 02:07:05.000000000 -0500
@@ -2,7 +2,7 @@

 from docx.api import Document  # noqa

-__version__ = '0.8.9'
+__version__ = '0.8.10'

 # register custom Part classes with opc package reader
diff -uNr python-docx-0.8.9/docx/api.py python-docx-0.8.10/docx/api.py
--- python-docx-0.8.9/docx/api.py   2019-01-08 14:22:46.000000000 -0500
+++ python-docx-0.8.10/docx/api.py  2019-01-09 02:05:06.000000000 -0500
@@ -34,4 +34,4 @@
     Return the path to the built-in default .docx package.
     """
     _thisdir = os.path.split(__file__)[0]
-    return os.path.join(_thisdir, 'templates', 'default-docx-template')
+    return os.path.join(_thisdir, 'templates', 'default.docx')
Binary files python-docx-0.8.9/docx/templates/default.docx and python-docx-0.8.10/docx/templates/default.docx differ
Binary files python-docx-0.8.9/features/_scratch/test_out.docx and python-docx-0.8.10/features/_scratch/test_out.docx differ
diff -uNr python-docx-0.8.9/python_docx.egg-info/PKG-INFO python-docx-0.8.10/python_docx.egg-info/PKG-INFO
--- python-docx-0.8.9/python_docx.egg-info/PKG-INFO 2019-01-08 18:50:13.000000000 -0500
+++ python-docx-0.8.10/python_docx.egg-info/PKG-INFO    2019-01-09 02:15:38.000000000 -0500
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: python-docx
-Version: 0.8.9
+Version: 0.8.10
 Summary: Create and update Microsoft Word .docx files.
 Home-page: https://github.com/python-openxml/python-docx
 Author: Steve Canny
@@ -43,6 +43,13 @@
         Release History
         ---------------

+        0.8.10 (2019-01-08)
+        +++++++++++++++++++
+        
+        - Revert use of expanded package directory for default.docx to work around setup.py
+          problem with filenames containing square brackets.
+        
+        
         0.8.9 (2019-01-08)
         ++++++++++++++++++

diff -uNr python-docx-0.8.9/python_docx.egg-info/SOURCES.txt python-docx-0.8.10/python_docx.egg-info/SOURCES.txt
--- python-docx-0.8.9/python_docx.egg-info/SOURCES.txt  2019-01-08 18:50:13.000000000 -0500
+++ python-docx-0.8.10/python_docx.egg-info/SOURCES.txt 2019-01-09 02:15:38.000000000 -0500
@@ -172,6 +172,7 @@
 docx/templates/default-header.xml
 docx/templates/default-settings.xml
 docx/templates/default-styles.xml
+docx/templates/default.docx
 docx/templates/default-docx-template/[Content_Types].xml
 docx/templates/default-docx-template/_rels/.rels
 docx/templates/default-docx-template/customXml/item1.xml

And similarly for the PyMuPDF releases in question

See full diff 1.18.7 -> 1.18.8
$ diff -uNr PyMuPDF-1.18.7 PyMuPDF-1.18.8
diff -uNr PyMuPDF-1.18.7/PKG-INFO PyMuPDF-1.18.8/PKG-INFO
--- PyMuPDF-1.18.7/PKG-INFO 2021-02-02 16:11:57.000000000 -0500
+++ PyMuPDF-1.18.8/PKG-INFO 2021-02-04 16:38:43.000000000 -0500
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: PyMuPDF
-Version: 1.18.7
+Version: 1.18.8
 Summary: Python bindings for the PDF rendering library MuPDF
 Home-page: https://github.com/pymupdf/PyMuPDF
 Author: Jorj McKie
 Author-email: jorj.x.mckie@outlook.de
 License: UNKNOWN
-Description: Release date: January 31, 2021
+Description: Release date: February 3, 2021

         Authors
         =======
@@ -17,7 +17,7 @@
         Introduction
         ============

-        This is **version 1.18.7 of PyMuPDF**, a Python binding for `MuPDF `_ - "a lightweight PDF and XPS viewer".
+        This is **version 1.18.8 of PyMuPDF**, a Python binding for `MuPDF `_ - "a lightweight PDF and XPS viewer".

         MuPDF can access files in PDF, XPS, OpenXPS, epub, comic and fiction book formats, and it is known for both, its top performance and high rendering quality.

diff -uNr PyMuPDF-1.18.7/fitz/fitz.py PyMuPDF-1.18.8/fitz/fitz.py
--- PyMuPDF-1.18.7/fitz/fitz.py 2021-02-02 15:35:16.000000000 -0500
+++ PyMuPDF-1.18.8/fitz/fitz.py 2021-02-04 13:26:58.000000000 -0500
@@ -102,9 +102,9 @@

 VersionFitz = "1.18.0"
-VersionBind = "1.18.7"
-VersionDate = "2021-01-31 00:00:01"
-version = (VersionBind, VersionFitz, "202101310001")
+VersionBind = "1.18.8"
+VersionDate = "2021-02-03 19:56:11"
+version = (VersionBind, VersionFitz, "20210203195611")

 EPSILON = _fitz.EPSILON
 PDF_ANNOT_TEXT = _fitz.PDF_ANNOT_TEXT
@@ -3596,6 +3596,8 @@
         """
         if not filename or type(filename) is str:
             pass
+        elif hasattr(filename, "absolute"):
+            filename = str(filename)
         elif hasattr(filename, "name"):
             filename = filename.name
         else:
@@ -4193,8 +4195,10 @@
             pass
         elif hasattr(filename, "open"):  # assume: pathlib.Path
             filename = str(filename)
-        elif not hasattr(filename, "seek"):  # assume: file pointer
-            raise ValueError("filename must be str, Path or file pointer")
+        elif hasattr(filename, "name"):  # assume: file object
+            filename = filename.name
+        elif not hasattr(filename, "seek"):  # assume file object
+            raise ValueError("filename must be str, Path or file object")
         if filename == self.name and not incremental:
             raise ValueError("save to original must be incremental")
         if self.page_count < 1:
@@ -4892,7 +4896,7 @@
             raise ValueError("bad page number(s)")

         # remove TOC bookmarks pointing to deleted page
-        old_toc = self.getToC()
+        old_toc = self.get_toc()
         for i, item in enumerate(old_toc):
             if item[2] == pno + 1:
                 self.del_toc_item(i)
@@ -4918,7 +4922,7 @@
         if not f <= t < page_count:
             raise ValueError("bad page number(s)")

-        old_toc = self.getToC()
+        old_toc = self.get_toc()
         for i, item in enumerate(old_toc):
             if f + 1 <= item[2] <= t + 1:
                 self.del_toc_item(i)
@@ -5997,6 +6001,7 @@
         overlay: int = 1,
         oc: int = 0,
         xref: int = 0,
+        alpha: int = 0,
         matrix: AnyType = None,
         _imgname: OptStr = None,
         _imgpointer: AnyType = None,
@@ -6010,6 +6015,7 @@
             overlay,
             oc,
             xref,
+            alpha,
             matrix,
             _imgname,
             _imgpointer,
@@ -6509,6 +6515,18 @@
         return _fitz.Pixmap_setRect(self, bbox, color)

     @property
+    def is_monochrome(self) -> AnyType:
+        """Check if pixmap is monochrome."""
+
+        return _fitz.Pixmap_is_monochrome(self)
+
+    @property
+    def digest(self) -> AnyType:
+        """MD5 digest of pixmap (bytes)."""
+
+        return _fitz.Pixmap_digest(self)
+
+    @property
     def stride(self) -> AnyType:
         """Length of one image line (width * n)."""

diff -uNr PyMuPDF-1.18.7/fitz/fitz_wrap.c PyMuPDF-1.18.8/fitz/fitz_wrap.c
--- PyMuPDF-1.18.7/fitz/fitz_wrap.c 2021-02-02 15:35:07.000000000 -0500
+++ PyMuPDF-1.18.8/fitz/fitz_wrap.c 2021-02-04 13:26:49.000000000 -0500
@@ -9165,9 +9165,10 @@
         }
 SWIGINTERN PyObject *Document__extend_toc_items(struct Document *self,PyObject *items){
             pdf_document *pdf = pdf_specifics(gctx, (fz_document *)self);
-            pdf_obj *bm, *col;
+            pdf_obj *bm, *col, *obj;
             int count, flags;
-            PyObject *item=NULL, *itemdict=NULL, *xrefs, *bold, *italic, *collapse;
+            PyObject *item=NULL, *itemdict=NULL, *xrefs, *bold, *italic, *collapse, *zoom;
+            zoom = PyUnicode_FromString("zoom");
             bold = PyUnicode_FromString("bold");
             italic = PyUnicode_FromString("italic");
             collapse = PyUnicode_FromString("collapse");
@@ -9178,7 +9179,7 @@
                 if (!olroot) goto finished;
                 pdf_obj *first = pdf_dict_get(gctx, olroot, PDF_NAME(First));
                 if (!first) goto finished;
-                xrefs = PyList_New(0);
+                xrefs = PyList_New(0);  // pre-allocate an empty list
                 xrefs = JM_outline_xrefs(gctx, first, xrefs);
                 Py_ssize_t i, n = PySequence_Size(xrefs);
                 if (!n) goto finished;
@@ -9217,6 +9218,15 @@
                         PyTuple_SET_ITEM(color, 2, Py_BuildValue("f", pdf_to_real(gctx, pdf_array_get(gctx, col, 2))));
                         DICT_SETITEM_DROP(itemdict, dictkey_color, color);
                     }
+                    float z=0;
+                    obj = pdf_dict_get(gctx, bm, PDF_NAME(Dest));
+                    if (!obj || !pdf_is_array(gctx, obj)) {
+                        obj = pdf_dict_getl(gctx, bm, PDF_NAME(A), PDF_NAME(D), NULL);
+                    }
+                    if (pdf_is_array(gctx, obj) && pdf_array_len(gctx, obj) == 5) {
+                        z = pdf_to_real(gctx, pdf_array_get(gctx, obj, 4));
+                    }
+                    DICT_SETITEM_DROP(itemdict, zoom, Py_BuildValue("f", z));
                     PyList_SetItem(item, 3, itemdict);
                     PyList_SetItem(items, i, item);
                     pdf_drop_obj(gctx, bm);
@@ -9229,6 +9239,7 @@
                 Py_CLEAR(bold);
                 Py_CLEAR(italic);
                 Py_CLEAR(collapse);
+                Py_CLEAR(zoom);
                 pdf_drop_obj(gctx, bm);
                 PyErr_Clear();
             }
@@ -12066,9 +12077,9 @@
                 fz_rect cropbox = fz_empty_rect;
                 fz_rect r = JM_rect_from_py(rect);
                 cropbox.x0 = r.x0;
-                cropbox.y0 = mediabox.y1 - r.y1;
                 cropbox.x1 = r.x1;
-                cropbox.y1 = mediabox.y1 - r.y0;
+                cropbox.y0 = mediabox.y1 - r.y1 + mediabox.y0;
+                cropbox.y1 = mediabox.y1 - r.y0 + mediabox.y0;
                 pdf_dict_put_drop(gctx, page->obj, PDF_NAME(CropBox),
                                   pdf_new_rect(gctx, page->doc, cropbox));
             }
@@ -12321,7 +12332,7 @@
             }
             return Py_BuildValue("i", rc_xref);
         }
-SWIGINTERN PyObject *Page__insertImage(struct Page *self,char const *filename,struct Pixmap *pixmap,PyObject *stream,PyObject *imask,int overlay,int oc,int xref,PyObject *matrix,char const *_imgname,PyObject *_imgpointer){
+SWIGINTERN PyObject *Page__insertImage(struct Page *self,char const *filename,struct Pixmap *pixmap,PyObject *stream,PyObject *imask,int overlay,int oc,int xref,int alpha,PyObject *matrix,char const *_imgname,PyObject *_imgpointer){
             pdf_page *page = pdf_page_from_fz_page(gctx, (fz_page *) self);
             pdf_document *pdf;
             fz_pixmap *pm = NULL;
@@ -12343,8 +12354,7 @@
                 //-------------------------------------------------------------
                 // create the image
                 //-------------------------------------------------------------
-                if (filename || EXISTS(stream) || EXISTS(_imgpointer))
-                {
+                if (filename || EXISTS(stream) || EXISTS(_imgpointer)) {
                     if (filename) {
                         image = fz_new_image_from_file(gctx, filename);
                     } else if (EXISTS(stream)) {
@@ -12367,11 +12377,11 @@
                         fz_drop_image(gctx, image);
                         image = zimg;
                         zimg = NULL;
-                    } else {
-                        pix = fz_get_pixmap_from_image(gctx, image, NULL, NULL, 0, 0);
-                        pix->xres = xres;
-                        pix->yres = yres;
-                        if (pix->alpha == 1) {  // have alpha: create an SMask
+                    } else if (alpha == 1) {
+                            // have alpha: create an SMask
+                            pix = fz_get_pixmap_from_image(gctx, image, NULL, NULL, 0, 0);
+                            pix->xres = xres;
+                            pix->yres = yres;
                             pm = fz_convert_pixmap(gctx, pix, NULL, NULL, NULL, fz_default_color_params, 1);
                             pm->alpha = 0;
                             pm->colorspace = fz_keep_colorspace(gctx, fz_device_gray(gctx));
@@ -12380,10 +12390,6 @@
                             fz_drop_image(gctx, image);
                             image = zimg;
                             zimg = NULL;
-                        } else {
-                            fz_drop_pixmap(gctx, pix);
-                            pix = NULL;
-                        }
                     }
                 } else {  // pixmap specified
                     fz_pixmap *arg_pix = (fz_pixmap *) pixmap;
@@ -13043,6 +13049,14 @@
             }
             return rc;
         }
+SWIGINTERN PyObject *Pixmap_is_monochrome(struct Pixmap *self){
+            return JM_BOOL(fz_is_pixmap_monochrome(gctx, (fz_pixmap *) self));
+        }
+SWIGINTERN PyObject *Pixmap_digest(struct Pixmap *self){
+            unsigned char digest[16];
+            fz_md5_pixmap(gctx, (fz_pixmap *) self, digest);
+            return Py_BuildValue("y", digest);
+        }
 SWIGINTERN PyObject *Pixmap_stride(struct Pixmap *self){
             return PyLong_FromSize_t((size_t) fz_pixmap_stride(gctx, (fz_pixmap *) self));
         }
@@ -20767,9 +20781,10 @@
   int arg6 = (int) 1 ;
   int arg7 = (int) 0 ;
   int arg8 = (int) 0 ;
-  PyObject *arg9 = (PyObject *) NULL ;
-  char *arg10 = (char *) NULL ;
-  PyObject *arg11 = (PyObject *) NULL ;
+  int arg9 = (int) 0 ;
+  PyObject *arg10 = (PyObject *) NULL ;
+  char *arg11 = (char *) NULL ;
+  PyObject *arg12 = (PyObject *) NULL ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -20783,13 +20798,15 @@
   int ecode7 = 0 ;
   int val8 ;
   int ecode8 = 0 ;
-  int res10 ;
-  char *buf10 = 0 ;
-  int alloc10 = 0 ;
-  PyObject *swig_obj[11] ;
+  int val9 ;
+  int ecode9 = 0 ;
+  int res11 ;
+  char *buf11 = 0 ;
+  int alloc11 = 0 ;
+  PyObject *swig_obj[12] ;
   PyObject *result = 0 ;

-  if (!SWIG_Python_UnpackTuple(args, "Page__insertImage", 1, 11, swig_obj)) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args, "Page__insertImage", 1, 12, swig_obj)) SWIG_fail;
   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Page, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Page__insertImage" "', argument " "1"" of type '" "struct Page *""'"); 
@@ -20837,20 +20854,27 @@
     arg8 = (int)(val8);
   }
   if (swig_obj[8]) {
-    arg9 = swig_obj[8];
+    ecode9 = SWIG_AsVal_int(swig_obj[8], &val9);
+    if (!SWIG_IsOK(ecode9)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Page__insertImage" "', argument " "9"" of type '" "int""'");
+    } 
+    arg9 = (int)(val9);
   }
   if (swig_obj[9]) {
-    res10 = SWIG_AsCharPtrAndSize(swig_obj[9], &buf10, NULL, &alloc10);
-    if (!SWIG_IsOK(res10)) {
-      SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "Page__insertImage" "', argument " "10"" of type '" "char const *""'");
-    }
-    arg10 = (char *)(buf10);
+    arg10 = swig_obj[9];
   }
   if (swig_obj[10]) {
-    arg11 = swig_obj[10];
+    res11 = SWIG_AsCharPtrAndSize(swig_obj[10], &buf11, NULL, &alloc11);
+    if (!SWIG_IsOK(res11)) {
+      SWIG_exception_fail(SWIG_ArgError(res11), "in method '" "Page__insertImage" "', argument " "11"" of type '" "char const *""'");
+    }
+    arg11 = (char *)(buf11);
+  }
+  if (swig_obj[11]) {
+    arg12 = swig_obj[11];
   }
   {
-    result = (PyObject *)Page__insertImage(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11);
+    result = (PyObject *)Page__insertImage(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(char const *)arg11,arg12);
     if (!result) {
       PyErr_SetString(PyExc_RuntimeError, fz_caught_message(gctx));
       return NULL;
@@ -20858,11 +20882,11 @@
   }
   resultobj = result;
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
-  if (alloc10 == SWIG_NEWOBJ) free((char*)buf10);
+  if (alloc11 == SWIG_NEWOBJ) free((char*)buf11);
   return resultobj;
 fail:
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
-  if (alloc10 == SWIG_NEWOBJ) free((char*)buf10);
+  if (alloc11 == SWIG_NEWOBJ) free((char*)buf11);
   return NULL;
 }

@@ -22146,6 +22170,52 @@
 }

+SWIGINTERN PyObject *_wrap_Pixmap_is_monochrome(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  struct Pixmap *arg1 = (struct Pixmap *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject *swig_obj[1] ;
+  PyObject *result = 0 ;
+  
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Pixmap, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pixmap_is_monochrome" "', argument " "1"" of type '" "struct Pixmap *""'"); 
+  }
+  arg1 = (struct Pixmap *)(argp1);
+  result = (PyObject *)Pixmap_is_monochrome(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Pixmap_digest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  struct Pixmap *arg1 = (struct Pixmap *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject *swig_obj[1] ;
+  PyObject *result = 0 ;
+  
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Pixmap, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pixmap_digest" "', argument " "1"" of type '" "struct Pixmap *""'"); 
+  }
+  arg1 = (struct Pixmap *)(argp1);
+  result = (PyObject *)Pixmap_digest(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_Pixmap_stride(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   struct Pixmap *arg1 = (struct Pixmap *) 0 ;
@@ -27631,6 +27701,8 @@
     { "Pixmap_setOrigin", _wrap_Pixmap_setOrigin, METH_VARARGS, NULL},
     { "Pixmap_setResolution", _wrap_Pixmap_setResolution, METH_VARARGS, NULL},
     { "Pixmap_setRect", _wrap_Pixmap_setRect, METH_VARARGS, NULL},
+    { "Pixmap_is_monochrome", _wrap_Pixmap_is_monochrome, METH_O, NULL},
+    { "Pixmap_digest", _wrap_Pixmap_digest, METH_O, NULL},
     { "Pixmap_stride", _wrap_Pixmap_stride, METH_O, NULL},
     { "Pixmap_xres", _wrap_Pixmap_xres, METH_O, NULL},
     { "Pixmap_yres", _wrap_Pixmap_yres, METH_O, NULL},
diff -uNr PyMuPDF-1.18.7/fitz/utils.py PyMuPDF-1.18.8/fitz/utils.py
--- PyMuPDF-1.18.7/fitz/utils.py    2021-02-02 14:10:53.000000000 -0500
+++ PyMuPDF-1.18.8/fitz/utils.py    2021-02-04 07:47:49.000000000 -0500
@@ -240,7 +240,7 @@
     overlay = bool(kwargs.get("overlay", True))

     def calc_hash(stream):
-        m = hashlib.sha1()
+        m = hashlib.md5()
         m.update(stream)
         return m.digest()

@@ -336,31 +336,30 @@
     # to the actual C-level function (_imgpointer), and set all other
     # parameters to None.
     # -------------------------------------------------------------------------
-    if keep_proportion is True:  # for this we need the image dimension
-        if pixmap:  # this is the easy case
-            w = pixmap.width
-            h = pixmap.height
-            digest = calc_hash(pixmap.samples)
-
-        elif stream:  # use tool to access the information
-            # we also pass through the generated fz_image address
-            if type(stream) is io.BytesIO:
-                stream = stream.getvalue()
-            img_prof = TOOLS.image_profile(stream, keep_image=True)
-            w, h = img_prof["width"], img_prof["height"]
-            digest = calc_hash(stream)
-            stream = None  # make sure this arg is NOT used
-            _imgpointer = img_prof["image"]  # pointer to fz_image
-
-        else:  # worst case: must read the file
-            stream = open(filename, "rb").read()
-            digest = calc_hash(stream)
-            img_prof = TOOLS.image_profile(stream, keep_image=True)
-            w, h = img_prof["width"], img_prof["height"]
-            stream = None  # make sure this arg is NOT used
-            filename = None  # make sure this arg is NOT used
-            _imgpointer = img_prof["image"]  # pointer to fz_image

+    if pixmap:
+        w = pixmap.width
+        h = pixmap.height
+        alpha = pixmap.alpha
+        digest = calc_hash(pixmap.samples)
+    elif stream:
+        pix = Pixmap(stream)
+        w = pix.width
+        h = pix.height
+        alpha = pix.alpha
+        digest = calc_hash(pix.samples)
+        del pix
+        if type(stream) is io.BytesIO:
+            stream = stream.getvalue()
+    else:
+        pix = Pixmap(filename)
+        w = pix.width
+        h = pix.height
+        alpha = pix.alpha
+        digest = calc_hash(pix.samples)
+        del pix
+
+    if keep_proportion is True:  # for this we need the image dimension
         maxf = max(w, h)
         fw = w / maxf
         fh = h / maxf
@@ -393,6 +392,7 @@
         overlay=overlay,
         oc=oc,  # optional content object
         xref=xref,
+        alpha=alpha,
         _imgname=_imgname,  # generated PDF resource name
         _imgpointer=_imgpointer,  # address of fz_image
     )
@@ -831,7 +831,7 @@
     title: OptStr = None,
     to: point_like = None,
     filename: OptStr = None,
-    zoom: int = 0,
+    zoom: float = 0,
 ) -> None:
     """Update TOC item by index.

@@ -978,8 +978,8 @@
     """
     if not ddict:
         return ""
-    str_goto = "/A<>"
-    str_gotor1 = "/A<>>>"
+    str_goto = "/A<>"
+    str_gotor1 = "/A<>>>"
     str_gotor2 = "/A<>>>"
     str_launch = "/A<>>>"
     str_uri = "/A<>"
diff -uNr PyMuPDF-1.18.7/setup.py PyMuPDF-1.18.8/setup.py
--- PyMuPDF-1.18.7/setup.py 2021-01-14 03:53:47.000000000 -0500
+++ PyMuPDF-1.18.8/setup.py 2021-02-03 18:56:59.000000000 -0500
@@ -123,7 +123,7 @@

 setup(
     name="PyMuPDF",
-    version="1.18.7",
+    version="1.18.8",
     description="Python bindings for the PDF rendering library MuPDF",
     long_description=long_desc,
     classifiers=classifier,

PyPI does not enforce the contents of an uploaded sdist matching any external sources. Ultimately this is the responsibility of the packagers and maintainers.

I'm unsure if there's anything actionable for this on our side, but will leave the issue open for the time being to get input from any other warehouse maintainers.

di commented 3 years ago

Hi, this issue tracker is for issues with the codebase behind https://pypi.org itself, not the projects hosted on PyPI.

You should report this issue to the tracker for the project in question instead.

frost-nzcr4 commented 3 years ago

Thanks for quick answers, now it's the turn of the maintainers.