4 ms·
Noooooooo This is a really terrible suggestion. The last thing we need is another way to do things, that only takes care of, say, 70% of the functionality. A
by syllogism 11y ago
Noooooooo
This is a really terrible suggestion.
The last thing we need is another way to do things, that only takes care of, say, 70% of the functionality.
All that will happen is, someone now has to look through the simple interface, and decide oh wait, I need one feature this doesn't provide. Now your "solution" has made the problem worse, not better.
If you're going to provide this sort of simplified interface, you need to make damn sure a super majority of users never need to look past it. Otherwise you've done much more harm than good, by providing yet another competing alternative.
The real problem with packaging in Python is that users are asked to write this program, setup.py, that by itself should not be a very difficult program to write. Its tasks simply are not that complicated.
What makes it complicated is that they're then told that their program should consist of a single function call --- a call to this monstrously complicated setup() function, with a confusion of conflicting arguments.
This is a stupid way to write a program! This design decision is at the heart of the whole problem. The interface to setuptools, distribute, distutils etc is fucked and always will be fucked, because there's no way to provide a good interface to the functionality via a single function call.
That's why every semi-complicated setup script ends up having to monkey patch the internals of setuptools or distutils, to say, replace some of the Extension class machinery, or try to correct a compiler flag. It's because the design is fundamentally a failure. The whole idea does not work.
Things would be much easier if we had direct, simple control. You can provide a default fall-through, but it should be easy to route the "build_ext", "install", "sdist" etc commands to your own function.
Just tell us what our program needs to do and provide us a nice library of building blocks to do it, and we will write this program. Simple.
By far the majority of my tickets for my NLP library, spaCy, are related to packaging and installation. Why should putting some files onto a user's computer and zipping up some files on my machine and calling out to a compiler and specifying some dependencies be harder than understanding natural language?
- falsedan 11y agoSolving hard CS problems is far easier than making software that's easy for users to install and use?
- syllogism 11y agoI'm not quite sure how to read your comment. Are you expressing surprise at that, or suggesting it as a semi-obvious explanation? I would say that once you've chosen the correct algorithm to implement and understood it deeply, writing algorithmic code often isn't so difficult. In contrast, interfacing with existing systems can be arbitrarily complicated, if you're handed something with arbitrarily bad design.
- falsedan 11y agoBoth, really. I agree with your comments.
- crdoconnor 11y agoThis is essentially the same problem faced by all frameworks. When they are done well and in a loosely coupled fashion, a framework will make the basic stuff trivial to do with a few declarative lines of code and everything you might want to do will be possible without much trouble. Even, perhaps especially, the things that the creators didn't even imagine. When a framework is done badly, in a tightly coupled fashion, it may make a bunch of basic stuff easy but it will also make more complex stuff either impossible or possible but requiring horrendous contortions in the code. I think that a bunch of libraries is better than a poorly designed framework but I still don't think they're a substitute for a well designed framework. Unfortunately, many framework developers' attitude to such contortions is not "wow, we screwed up, we'd better accomodate this valid use case" (or even better make it possible to do declaratively) but instead this: "You shouldn't be doing that"
- Radim 11y agoEven worse: "Let's add another function API parameter (to the list of two dozens already there!), which will take care of this particular use case". Now the opaque black-box "framework solution" works again! Also discussed in my "API bondage" post: http://rare-technologies.com/data-streaming-in-python-generators-iterators-iterables/ http://rare-technologies.com/data-streaming-in-python-genera...