{"action":"created","issue":{"url":"https://api.github.com/repos/objectified/vdist/issues/5","labels_url":"https://api.github.com/repos/objectified/vdist/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/objectified/vdist/issues/5/comments","events_url":"https://api.github.com/repos/objectified/vdist/issues/5/events","html_url":"https://github.com/objectified/vdist/issues/5","id":124224974,"number":5,"title":"I don't get how vdist works when run against a project with setup.py","user":{"login":"dante-signal31","id":11260761,"avatar_url":"https://avatars.githubusercontent.com/u/11260761?v=3","gravatar_id":"","url":"https://api.github.com/users/dante-signal31","html_url":"https://github.com/dante-signal31","followers_url":"https://api.github.com/users/dante-signal31/followers","following_url":"https://api.github.com/users/dante-signal31/following{/other_user}","gists_url":"https://api.github.com/users/dante-signal31/gists{/gist_id}","starred_url":"https://api.github.com/users/dante-signal31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dante-signal31/subscriptions","organizations_url":"https://api.github.com/users/dante-signal31/orgs","repos_url":"https://api.github.com/users/dante-signal31/repos","events_url":"https://api.github.com/users/dante-signal31/events{/privacy}","received_events_url":"https://api.github.com/users/dante-signal31/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-29T15:23:16Z","updated_at":"2016-01-05T08:12:03Z","closed_at":null,"body":"I'm trying to package [geolocate](https://github.com/dante-signal31/geolocate), but I haven't got an useful deployment package because of what I'm going to describe you.\r\n\r\nMy [vdist](https://github.com/objectified/vdist/) script is like this:\r\n```python\r\n \r\nfrom vdist.builder import Builder\r\nfrom vdist.source import git\r\n\r\nbuilder = Builder()\r\n\r\nbuilder.add_build(\r\n    app='geolocate',\r\n    version='1.3.0',\r\n    source=git(\r\n        uri='https://github.com/dante-signal31/geolocate',\r\n        branch='master'\r\n    ),\r\n    profile='ubuntu-trusty',\r\n    compile_python=True,\r\n    compile_python_version='3.4.3',\r\n    fpm_args='--maintainer dante.signal31@gmail.com -a native --url https://github.com/dante-signal31/geolocate --description \"This program accepts any text and searchs inside every IP address. With each of those IP addresses, geolocate queries Maxmind GeoIP database to look for the city and country where IP address or URL is located. Geolocate is designed to be used in console with pipes and redirections along with applications like traceroute, nslookup, etc. \" --license BSD-3 --category net',\r\n    requirements_path='/REQUIREMENTS.txt'\r\n)\r\n\r\nbuilder.build()\r\n```\r\n\r\nAs far as I've found out, vdist does next steps:\r\n\r\n1. Launch a Docker container.\r\n2. Updates that container OS packages.\r\n3. Installs [fpm](https://github.com/jordansissel/fpm).\r\n4. Downloads, compiles and install a Python interpreter with given version.\r\n5. Creates (if it doesn't exist yet) an /opt folder.\r\n6. Clones given git repository inside /opt folder.\r\n7. Creates a virtualenv with compiled Python inside /opt project folder.\r\n8. Activates virtualenv.\r\n9. Installs with pip all Python Package Index dependencies inside virtualenv.\r\n10. If project has a setup.py then runs it to install project inside virtualenv.\r\n11. Packages with fpm project folder and compiled python folder.\r\n12. Leaves compiled package in container shared folder.\r\n13. Shutdowns docker container.\r\n\r\nOK, I understand the overall process but I don't get steps 10 and 11 (mainly 11):\r\n\r\n* If you have run *\"python setup.py install\"*, project folder becomes useless because runnable application is actually installed in your virtualenv's *lib/python/site-packages*. As vdist seems to work, you end with your *setup.py* and *requirements.txt* being included in your deployment package, which are something I think you surely don't want in your debian package.\r\n* If vdist packages your compiled python folder but doesn't include anyhow your virtualenv's *site-packages* folder, pip downloaded dependencies shouldn't be lost?. \r\n* Vdist seems to focus on packaging project folder (that I said I think is mainly useless after setup's install) but doesn't seems to take in count virtualenv *site-packages* folder generated by setup install (which in my humble opinion is what you'd likely want to deploy). Actually, my *setup.py* generates too a geolocate launcher that is placed in virtualenv *bin* folder. I don't know how to include that launcher in generated package. \r\n* Suppose you end with a debian package that installs two folder: your application and the python virtualenv folder needed to run your application. How do you automate the installed virtualenv activation when your application launcher is called?.\r\n \r\nThanks for your time!"},"comment":{"url":"https://api.github.com/repos/objectified/vdist/issues/comments/168931232","html_url":"https://github.com/objectified/vdist/issues/5#issuecomment-168931232","issue_url":"https://api.github.com/repos/objectified/vdist/issues/5","id":168931232,"user":{"login":"objectified","id":1171716,"avatar_url":"https://avatars.githubusercontent.com/u/1171716?v=3","gravatar_id":"","url":"https://api.github.com/users/objectified","html_url":"https://github.com/objectified","followers_url":"https://api.github.com/users/objectified/followers","following_url":"https://api.github.com/users/objectified/following{/other_user}","gists_url":"https://api.github.com/users/objectified/gists{/gist_id}","starred_url":"https://api.github.com/users/objectified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objectified/subscriptions","organizations_url":"https://api.github.com/users/objectified/orgs","repos_url":"https://api.github.com/users/objectified/repos","events_url":"https://api.github.com/users/objectified/events{/privacy}","received_events_url":"https://api.github.com/users/objectified/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T08:12:03Z","updated_at":"2016-01-05T08:12:03Z","body":"Both your questions are assuming a scenario where a setup.py is actually used. In many cases, it is not used. Typically reusable modules provide a setup.py, but standalone applications typically do not. I decided to perform a `python setup.py install` just because your application might require entry points to be present in some cases. In these cases - yes, the application is running from the \"installed\" location. Making a distinction between those two cases might be more pure, but I'm not sure if that's worth the effort given that the number of applications packaged with vdist that actually provide a setup.py might be fairly minimal. I'm assuming that reusable modules often end up in a PyPI repository/Conda channel or what have you. Of course it is *possible* to package reusable Python modules with vdist, it has never been its goal. The goal of vdist is to provide isolated packages that can be deployed on their own.\r\n\r\nThe Python packaging and deployment ecosystem is quite messy. I'm not trying to solve all of its problems, but I created vdist to get rid of the pain of depending on OS provided libraries and having to do pip installs on production machines."}}