Coder Social home page Coder Social logo

Support for frozen apps about imageio HOT 7 CLOSED

imageio avatar imageio commented on April 30, 2024
Support for frozen apps

from imageio.

Comments (7)

paulmueller avatar paulmueller commented on April 30, 2024 1

This one can be closed now (#270).

from imageio.

paulmueller avatar paulmueller commented on April 30, 2024

I propose the following workflow:

  1. Implement an entry point named e.g. imageio_download_binary imageio_download_bin for downloading the required binary.
  2. Add the option --package-dir to the entry point which will download the binary to the plugins recources directory of the installed package. This directory can be determined with pkg_resources.recource_filename (which also works with eggs), e.g. pkg_resources.resource_filename("imageio.plugins", imageio.plugins.ffmpeg.FNAME_PER_PLATFORM[imageio.plugins.ffmpeg.get_platform()]).
  3. Give the binary file in the plugins directory highest priority when calling the get_exe method.
  4. For Pyinstaller, only a simple hooks script is required:
    # hook-imageio.py
    from PyInstaller.utils.hooks import collect_data_files
    datas = collect_data_files('imageio')
    (needs pull request for PyInstaller)

This workflow as these advantages:

  1. It does not break the current behaviour
  2. Not many changes to the sources of imageio are required
  3. It allows to download binaries with a command line script
  4. On CIs such as appveyor or travisCI, it allows to easily build PyInstaller distributables with only the required binaries

from imageio.

almarklein avatar almarklein commented on April 30, 2024

Sounds like a plan. How do we deal with the fact that there are multiple binaries? Would you do e.g.
imageio_download_binary ffmpeg ?

from imageio.

paulmueller avatar paulmueller commented on April 30, 2024

Yes, that would be the usage of the entry point script. Did I oversee anything? I could start with a PR.

from imageio.

almarklein avatar almarklein commented on April 30, 2024

As far as I can see, this should work. Looking forward to a PR!

from imageio.

paulmueller avatar paulmueller commented on April 30, 2024

I have a question regarding the _set_platform_resources method in setup.py (used in build_with_fi). What is the use-case of this method? Also, there are two lines dealing with ffmpeg commented out in _set_platform_resources?

from imageio.

almarklein avatar almarklein commented on April 30, 2024

The purpose was to make it possible to build dists with the libraries packaged in. It's not used anymore though (at least not by me). The FFMPEG lines were added at some point, but then commented because it would make the dist package very large.

from imageio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.