PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Friday the 4th of December, 2015

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[14:13:26] <Bo55> Hi guys, I am working with virtualenv/virtualenvwrapper for the first time. I had to restart my terminal because of an error. I can't seem to find any info as to how to get my virtualenv up and running again. I initially used the commands "mkproject <name>" then "workon <name>". When I reopened the terminal the workon command was no longer recognized. Can anyone tell me what I am missing? thanks
[14:39:31] <Bo55> I found the solution. Needed the command . .profile
[14:46:39] <Wooble> If your shell doesn't source .profile when you start it something's gone wrong or you're using the wrong profile file.
[14:47:56] <Wooble> (but I don't use virtualenvwrapper so I don't know what might have gone wrong with how it installed)
[18:33:56] <royiv> Question: in a dependency_link, #…&subdirectory= doesn't work. (It only works in a -e to pip or in a -e line in a requirements.txt file.)
[18:33:59] <royiv> Why?
[18:34:30] <royiv> (Specifically, I'd like to use it in a setup.py, somehow.)
[19:21:34] <ionelmc> royiv: because it's a pip feature
[19:21:58] <ionelmc> not a setuptools or distutils one
[19:23:58] <royiv> I don't really see how?
[19:24:17] <royiv> I mean, perhaps I agree with you, but the distinction seems arbitrary?
[19:24:38] <royiv> pip is in full control of the requirement and the link output from my setup.py
[19:24:49] <royiv> and chooses to not obey the subdirectory attribute
[19:25:39] <royiv> as in, requirements (and links) emitted from a setup.py make it into pip.req.req_install
[19:26:34] <royiv> (as an instance of InstallRequirement)
[19:30:52] <ionelmc> it's messy
[19:31:00] <ionelmc> lots of things are "arbitrary" :)
[19:31:34] <ionelmc> royiv: the problem is that the actual installation is done by setuptools
[19:32:15] <ionelmc> pip just drives it (downlads, unpacks, runs setup.py and that in turn uses setuptools)
[19:33:24] <ionelmc> why do you need this subdirectory?
[19:38:46] <royiv> we moved to a single repo for a fair majority of our repos. (I'm not really in favor of this, and it's out of my hands)
[19:38:53] <royiv> so in our git repo, we have
[19:38:58] <royiv> /foo/setup.py
[19:39:02] <royiv> /bar/setup.py
[19:39:04] <royiv> etc.
[19:39:09] <royiv> foo might depend on bar
[19:39:21] <royiv> and I'm looking for some way to express that dependency.
[19:39:39] <royiv> I think even from pip's view, obeying subdirectory would suffice (but it doesn't)
[19:39:50] <royiv> I really just need it to run bar/setup.py, for example.
[19:40:12] <royiv> Or rather, when foo is being installed, I need it to require and declare a link to bar.
[19:40:52] <royiv> The last complication is that there's a /common_setup.py
[19:41:00] <royiv> which /*/setup.py refer to.
[19:41:49] <royiv> so file:///absolute/path/to/bar nearly works as a dependency_link, except that pip copies bar into /tmp, and then can't find the common_setup.py
[19:41:52] <ionelmc> oook
[19:42:07] <ionelmc> let me ask a seemingly silly question
[19:42:17] <royiv> Sure :-)
[19:42:23] <royiv> (there's lots of silly here.)
[19:42:50] <ionelmc> why do you have setup scripts if you don't really install from distributions (published archives somewhere)?
[19:43:16] <royiv> Well, don't I need them?
[19:43:34] <ionelmc> my over-engineering alert is red here :)
[19:43:39] <royiv> AFAIK (and perhaps this is the issue) is that pip determines the dependencies of a think from the output of setup.py
[19:43:58] <royiv> *of a thing
[19:44:01] <ionelmc> royiv: you only install from sources, thus you don't need any of these setup scripts
[19:44:39] <ionelmc> they are for making distributions, which you are completely bypassing
[19:45:02] <royiv> how would I make this work w/o setup.py?
[19:45:53] <ionelmc> hard to say, it depends on what your requirements are and what sort of code you have there
[19:46:21] <royiv> well, the usual is that for /foo, we want to create a virtualenv with all the dependencies installed.
[19:46:31] <royiv> we usually put this in /foo/env
[19:46:52] <royiv> and populate it with pip install /foo/env/bin/pip install -r /foo/requirements.txt
[19:47:17] <royiv> But if foo's requirements.txt references /bar in any way, bars requirements come then from its setup.py
[19:47:30] <royiv> hence, the work we have around setup.py's.
[19:48:13] <royiv> (and really, it's those indirect reqs; in particular, it's if /bar then also needs /baz that causes issues.)
[19:48:44] <royiv> (the rest of the indirect reqs (e.g., requests, flask, etc.) don't involve dependency links, and just come from PyPI.
[19:48:47] <royiv> )
[19:51:51] <ionelmc> royiv: what's the point of having indirect deps?
[19:52:28] <ionelmc> imo you have two options here
[19:52:34] <royiv> Not sure I understand; they happen because say, foo depends on bar which depends on baz.
[19:52:56] <ionelmc> 1. make a wrapper script that prapares these internal deps, so pip can install them
[19:53:16] <ionelmc> 2. install them yourself (copy the files, make a pth link or whatever)
[19:55:38] <royiv> doesn't this defeat the point of pip a tad?
[20:02:03] <ionelmc> i'd argue that having all the code in the same place defeats the point of using an installer :)
[20:02:42] <royiv> well, perhaps, but we're trying to maintain some sort of logical componentization of our code.
[20:03:52] <ionelmc> try different things
[20:04:12] <ionelmc> here's another idea: use requirement files to "declare" the dependencies
[20:04:56] <ionelmc> each subdir will have a requirement file that lists the dependencies as development requirements
[20:06:24] <ionelmc> royiv: how many packages you have? you must have something like 50+ packages if you really need a dependency resolver
[20:10:09] <ionelmc> and pip is quite a poor one :)
[20:15:40] <royiv> I think it's just more about typical best-practice code organization than number of directories.
[20:16:08] <royiv> It's rather annoying for a consumer of what looks like a library to need (if the add a dependency to another library) need to update the deps of all consumers of that library.
[20:18:04] <ionelmc> royiv: are you doing develop installs (-e) or plain installs?
[20:18:15] <ionelmc> if plain installs then devpi might interest you
[20:18:43] <royiv> well, in the foo -> bar -> baz case
[20:18:57] <royiv> because foo is installed via -r requirements.txt, those are -e.
[20:19:26] <royiv> but bar's requirement on baz, because it is output via setup.py, is essentially not -e, as the setup.py has no concept of -e. (Unless I'm mistaken.)
[20:19:47] <royiv> (which would be great, because git:// URLs with subdirectory= require -e)