3 ms·
I know pypi has some non-python projects as well. Python needs the ability to distribute wheels, which are compiled binaries, as the user may not be able to com
by 8organicbits 2y ago
I know pypi has some non-python projects as well. Python needs the ability to distribute wheels, which are compiled binaries, as the user may not be able to compile library code. Lots of that code is written in C, but Golang[1] is also possible. I can't find an example, but I believe I've seen this used for distributing applications (not libraries) as well. It's kinda cool to write some app in C, upload to pypi, and then ask users to install with `pip install`.
[1] https://github.com/popatam/gopy_build_wheel_example https://github.com/popatam/gopy_build_wheel_example
- bee_rider 2y agoHypothetically if they did try to add some requirement to use Python, people could just comply maliciously by providing the most minimal stub of Python code, right? Linux, but ls is written in Python. So it is probably better just to not play games.
- Maxatar 2y agoYou could embed the binary data in a Python string and then have the installer dump that string to a file.
- rfoo 2y agopip install cmake or even proprietary binaries, pip install nvidia-cudnn-cu12
- IshKebab 2y agoYeah I copied CMake's idea of using PyPI and I also use it to distribute some pure Rust CLI tools using Maturin. It works really well. Pip is... well it's about on par with most other package managers, i.e. not great, not terrible, but it has some pretty huge advantages over any other software distribution method on Linux: * Very likely to be installed already on Linux and probably Mac too. * Doesn't require root to install. You can even have isolated installs via pyenv. * I don't have to ask anyone's permission to publish a package. * I only have to make one package. If any can think of a better option I'm all ears but until then I'm fairly happy with this hack.
- Too 2y agoSome of those arguments are becoming more and more difficult as pip and distros are pushing for use of venvs and now requires a scary --break-system-packages argument if you were to use the pre installed launcher.
- IshKebab 2y agoThat is a good point. Distro package managers have somehow screwed this up too.
- mort96 2y agoI guess that was much more useful as a use case before pip started requiring you to be in a venv/virtualenv/pipenv/pyenv/whatever to download packages
- 12_throw_away 2y agoI've never encountered this requirement in many years of daily use - pip for me has always happily installed anything if it can. Now I've definitely seen customized distributions of python from package managers that have taken steps to prevent you from using pip. IIRC, the python you get from `apt-get install python` in Debian does this? I.e., it's designed to support system utilities, not as a user's general purpose python environment, and they want `apt-get` to control this environment, not pip. So they've removed pip and ensure_pip and easy_install from your core system python environment. TLDR: In my experience, that requirement doesn't come from pip, it's your distro taking steps to prevent https://xkcd.com/1987/ https://xkcd.com/1987/
- thayne 2y agoI'm not sure if that is upstream or an ununtu or debian patch, but that is the case on Ubuntu 24.04, at least unless you pass the --break-system-packages option.
- garblegarble 2y agoSorta, although it is a Python feature for distros to use: installations can be marked as externally managed and pip will refuse (without being forced) to make changes unless in a venv[1][2] 1: PEP 668 https://peps.python.org/pep-0668/ https://peps.python.org/pep-0668/ 2: https://packaging.python.org/en/latest/specifications/externally-managed-environments/ https://packaging.python.org/en/latest/specifications/extern...
- mort96 2y agohttps://p.mort.coffee/DEq.png https://p.mort.coffee/DEq.png This happens on Ubuntu, Debian, Fedora and macOS (Homebrew). I'm pretty sure it's just a core part of pip these days.
- blt 2y agobeen using PyPI a lot recently for non-Python stuff such as FFmpeg and Eigen. Part of the reason why I have been able to ditch Homebrew entirely!