[12:26:18] <skamithi> hi. i'm a ruby developer new to python packaging. trying to replicate behaviour i'm used to in bundler with gemfile. I want to have python setup.py run some kind of command that installs development dependencies. I see there is 'python setup.py develop', but i don't see a way to tell it only install a set of packages in development mode and not in production mode. any examples showing how to do this? many thx.
[12:37:00] <ionelmc> skamithi: how do you specify development and deploy (or production) dependencies in ruby?
[12:40:45] <skamithi> my python project has 3 dependencies. i have some C programmers that want to help out and i'm looking for a simple way to say, build an virtualenv environment, run this command and it will install the dependencies and start developing on the python project. i could just write a bash script to this but was wondering if python already described a way to do this.
[12:41:49] <skamithi> all the dependencies are found on pypi
[12:42:02] <ionelmc> skamithi: i like to use tox for building virtualenvs and testing
[12:43:24] <ionelmc> skamithi: you can mix that with requirement.txt files
[12:43:53] <linovia> skamithi: usually with setup.py, you'll have a core set (usually the one used in production) and sections dev / test / others that you can install with pip install -e .[postgres] in the current sources
[12:44:32] <skamithi> ionelmc: i'll give tox a try.
[12:44:32] <linovia> https://github.com/getsentry/sentry/blob/master/setup.py << you have options for postgres / mysql here as an example
[12:45:15] <ionelmc> linovia: i think he's saying tht he don't want some deps be installed in "dev mode" (that are present in prod)
[12:45:48] <ionelmc> oh right, so he'd use the postgres extra in prod
[12:46:34] <linovia> either that or have a platform specific requirement file (which is installed through pip install -r <file>)
[12:46:37] <ionelmc> skamithi: also, don't forget version pinning https://caremad.io/2013/07/setup-vs-requirement/
[12:47:21] <skamithi> linovia: so with your style of setup.py i'd do "pip install -e test" and it will install the dependencies to run a test or "pip install -e devel" and it will the packages for developing the app
[12:47:57] <linovia> skamithi: it'll run the install_requires + test or installed_requires + devel
[12:48:12] <linovia> core + options (note that you can specify several)
[12:51:25] <skamithi> linovia, so i can specify a requirements_devel.txt and run "pip install -r requirements_devel.txt" ? and only use the install_requires in setup.py for the production dependencies, i.e when someone is installing my app.
[12:54:06] <skamithi> linovia, ionelmc, thx for the tips. python packaging is the most complicated thing i've found in python so far. but the example setup.py linovia provided is helpful and tox may solve my problem for testing my app against python3 and python2 when doing continuous integration.
[12:59:29] <linovia> when I'm doing a pip install <package> and there's several level of dependancies, how does pip ensure setuptools isn't called and creates eggs ?
[13:02:14] <skamithi> got another question about packaging. got a good example of a setup.py where I can run 'setup.py install' and have it build .mo translation files and install the translation files in the right place from .po files in the project/po directory. my app will be internationalized.
[13:02:40] <apollo13> skamithi: I don't think that should be part of setup.py
[13:02:53] <apollo13> at least not the building of the mo files
[13:04:03] <apollo13> ionelmc: that is the fault of mysql, not mine ;) *scnr*
[13:04:31] <ionelmc> skamithi: you can use setup.py as a build system but it's incredibly tricky
[13:04:59] <apollo13> ionelmc: but thanks to you I could fix a mysql utf8mb4 system recently quite easily
[13:06:25] <skamithi> i can do it using distutils-extras during my tests but i'm trying to find another way without that dependency. it has a build_i18n option that i ran before doing setup.py install. blog posts seem to frown upon using distutils-extras.
[13:07:33] <ionelmc> skamithi: if you deploy to a single kind of OS then it's best to use some specialized build tool
[13:13:09] <skamithi> ionelmc, apollo13. thx again for the tips.. back to coding now :)
[14:23:09] <ronny> linovia: its impossible to prevent eggs from setup_requires as of now
[16:40:01] <Berra> I've installed my package into the virtualenv environment (I can see it with pip list inside the virtual environment). But still, when I try to run a file that imports the package I get No module named 'yzx'
[16:44:56] <Wooble> Berra: How did you run the file that imports it?
[16:48:31] <elarson> I think I might have asked this before, but when pip gives a warning regarding it mentions a '-H' flag, but pip install --help doesn't mention it.
[16:49:09] <elarson> is it for installing in your $HOME directory?
[16:50:13] <ionelmc> elarson: it's a sudo arg, run `man sudo` for details
[18:31:51] <DanielHolth> maybe should finally fix that abi tag for py2 :)
[18:32:03] <DanielHolth> In Python 3 you get ('cp34', 'cp34m', 'linux_x86_64')
[18:33:21] <ionelmc> DanielHolth: what would happen to the old wheels (thos that have "none" for abi tag)?
[18:33:33] <DanielHolth> They would still be installable
[18:34:12] <DanielHolth> The annoying bit would be building wheels that only the newest pip would recognize as installable, so it would probably have to be not the default for a while
[18:41:57] <ionelmc> DanielHolth: time is of the essence then :)
[18:42:14] <ionelmc> not sure how i could help, i'm not familiar with either codebases :|
[18:42:58] <DanielHolth> I just need the code to detect whether Python 2.7 is "d" "m" or "u", and generate a tag like py27dmu
[18:43:22] <DanielHolth> I thought I should have it laying around somewhere, but I don't think I have a well-tested version.
[18:43:40] <DanielHolth> Afterwards it's simple to add the tag to the list.