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
(Rudimentary?) Dependency Management #166
Comments
My two cents about dependency management, especially binary ones like PyV8. Some users prefer to keep their It means that the same packages snapshot can be used on different platforms like OSX and Windows. So the binary loaded for the first platform won’t work on the second. To solve this issue, I keep binaries in package subfolder named by current platform. For example, Also, I’m checking PyV8 availability for current platform when host plugin loads. So if there’s no such package, it is loaded first and after that the host plugin is actually initialises. I think such use case should be considered if you’re planning to add dependency support. On the other hand, this can be solved by changing layout of PyV8 package: it will download all available packages and load the one for current platform. But it will require too much data transfer. For example, current PyV8 package snapshot takes about 45MB (all platform packages zipped). |
@sergeche Package Control already has a way to resolve platform/arch-specific packages, and will automatically install missing packages when ST starts. I've been trying to in as many places as possible to encourage people to only sync their I guess until this point I have mostly been posted re-actively about it. Perhaps with the PC 2.0 launch I will make note of it in the release notes and add instructions to the website. |
Also as a general note, we discussed the idea of dependency management for PC 2.0 at #291 (comment). I am trying to get all of the infrastructure in place for PC 2.0, so we might delay the details of dependency management to v2.1. |
@wbond, please notify me(/us) when you are taking steps in this direction. I'd love to contribute some of my ideas (but I'm not really having a "write burst" recently). Very interesting issues regarding this: semver/semver#205 and its origin semver/semver#200. |
By changing imports a bit it's possible to make python use different versions of same packages in same process (npm-like). Take a look at this: https://github.com/mitsuhiko/pluginbase |
I've talked with @wbond a bit about a solution similar to that and I have to say that this looks pretty useful. If we can have the dependencies specified in a separate file and apply that to all source of a package that is using a specific context handler (which should be possible), then this is looking good. |
That would enable building bottom up based on reusable components. Now I catch myself copy-pasting code and copying files from one sublime plugin to another. |
I'm pretty sure what you guys are taking about would be huge hacks, if even possible since Sublime Text for all of the importing. I'm not currently planning on trying to do package-version-based dependency resolution. The best I think we could do is give a warning about incompatible packages. We could also deal with ST-version-based dependency resolution and platform-based resolution. |
Yes, platform and ST version are a must, and a warning when updating a package (and its dependencies) would cause another package to not satisfy the requirements. Since Semver is pretty awesome in that regard, we should be fine with that. For version selectors I currently have this draft that I intend to implement into pysemver (which Package Control uses). That should be sufficient for all needs. (Please note that the current usage of build metadata will change.) We also have to debate where packages should specify its dependencies. It should be part of the package itself, but that would require to download the entire package just for checking if dependency conflicts would arose when updating. Specifying this in the channel is not an option right now because a new pull request would be required for each dependency change. |
may be simply add some functions so package can manage his Dependencies
there are no version control in here because it adds complexity |
Implementing functionality as a subset with a different interface instead of what you want to achieve in the long run creates a situation where we have to deprecate and some day remove the old "temporary" solution which results in more work overall. For the moment, I think it would be best if PC just provided a shorthand command to install a certain package for automation purposes. Packages could just install the packages they need and that are not available manually. Also, it should be limited to only download one package at a time. |
This is present in 3.0.0-beta |
Ideas, or at least the desire for, Sublime plugin dependency management, have been around since 2008, but still there's no facilities, official or otherwise.
Though there are lessons to be learned from the various linux package managers, homebrew, npm, etc. Sublime has the distinction of requiring python modules to run in a single process.
Possibly this speaks to an unwillingness to compromise, desiring sophisticated mechanisms for multiple versions of an entity or nothing at all.
What's the minimum that can be useful?
What are the needs out there? Others will have other cases. I'll state one.
ZenCoding was previously implemented concurrently in Python/Javascript
The author grew tired of this burden and now only the Javascript branch will be developed
It was determined that a Javascript engine as Python module could be a solution for Python consumers
This binary module is bulky and will require downloading for every trivial change to KB scale source
This binary module needs compiling for the product of platforms and architectures
This binary module woud be useful as the raw basis for many plugins
A generic Javascript API for Sublime plugins could be built on top of the bridge
This API would require versioning for people to be able to rely on it
The text was updated successfully, but these errors were encountered: