Closed NotAFile closed 10 years ago
tools/setup.py
The setup.py is old and needs updating. We're going to be writing a better one, because not everyone needs EG the Mumble protocol (which requires Google's protobuf), or SSL for IRC (Which requires PyOpenSSL).
We'll start working on that once the base app is working. If you feel like writing a start yourself, feel free to fork us and submit a pull request.
I've been thinking of helping out a bit anyway, I could work on it. What are you thinking of? Gui, cli? both? I feel like I need a bit more info before I can start with it :P
Well, the main target right now would be Linux servers, however rakiru and I both develop on Windows, so it's pretty cross-platform. I'd think that a CLI setup script would be more suitable in that case, though I realize that there'll always be people running this thing from their home PCs as well. So, I dunno, really, but whatever we have will need to have some kind of CLI.
Ill get to work on it if Im sick of my other projects :) easy_install or pip? or something from within python?
It'd have to be something from within Python, since people would be making choices on what modules they want to use, I think.
And, awesome. I look forward to seeing how you do.
Any progress on this, good sir?
I rewrote the script entirely the other day, but I discussed with @rakiru, and he agreed that we would need a different approach. I talked about using pip, if available, or eggs. At the current state I don't know enough of your expectations for the script so I have stopped work on it
I didn't realise you'd actually rewritten it already. Yeah, in my opinion, it'd be preferable to use pip, but using something else wouldn't be a major issue.
Something else I'll mention here is that some packages require extra setup, like the OpenSSL one, which on Windows requires making sure openssl.exe is available.
If you take a look at the requirements page on the wiki, you can see that pip is actually not included with Python for Windows, so it might not actually be such a good idea.
a simple try: import pip should be good enough for pip. I would suppose catching errors is a secure way to check for openssl, but checking the folder could be better if the Exception does not send a proper error message
Sure, we could catch that, but at the same time, it would still be nice to have an automated way to install pip on Windows. I quite wonder how setuptools manages that..
Annoyingly, writing something to install pip automatically would require a fresh install. I might try it later in a VM so I can revert to a clean snapshot every time.
Well if this only applies to windows, we can grab the msi and run it..
EDIT: The msi of setuptools, that is. And then easy_install pip.
yeah, that would work well
Any progress on this, or are there questions that need answering?
No progress, I've been having a lot of stuff going on.
That's okay.
I just realised we can use pip within code.. Since pip is installed by default on Linux/OSX and we recommend the installation of it for Windows, it seems reasonable to presume we can rely on that for the setup script, right? What do you think?
Info here: http://stackoverflow.com/questions/12332975/installing-python-module-within-code
yeah, thats what rakiru and me came up with, for linux at least. Ironically, pip is a nuisance to install on windows though, and having a installer for the installer does seem a bit OTT. I have a bit of experience with packaging, but I'm not sure .msi does what would be appropriate for this situation. tl;dr: I have no clue how it should be user-friendly on windows
Well, we recommended that people install pip via setuptools: https://github.com/McBlockitHelpbot/Ultros/wiki/Requirements
Edit: tl;dr, just add pip to the requirements.
In my opinion, everyone should have pip installed anyway. There's a bunch of other packages that need installed to use Ultros in the first place, so requiring the user to install pip so that we can simplify installing the rest, rather than requiring they install a bunch of other stuff manually. Plus, most people running the bot on windows are likely people writing plugins/modules for it, and every python dev should have pip installed anyway.
$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ [sudo] python get-pip.py
cough
pip uses itself to install itself.
I think we have a winner.
Hit the wrong button...
If we really wanted to make it simple we could try: import pip except ImportError: subprocess.call(command above)
No, we can't do a subprocess call because it needs to be cross-platform. However Python has functions to run the contents of a file, and we can just download it with urllib.urlretrieve or something.
Something I said in IRC at some point: If the package manager gains the ability to ensure currently installed packages have their dependencies met, then all the setup script would have to do is ensure the base packages and installed (twisted and, eh, anything else...?). Edit: And I suggest this added functionality for the package manager as it would greatly help when moving a bot between machines, such as moving to a new server.
It already knows if stuff is installed already, man.
Well the package manager is able to install pip now, so having it install the requirements.txt is definitely doable. I think this can probably be closed once that's done.
Old title: Bring along all the needed modules (or at least a list)
This is just a personal thing, but it's kind of annoying to download something and having to pip install a bunch of non stock modules, especially If the packages don't have the name they are imported by.