Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

pip packages that include executables are not available #27

Open
davidwinter opened this issue Jun 15, 2024 · 9 comments
Open

pip packages that include executables are not available #27

davidwinter opened this issue Jun 15, 2024 · 9 comments

Comments

@davidwinter
Copy link

davidwinter commented Jun 15, 2024

Apologies if I've misunderstood what to expect - I'm a user coming from asdf and attempting to migrate to proto due to it's cross-platform nature - amazing work everyone!

I was expecting that if I was to run pip install cpplint or similiar, which normally would provide the cpplint executable available within my path immediately afterwards. I can see the file within ~/.proto/tools/python/3.12.3/install/bin though it's not available on my path. I've tried proto regen but to no avail.

Any advice or guidance would be much appreciated. Thanks.

Proto: 0.36.2
Python plugin: 0.10.1
Python version: 3.12.3

@davidwinter davidwinter changed the title pip packages that include binaries are not available pip packages that include executables are not available Jun 15, 2024
@milesj
Copy link
Contributor

milesj commented Jun 15, 2024

@davidwinter We do create pip files, but only shims: https://github.com/moonrepo/python-plugin/blob/master/src/proto.rs#L153

Is ~/.proto/shims in your PATH?

@davidwinter
Copy link
Author

@milesj it is 👍

>: echo $PATH
/Users/davidwinter/.proto/shims /Users/davidwinter/.proto/bin /Users/davidwinter/.cargo/bin <...snip>

@milesj
Copy link
Contributor

milesj commented Jun 15, 2024

@davidwinter Oh I misread the post, I thought pip wasn't available, not the tool it installed.

So proto doesn't update PATH with the location of globally installed binaries. For some tools like rust and deno this is super easy since the install path is always the same, but others like python changes between versions. We haven't figured out a nice way to handle this yet that works with shims.

@davidwinter
Copy link
Author

@milesj no worries. That's a shame though. I wonder what mechanism asdf uses for achieving this - unless you're already aware?

@davidwinter
Copy link
Author

The value from this output for Global packages directory is that hardcoded or something? A reason we couldn't use this for the tool?

>: proto tool info python
python - Python

Plugin
  Version: 0.10.1
  URL: https://github.com/moonrepo/python-plugin/releases/download/v0.10.1/python_plugin.wasm

Inventory
  Store: ~/.proto/tools/python
  Executable: ~/.proto/tools/python/3.12.3/install/bin/python3.12
  Global packages directory: ~/.proto/tools/python/3.12.3/install/bin
  Binaries:
    - ~/.proto/bin/python (primary)
    - ~/.proto/bin/python3 
  Shims:
    - ~/.proto/shims/python (primary)
    - ~/.proto/shims/pip 
    - ~/.proto/shims/python3 
  Installed versions:
    - 3.12.3

@milesj
Copy link
Contributor

milesj commented Jun 15, 2024

We do have a list of global paths that we check for, but we have no way to inject that into the PATH currently.

@milesj
Copy link
Contributor

milesj commented Jun 16, 2024

I'll look into how mise is handling things. The only thing I'm worried about is the initial overhead of having to download wasm plugins.

@milesj
Copy link
Contributor

milesj commented Jul 4, 2024

If you're still using proto, the next release attempts to solve this. I published an alpha:

https://github.com/moonrepo/proto/releases

And some info on the command/workflow:

https://moonrepo.dev/docs/proto/commands/activate

@davidwinter
Copy link
Author

Amazing - thanks - I'll give this a try tomorrow 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants