{"action":"created","issue":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/2903","repository_url":"https://api.github.com/repos/mesonbuild/meson","labels_url":"https://api.github.com/repos/mesonbuild/meson/issues/2903/labels{/name}","comments_url":"https://api.github.com/repos/mesonbuild/meson/issues/2903/comments","events_url":"https://api.github.com/repos/mesonbuild/meson/issues/2903/events","html_url":"https://github.com/mesonbuild/meson/issues/2903","id":287420772,"number":2903,"title":"[Python support] Install python files and *.pyc, *pyo object files","user":{"login":"Salamandar","id":6552989,"avatar_url":"https://avatars1.githubusercontent.com/u/6552989?v=4","gravatar_id":"","url":"https://api.github.com/users/Salamandar","html_url":"https://github.com/Salamandar","followers_url":"https://api.github.com/users/Salamandar/followers","following_url":"https://api.github.com/users/Salamandar/following{/other_user}","gists_url":"https://api.github.com/users/Salamandar/gists{/gist_id}","starred_url":"https://api.github.com/users/Salamandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Salamandar/subscriptions","organizations_url":"https://api.github.com/users/Salamandar/orgs","repos_url":"https://api.github.com/users/Salamandar/repos","events_url":"https://api.github.com/users/Salamandar/events{/privacy}","received_events_url":"https://api.github.com/users/Salamandar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-01-10T12:44:15Z","updated_at":"2018-02-01T00:05:27Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I know that Python is not really supported by Meson, but with c/c++ softwares often come python bindings.\r\nThat'd be great to have some support for installing Python files with their optimized binary files with:\r\n```meson\r\ninstall_python([\r\n        'my_files.py',\r\n    ],\r\n    build_pyc: true,\r\n    build_pyo: true,\r\n    install_dir: join_paths(mydatadir, 'python'),\r\n)\r\n```\r\n\r\nMaybe that would mean building pyc/pyo at install target only, or at build time ?"},"comment":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/comments/362113251","html_url":"https://github.com/mesonbuild/meson/issues/2903#issuecomment-362113251","issue_url":"https://api.github.com/repos/mesonbuild/meson/issues/2903","id":362113251,"user":{"login":"eli-schwartz","id":6551424,"avatar_url":"https://avatars1.githubusercontent.com/u/6551424?v=4","gravatar_id":"","url":"https://api.github.com/users/eli-schwartz","html_url":"https://github.com/eli-schwartz","followers_url":"https://api.github.com/users/eli-schwartz/followers","following_url":"https://api.github.com/users/eli-schwartz/following{/other_user}","gists_url":"https://api.github.com/users/eli-schwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/eli-schwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eli-schwartz/subscriptions","organizations_url":"https://api.github.com/users/eli-schwartz/orgs","repos_url":"https://api.github.com/users/eli-schwartz/repos","events_url":"https://api.github.com/users/eli-schwartz/events{/privacy}","received_events_url":"https://api.github.com/users/eli-schwartz/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T00:05:27Z","updated_at":"2018-02-01T00:05:27Z","author_association":"NONE","body":"> It should behave like most post-install steps, if `DESTDIR` is set (aka a distro package) don't generate them, otherwise do. I think pacman not having a rule for that is the odd one out but they probably do that because the other tooling already did it.\r\n\r\nWrong. We don't have a rule for it, because as a KISS distro we believe that this is upstream's job, and not something that should be bluntly hacked around in our packaging scripts. :stuck_out_tongue:\r\n\r\nmakepkg uses a simple bash script with some pkgname, pkgver, etc. metadata which defines `build()` and `package()` functions that the package maintainer uses to call the upstream build commands. Unlike many other distros, we do not provide \"magic\" wrappers for autoreconf, ./configure, make, setup.py, cmake, or anything else. We have no plans to provide magic wrappers for byte-compiling python files either, and if we absolutely must then each and every Arch package will end up running `meson ..; ninja; DESTDIR=\"$pkgdir\" ninja install` and then afterwards run `python -m compileall \"$pkgdir\"/path/to/python3/files`.\r\n\r\nIt would be nice if meson followed in the footsteps of setuptools in this respect. At the very least, for the sake of people who do *not* set `DESTDIR` and do not have Debian/Fedora/SUSE doing this for them... and once the functionality exists at all, then it should be trivial to expose this via a meson option in addition/instead.\r\n\r\nThings like `update-desktop-database`, `update-mime-database`, etc are *true* post-install steps, as they are very dependent on the live OS. (In fact, you cannot run them beforehand because they write to the same file for every piece of software.)\r\nIn comparison, byte-compiling pyc files has nothing intrinsically to do with post-install, but many distros implement it that way regardless for example to reduce package size."}}
{"actor":{"display_login":"eli-schwartz"}}