PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Friday the 4th of November, 2016

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[13:38:44] <Denommus> I'm trying to create a debian package by packaging a whole virtualenv with my application
[13:39:17] <Denommus> but I'm having trouble with some packages
[13:39:27] <Siecje> Denommus: Have you seen https://github.com/nylas/make-deb ?
[13:39:47] <Denommus> Siecje: I have, but it's a legacy package, I'm trying to improve upon it
[13:40:29] <xafer> You might also want to check https://github.com/spotify/dh-virtualenv
[13:42:53] <Denommus> I'm almost rewriting the package to benefit from one of those
[13:43:27] <Denommus> but I just wanted to know why PIP_CONFIG_FILE=/dev/null pip3 install -r requirements.txt --root=debian/my-project/usr/lib/auctions-env/ --isolated --ignore-installed fails
[13:43:52] <Denommus> is there anything wrong with this oneliner? Shouldn't it do what I expect it to do?
[13:44:03] <Denommus> pip is not running under a virtualenv, tbh, but should it?
[13:56:23] <Denommus> ok, I think I understood
[13:58:51] <Siecje> Denommus: Are you just creating a virtualenv installing your dependencies, putting virtualenv with your code and then adding a binary that runs /path/to/venv/bin/python /path/to/source/main.py ?
[13:59:04] <Siecje> When are you running that command during the build? or after install?
[13:59:14] <Denommus> I'm creating a virtualenv, and then trying to install things under it using pip
[13:59:35] <Denommus> but not the pip that is inside this virtualenv
[14:01:02] <Denommus> ok, I changed a lot the command
[14:01:12] <Denommus> now I'm having an error with defusedxml -.-
[14:01:41] <Siecje> You should use the pip inside the virtualenv
[14:01:48] <Denommus> FileNotFoundError: [Errno 2] File or directory not found: 'usr/lib/my-env/lib/python3.5/site-packages/defusedxml-0.4.1-py3.5.egg-info/installed-files.txt'
[14:02:30] <Denommus> PIP_CONFIG_FILE=/dev/null debian/my-project/usr/lib/my-env/bin/pip install -r project/requirements.txt --root debian/my-project/ --install-option "--prefix=/usr/lib/my-env" --isolated --ignore-installed
[14:02:51] <Siecje> Create a virtualenv with `python3.5 -m venv $VENV_NAME` then use the pip that is created from that.
[14:03:05] <Denommus> Siecje: that's what I done above
[14:03:18] <Siecje> And what triggers the error? the pip install command?
[14:03:56] <Denommus> yes
[14:04:12] <Denommus> I'm trying without the prefix now
[14:04:27] <Denommus> just with --root
[14:05:49] <Denommus> FileNotFoundError: [Errno 2] File or directory not found: 'home/my-user/my-project-path/debian/my-project/usr/lib/my-env/lib/python3.5/site-packages/django_requestlogging-1.0-py3.5.egg-info/installed-files.txt'
[14:06:03] <Denommus> I have no idea why it became home/my-user/my-project-path
[14:06:52] <Denommus> PIP_CONFIG_FILE=/dev/null debian/my-project/usr/lib/my-env/bin/pip install -r royalty_exchange_project/requirements.txt --root debian/my-project/ --isolated --ignore-installed
[14:06:56] <Siecje> that is the current directory?
[14:07:23] <Denommus> yes, /home/my-user/my-project-path is PWD
[14:10:15] <Denommus> any pointers?
[14:13:29] <Denommus> Siecje: maybe I should include pwd in --root?
[14:15:08] <Denommus> still no luck :-/
[14:20:14] <Siecje> Denommus: Create the virtualenv where you want and don't use --root?
[14:25:27] <Denommus> Siecje: but the virtualenv is being used in a packaging process, scripts are referencing to the virtualenv's path when I don't specify root
[14:25:59] <Denommus> Siecje: is there a way to create a virtualenv in a path and "pretend" it exists in another path?
[14:26:20] <Denommus> Siecje: because that's what --root should be doing with the packages, right?
[14:26:31] <Siecje> Can't you just create it in the "pretend" path ?
[14:26:40] <Siecje> You could create a symlink
[14:27:46] <Denommus> Siecje: the "pretend" path is the system's root
[14:27:52] <Siecje> So you want it to be installed in /usr/lib/project-name/ ? Why not make that directory a venv and then install everything and then package that directory?
[14:28:34] <Denommus> because the debian package process requires the structure to be under debian/my-project/
[14:29:06] <Denommus> and I can't simply simlink the machine's root to it :P
[14:29:54] <Siecje> Denommus: What do you mean by debian/ ? that is not a full path
[14:30:30] <Siecje> create debian/usr/lib/ then python3.5 -m venv debian/usr/lib/project-name
[14:30:55] <Denommus> yes, I am creating a virtualenv under that place
[14:32:03] <Siecje> without --root ?
[14:32:17] <Denommus> without --root
[14:33:04] <Siecje> Denommus: pastebin the output?
[14:34:19] <Siecje> All you are doing is creating a venv and then installing packages.
[14:34:43] <Denommus> Siecje: the problem I'm having is not on creating the virtualenv, but making it relocatable
[14:35:26] <Denommus> Siecje: I want to it to see $(pwd)/debian/my-project as if it were /
[14:35:44] <Denommus> Siecje: am I clear now?
[14:35:45] <Siecje> why?
[14:36:01] <Siecje> debian/ is your /
[14:36:12] <Denommus> no, debian/my-project is my /
[14:36:26] <Denommus> because a single dpkg process can produce multiple packages
[14:36:49] <Denommus> *dh
[14:36:52] <Denommus> not dpkg
[14:36:54] <Siecje> You said a debian package must start with debian/ so if you want to add a file to /usr/lib/ you would have to put it in debian/usr/lib/
[14:37:11] <Denommus> it must start with debian/my-project
[14:37:16] <Denommus> I said it above
[14:37:52] <Denommus> is it too relevant, though?
[14:37:55] <Siecje> mkdir debian/my-project/usr/lib/
[14:37:55] <Siecje> python3.5 -m venv debian/my-project/usr/lib/my-project
[14:38:11] <Denommus> Siecje: yup, until that point it works
[14:38:19] <Denommus> Siecje: if I try to just install packages, it also works
[14:39:21] <Denommus> Siecje: BUT django-admin.py will use #!/home/my-user/my-project-path/debian/my-project/usr/lib/my-env/bin/python instead of #!/usr/lib/my-env/bin/python
[14:39:44] <Denommus> Siecje: that's why I need to set root, and that's why I need the virtualenv to be relocatable
[14:40:03] <Denommus> Siecje: was I clearer now? Do I need to provide better explanation?
[14:40:55] <Siecje> I understand now. I have seen that problem. For me part of the build process changes those lines.
[14:41:35] <Denommus> Siecje: so is your suggestion to just use sed?
[14:41:37] <Siecje> You could manually change them depending how many there are
[14:43:52] <Denommus> hm, ok
[14:43:58] <Denommus> I'll research a little bit more
[14:44:03] <Denommus> if nothing else works, I'll do it
[14:47:56] <Siecje> Why does pip install -e add the supplied path to sys.path? If it also creates a hardlink in site-packages/ ?
[17:32:50] <dstufft> Siecje: it doesn't createa hardlink
[17:37:11] <Siecje> Okay I was mistaken, I see it only adds an .egg-link file. Which I assume Python uses to construct sys.path
[17:38:00] <dstufft> ya
[17:44:36] <Denommus> Siecje: I seem to have managed to solve the problem with the --relocatable option