PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Friday the 3rd of April, 2015

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[04:33:11] <Ashald> well I managed to solve the issue by moving my code into src dir
[04:33:29] <Ashald> so the .egg-ingo created not in the same dir as setup.py is located but in src/
[04:34:47] <Ashald> though I think it's as a bug
[04:35:11] <Ashald> (unless I'm doing something wrong)
[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:39:27] <skamithi> ionelmc: http://stackoverflow.com/questions/5323483/how-to-use-conditionals-in-gemfile
[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:42:21] <ionelmc> https://testrun.org/tox/
[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:53:18] <linovia> skamithi: that's correct
[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:54:42] <ionelmc> skamithi: try metaclasses heheh
[12:55:03] <linovia> not even sure about that
[12:55:12] <linovia> there's less legacy with metaclasses ;)
[12:55:51] <ionelmc> linovia: i bet you don't know what happens when you set __metaclass__ globally on python2
[12:56:10] <linovia> cheers
[12:56:21] <apollo13> changed mro?
[12:56:40] <ionelmc> old-style classes from that module will magically use that metaclass (and become new-style in the process)
[12:57:01] <apollo13> yes, so changes in mro etc…
[12:57:07] <ionelmc> apollo13: there's no mro with old style
[12:57:14] <apollo13> exactly :þ
[12:58:46] <linovia> there's a point I'm missing with pip and yesterday's issue I had with eggs
[12:59:05] <apollo13> eggs :þ
[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:02:58] <ionelmc> but people do it!
[13:03:00] <ionelmc> :-)
[13:03:10] <apollo13> ionelmc: people also use mysql *hint*
[13:03:13] <skamithi> know of any projects where someone is doing something similar i can learn how to do it properly
[13:03:20] <linovia> isn't that supposed to be done before the package is done ?
[13:03:29] <ionelmc> apollo13: that hurts
[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
[14:25:19] <linovia> sad to hear
[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:45:27] <Berra> >python path/to/file.py
[16:45:33] <Berra> Wooble: ^
[16:45:59] <Berra> From an activated shell
[16:46:15] <Wooble> Berra: is file.py inside the package? if you just run "python", can you import it from the REPL?
[16:47:21] <Berra> If I run python I can not import it (unless I stand directory wise in such a way that it will do it through the file itself).
[16:48:17] <Berra> The file I am running is package/tests/testcase.py
[16:48:23] <Berra> So yes it's under the package
[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
[16:50:21] <elarson> ah hah!
[16:50:26] <elarson> ionelmc: thanks!
[17:05:03] <ionelmc> haha
[17:05:09] <ionelmc> yeah it's something about $HOME
[17:05:13] <ionelmc> :-)
[17:15:22] <Wooble> Berra: use entry points; you can't really run scripts from within packages they use. bit.ly/pypackages is a nice thing to read.
[17:16:58] <Berra> I will use entry_points
[17:59:05] <DanielHolth> hello ionelmc
[17:59:14] <ionelmc> DanielHolth: hey
[18:29:11] <ionelmc> DanielHolth: what's up?
[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.