-
Notifications
You must be signed in to change notification settings - Fork 242
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
Reducing number of dependencies #95
Comments
The Pillow dependency is for image to text conversion, as per this (https://asciinema.org/a/19920) demo. If you avoid the ImageFile and ColourImageFile renderers, it should be safe to run without Pillow. Of course, you then can't import any renderers without fixing the source to avoid the import... I'm open to suggestions for how to package this more neatly, but don't want to remove the feature entirely as it is required for the animatics aspect of the package (which is where it all started). |
Was looking at this last night. What I'd really like to have is an "opt out" option on the installation so that most people will just get the whole solution. In fact, what I'd like is this: pypa/setuptools#163 - which isn't implemented yet. Sigh. |
That would work. We were chosen |
Hmmm... Opt outs will be hard and need more time than I can invest into setuptools... After more thinking, maybe I can get what I need with a "default specifier" setting that gets used if you don't specify any specifier for extras on the install. This way, I could define a default which picks all the extras, but allows you to reduce that set by selecting a different (reduced) set of options if you so desire. |
I think this in an excellent idea. Realistically, if we can have some sensible defaults for majority of uses and be able to overwrite them if needed that would be the perfect solution. |
Looks like this is going to take a while to get agreed. Do you have a suitable workaround while that happens? If not, I think that a simple one would be to:
I've had a quick test and this can run the contact_list demo, but obviously cannot run any of the others that use a Renderer. |
That sounds like it may be a reasonable workaround. We build our packages with yocto, so it should be rather straightforward to create a patch and apply it to the base release at build time. Let me try that. |
I ended up stripping asciimatics of dependencies as well (pyfiglet, Pillow, and future), but now I'm stuck on an older version. Definitely would like to see Pillow as optional. |
Given that I'm just aiming at supporting pip installations, maybe the option in pypa/setuptools#1139 will work. The theory would be having everything installed if no extras are specified and skip Pillow and pyfiglet for a I could just then add some import protection in renderers to handle the missing dependencies a little more gracefully. |
OK, so I've just tried using the pip only solution I found above... I think the code in https://github.com/peterbrittain/asciimatics/tree/slim_tui now allows you to It also prevents you from trying to use any renderers until you have a full installation using the normal pip install. Does this do the trick for your environments? |
Yes, that sounds like a neat idea. Let me try it in our environment. However, one of the problems we were facing was that our developers could not use |
Any news? |
Thanks for working on this Peter. With latest version of setuptools I'm getting an exception when i run the It looks like this issue is supposed to be fixed?: pypa/setuptools#523 Here's the traceback from setuptools 37.0
|
OK - I've reproduced your issue exactly. I agree that it is setuptools issue 523, but have found a later open issue that is tracking this. Have followed up there and am hoping that we'll get a response at some point. |
I've been looking at this again. I now think it was a regression introduced by release 36.2 of setuptools. Plenty of other versions before that, including 36.1, work fine. I'll see if I can find the cause... |
Getting there. Have tried to repro the bug in setuptools unit tests and think I'm there. Trying to get an official patch in pypa/setuptools#1139 |
Sweet. I'm making a conda package for asciimatics (since I use the conda toolchain, which also requires me to make a pyfiglet conda package). When you get this branch into a release, I'll update the package to make pyfiglet optional. |
Some kind person has submitted the PR for me. See pypa/setuptools#1503 for progress. |
Hmmm... Looks like that PR has been dropped. Maybe the suggestion of specifying a blank extras definition will do the trick here? |
Voting in favor of the |
I would dearly love to merge that change, but setuptools doesn't work with that use of extras. The best I can do is make the default install of asciimatics not include Pillow and pyfiglet, then define an I've been reluctant to make that default change up to now as this will break existing package definitions. I suppose I could move to a new major version and handle it that way. |
Oh I see, I thought the change in the |
Ok - let's make that the plan of record. Will convert the install when I bump the major version. |
We are using asciimatics with an embedded device and it requires lots of dependencies. The main offender is
Pillow
which also requires 3-6 other dependencies and some of them do not compile very well for anything other than basic i386/amd64 platforms. I also noticed that sub dependencies are some sort of imaging libraries for jpeg and png and I can hardly imagine they have anything to do with TUI library. So, would it be possible to remove dependency onPillow
and revisit other dependencies as well.The text was updated successfully, but these errors were encountered: