dansanderson / picotool

Tools and Python libraries for manipulating Pico-8 game files. http://www.lexaloffle.com/pico-8.php
MIT License
370 stars 46 forks source link

Make picotool available on PyPI #2

Open franciscod opened 8 years ago

franciscod commented 8 years ago

It'd be really nice to do pip install picotool :) What do you think?

dansanderson commented 3 years ago

I've added a setup.py file for easier installation. I'm not sure I ever want to upload this to PyPI, but I'll consider it if picotool ever goes 1.0. :)

hsandt commented 2 years ago

Hi, I followed the new instructions and doing a raw pip install . which generates the files (esp. p8tool) locally. As I see them in my VCS, I assume it's not exactly the intended process? I'm fine with having the built file locally, we could just add p8tool and the build/ folder to .gitignore, then I can manually symlink my ~/.local/bin/p8tool to this local p8tool.

However, I tried a pip install --user . and this one gave the expected result, installing p8tool directly in my ~/.local/bin. Maybe it's what you wanted us to do?

I know you can also sudo pip install . and that may put the binary in some /usr/bin, but I'm trying to work with user folders as much as possible so I didn't try this one. I think this one may also generate local files anyway.

dansanderson commented 2 years ago

These are just the standard behaviors of pip install, so the instructions are just meant to say "this is how to pip install a package from a directory." I agree that --user is the right method for anyone installing into their system's Python install (vs. a virtual environment). That might be worth mentioning in the docs, especially if I'm not going to upload to PyPI.

(I'm not entirely opposed to uploading to PyPI but I wanted to clean things up before doing so, so it's a pending item. I have an unfinished 0.2 that I haven't committed yet.)

hsandt commented 2 years ago

Looks like pip is now able to auto-detect lack of permission when not using sudo and falls back to --user install:

$ pip install .

Defaulting to user installation because normal site-packages is not writeable

Then it installs it to $HOME/.local/bin/p8tool (may be configurable). Note that if you're a super user or has access to normal site-packages for some reason, you will still need --user to explicitly install in user directory.