Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ source files are accidentally installed #447

Closed
QuLogic opened this issue Feb 20, 2023 · 2 comments
Closed

C++ source files are accidentally installed #447

QuLogic opened this issue Feb 20, 2023 · 2 comments

Comments

@QuLogic
Copy link
Contributor

QuLogic commented Feb 20, 2023

When building from source, I am getting a core directory in the Python install, containing the .cpp and .h files.

Additionally, if you unzip the wheels on PyPI, you can see that they include the usual pikepdf directory, plus an extra core directory.

For example:

$ unzip -l pikepdf-7.1.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl 
Archive:  pikepdf-7.1.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
  1949200  02-17-2023 22:32   pikepdf/_core.pypy38-pp73-darwin.so
    53743  02-17-2023 22:17   pikepdf/_methods.py
    25634  02-17-2023 22:17   pikepdf/_core.pyi
      248  02-17-2023 22:17   pikepdf/_version.py
     3100  02-17-2023 22:17   pikepdf/__init__.py
     3030  02-17-2023 22:17   pikepdf/_cpphelpers.py
     3378  02-17-2023 22:17   pikepdf/jbig2.py
      879  02-17-2023 22:17   pikepdf/_xml.py
      369  02-17-2023 22:17   pikepdf/settings.py
     1876  02-17-2023 22:17   pikepdf/_qpdf.py
      101  02-17-2023 22:17   pikepdf/py.typed
    10415  02-17-2023 22:17   pikepdf/objects.py
     5952  02-17-2023 22:17   pikepdf/codec.py
      232  02-17-2023 22:17   pikepdf/_exceptions.py
     6161  02-17-2023 22:17   pikepdf/_augments.py
     4484  02-17-2023 22:17   pikepdf/models/matrix.py
     8204  02-17-2023 22:17   pikepdf/models/_transcoding.py
     5499  02-17-2023 22:17   pikepdf/models/encryption.py
    31530  02-17-2023 22:17   pikepdf/models/metadata.py
     4950  02-17-2023 22:17   pikepdf/models/_content_stream.py
     1139  02-17-2023 22:17   pikepdf/models/__init__.py
    14786  02-17-2023 22:17   pikepdf/models/outlines.py
    36142  02-17-2023 22:17   pikepdf/models/image.py
  2474768  02-17-2023 22:32   pikepdf/.dylibs/libcrypto.1.1.dylib
  3417328  02-17-2023 22:32   pikepdf/.dylibs/libqpdf.29.2.0.dylib
   689904  02-17-2023 22:32   pikepdf/.dylibs/libjpeg.8.2.2.dylib
     5398  02-17-2023 22:17   core/job.cpp
      565  02-17-2023 22:17   core/utils.h
    14261  02-17-2023 22:17   core/page.cpp
    11157  02-17-2023 22:17   core/parsers.cpp
     5786  02-17-2023 22:17   core/object_convert.cpp
      595  02-17-2023 22:17   core/utils.cpp
     8731  02-17-2023 22:17   core/object_repr.cpp
    42015  02-17-2023 22:17   core/object.cpp
     4484  02-17-2023 22:17   core/annotation.cpp
     8201  02-17-2023 22:17   core/pikepdf.cpp
     1274  02-17-2023 22:17   core/pipeline.cpp
     3621  02-17-2023 22:17   core/nametree.cpp
     3001  02-17-2023 22:17   core/numbertree.cpp
     5700  02-17-2023 22:17   core/pikepdf.h
     7216  02-17-2023 22:17   core/embeddedfiles.cpp
    13581  02-17-2023 22:17   core/qpdf_pagelist.cpp
     3953  02-17-2023 22:17   core/jbig2-inl.h
     1189  02-17-2023 22:17   core/gsl.h
     5594  02-17-2023 22:17   core/qpdf_inputsource-inl.h
    38781  02-17-2023 22:17   core/qpdf.cpp
     3900  02-17-2023 22:17   core/rectangle.cpp
     1103  02-17-2023 22:17   core/qpdf_pagelist.h
     1063  02-17-2023 22:17   core/pipeline.h
     2156  02-17-2023 22:17   core/parsers.h
     2256  02-17-2023 22:17   core/logger.cpp
     5731  02-17-2023 22:17   core/mmap_inputsource-inl.h
     5455  02-17-2023 22:17   core/tokenfilter.cpp
     4563  02-17-2023 22:32   pikepdf-7.1.1.dist-info/RECORD
      116  02-17-2023 22:32   pikepdf-7.1.1.dist-info/WHEEL
       13  02-17-2023 22:31   pikepdf-7.1.1.dist-info/top_level.txt
    16725  02-17-2023 22:32   pikepdf-7.1.1.dist-info/LICENSE.txt
     9603  02-17-2023 22:32   pikepdf-7.1.1.dist-info/METADATA
---------                     -------
  8990839                     58 files
@jbarlow83
Copy link
Member

I have spent some time investigating this. The list of files to install seems to be determined by Python tools like setuptools. I'm quite confused but and have not found any way to suppress this unfortunate behavior.

Maintainers are encouraged to delete unwanted files.

@jbarlow83
Copy link
Member

Fixed in v8.2.1

See commit 2f28d44 for the actual fix. I previously attempted this, but setuptools has some sort of build caching (mainly build/*) that would cause that fix to be ignored unless the cache was flushed.

The issue was that setuptools interpreted src/core as both a Python namespace package and an extension, so installed it twice.

An unfortunately side effect of this is also that pikepdf would create an empty library named core in site-packages. In older versions, an empty library named qpdf might be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants