PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Saturday the 28th of March, 2015

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[00:32:52] <_habnabit> jessamynsmith, looks like mikeash updated Getting Answers to have gender-neutral language
[20:58:33] <simon_weber> I'm having some trouble with package_data/data_files. I'm packaging a wrapper to a non-extension c shared library. Right now I have everything working where the source is distributed in the package, then compiled at install time. The problem is that while the resulting library is built, it's never copied out of the build folder. Is this what
[20:58:33] <simon_weber> package_data/data_files is used for?
[20:58:44] <simon_weber> here's my code: https://github.com/simon-weber/python-libfaketime
[20:59:26] <simon_weber> I also tried `data_files=[('', [faketime_lib])],` instead, thinking that maybe the problem was that the library wasn't actually part of the package (no __init__ files), but that didn't work either.
[21:15:04] <ionelmc> simon_weber: i'd go for a custom build command
[21:15:59] <simon_weber> ionelmc: cool. can you link me some docs?
[21:16:53] <simon_weber> custom build commands to me means things like https://docs.python.org/2/install/#syntax-of-config-files
[21:17:29] <ionelmc> simon_weber: i'm afraid there are no docs for making custom a specific build command
[21:17:37] <ionelmc> i think that's all you got :|
[21:17:51] <ionelmc> simon_weber: here's an example https://github.com/ionelmc/python-hunter/blob/master/setup.py#L27-L32
[21:19:49] <simon_weber> ah, ok, I'm doing something similar with https://github.com/simon-weber/python-libfaketime/blob/f8b18c63e22d718f286e7622e3dadcc67777b743/setup.py#L34. Looks like self.copy_file might just be what I'm missing =)
[21:20:39] <ionelmc> simon_weber: also, if you use copy_file you don't need to futz around with data_files
[21:20:59] <ionelmc> those are just inputs for the build command afaik
[21:22:18] <simon_weber> ionelmc: perfect. thanks!
[22:49:16] <simon_weber> ionelmc: that works really well. The only problem is that the file isn't removed on uninstall -- do I need a symmetrical custom uninstall? Or is there a way to dynamically register my file to the manifest?
[22:50:44] <ionelmc> simon_weber: show some logs and you build command
[22:51:57] <simon_weber> here's the code: https://github.com/simon-weber/python-libfaketime/blob/f908dcbd0772118a60721e14ae30f3ff80ec01c4/setup.py#L36
[22:52:24] <simon_weber> install/uninstall:
[22:52:55] <ionelmc> simon_weber: not sure about that one, i'd go with a build command
[22:53:14] <simon_weber> https://www.irccloud.com/pastebin/9ZG4HxOd
[22:53:22] <ionelmc> i suspect that you need to add the file in some list
[22:53:46] <ionelmc> and i suspect the build command doesn't have that problem (since it's an intermediate step)
[22:54:32] <simon_weber> ah.
[22:55:18] <simon_weber> let me try that
[22:58:28] <simon_weber> hm, I wonder if can add it to package_data dynamically
[22:58:59] <simon_weber> oh, maybe that was the problem
[22:59:04] <simon_weber> package data things are handled during build
[23:26:02] <jck> Should I use package_data or data_files if i want to distribute additional files not essential to the package?
[23:27:22] <jck> specifically, i'm looking to distribute the .c and makefiles in the 'cosimulation' directory(which is outside the package dir) in this repo: https://github.com/jandecaluwe/myhdl
[23:30:08] <jck> !logs
[23:30:08] <pmxbot> http://chat-logs.dcpython.org/channel/pypa
[23:34:56] <ionelmc> jck: MANIFEST.in + include_package_data=True
[23:35:55] <ionelmc> jck: but you need to have the files inside a python package (dir with __init__.py file)
[23:36:17] <ionelmc> if you want custom stuff there's data_files
[23:36:35] <ionelmc> package_data essentially does what include_package_data does
[23:38:02] <jck> what would be the 'pythonic' way to do this? use data_files or move these files to package dir and then use package_data?
[23:38:54] <simon_weber> ionelmc: I went with overriding get_outputs (http://stackoverflow.com/a/27904843/1231454) to get the file registered.