{"action":"opened","issue":{"url":"https://api.github.com/repos/scikit-build/scikit-build/issues/124","repository_url":"https://api.github.com/repos/scikit-build/scikit-build","labels_url":"https://api.github.com/repos/scikit-build/scikit-build/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/scikit-build/scikit-build/issues/124/comments","events_url":"https://api.github.com/repos/scikit-build/scikit-build/issues/124/events","html_url":"https://github.com/scikit-build/scikit-build/issues/124","id":170454134,"number":124,"title":"Implement as PEP 516 build tool, providing PEP 517 build backend interface, configured with pypackage.toml and CMakeLists.txt","user":{"login":"thewtex","id":25432,"avatar_url":"https://avatars.githubusercontent.com/u/25432?v=3","gravatar_id":"","url":"https://api.github.com/users/thewtex","html_url":"https://github.com/thewtex","followers_url":"https://api.github.com/users/thewtex/followers","following_url":"https://api.github.com/users/thewtex/following{/other_user}","gists_url":"https://api.github.com/users/thewtex/gists{/gist_id}","starred_url":"https://api.github.com/users/thewtex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thewtex/subscriptions","organizations_url":"https://api.github.com/users/thewtex/orgs","repos_url":"https://api.github.com/users/thewtex/repos","events_url":"https://api.github.com/users/thewtex/events{/privacy}","received_events_url":"https://api.github.com/users/thewtex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-10T15:59:49Z","updated_at":"2016-08-10T15:59:49Z","closed_at":null,"body":"With the end goal of being a build system tool for [PEP 518](https://www.python.org/dev/peps/pep-0518/) with good C extension support, scikit-build should be implemented as a [PEP 516](https://www.python.org/dev/peps/pep-0516/) build tool providing the build backend interface specified in [PEP 517](https://www.python.org/dev/peps/pep-0517/).\r\n\r\nFollowing the vision specified at the end of [this SciPy talk](https://www.youtube.com/watch?v=oE5iePv8nD8), most of the packaging specification should be provided declaratively in a `pypackage.toml` in the `[tool.skbuild]` section. Additional, more complicated packaging information, like how to build the C extensions, is provided in the CMake `CMakeLists.txt` configuration.\r\n\r\nThis means, like [flit](http://flit.readthedocs.io/), we generate wheels directly by creating [the wheel layout specified in PEP 427](https://www.python.org/dev/peps/pep-0427/). These wheels can be generated by calling an `skbuild` script followed by the subcommands specified in [PEP 516](https://www.python.org/dev/peps/pep-0516/) or by the API specified in [PEP 517](https://www.python.org/dev/peps/pep-0517/). We will [create a shim (that can also be placed in `setup.py` )](https://www.python.org/dev/peps/pep-0516/#setuptools-shim) when `python setup.py install` is called that will install the generated wheel so skbuild functionality can be used immediately with `pip`, a manual call to `python setup.py install`, or `conda`. But, if we follow PEP 516, 517, 518, when these PEPs are finalized and implemented in pip and conda, the setup.py shim will no longer be needed.\r\n\r\nSteps forward:\r\n\r\n- [ ] 1. **Implement `skbuild metadata` subcommand**. This is the `metadata` subcommand specified in PEP 516. It outputs the `METADATA` file contents (see PEP 427) to stdout. These are the metadata keys described in [PEP 345](https://www.python.org/dev/peps/pep-0345/). A package that uses scikit-build should specify these in a `pypackage.toml` file in the `[tool.skbuild]` section, probably with [lower-case key variants, a la flit](http://flit.readthedocs.io/en/latest/flit_ini.html#scripts-section). We can use [`wheel.pkginfo`]( http://wheel.readthedocs.io/en/latest/api.html#module-wheel.pkginfo) to help with this and [pytoml](https://github.com/avakar/pytoml)\r\n\r\n- [ ] 2. **Implement `skbuild.api.get_wheel_metadata`**. This implements the `get_wheel_metadata` method as specified in PEP-517, which creates the wheel `{package}-{version}.distinfo` directory in the specified location and populates it with the `METADATA` file from Step 1. along with the `WHEEL` file (see PEP 427).\r\n\r\n- [ ] 3. **Implement the `skbuild wheel` subcommand**. This is the PEP 516 `wheel` subcommand. Internally, it should call `skbuild.api.build_wheel` as specified in PEP 517. This can be created with the assistance of `wheel.archive` subcommand. Our `[tool.skbuild]` section of pypackage.toml can have additional keys, `py_modules`, a list of Pure Python modules to install directly into the wheel,  `py_packages`, a list of Pure Python packages to install directly into the wheel, and `data`, directories to install directly into the `.data/data` section of the wheel. Also, a `scripts` with a list of *script, entrypoint tuples*. Then *cmake* should be configured with `CMAKE_INSTALL_PREFIX` set to the wheel root directory. Other CMake variables to specify during configuration: `WHEEL_PURELIB`, which is set to `{package}-{version}.data/purelib`,  and similar for `WHEEL_PLATLIB`, `WHEEL_HEADERS`, and `WHEEL_DATA`. Finally, there should a section in pypackage.toml that specifies what CMake `install` command `COMPONENTS` should be installed. \r\n\r\n- [ ] 4. **Implement the `skbuild install` subcommand**. This can just delegate to `wheel.install` as a convenient way to install a package. Check out `flit install`.\r\n\r\n- [ ] 5. **Implement the setup.py shim**. This can effectively call `skbuild install` .\r\n\r\n- [ ] 4. **Implement the `skbuild build_requires` subcommand**. This is the PEP 516 `build_requires` subcommand, which should call `skbuild.api.get_build_requires` as specified in PEP 517. This could output the content of a pypackage.toml metadata entry along with other requirements like a *cmake* python package that encapsulates CMake, etc.\r\n\r\n- [ ] 4. **Implement the `skbuild develop` subcommand**. This is the PEP 516 `develop` subcommand. Just error out; I don't think it is reasonable to support this.\r\n\r\nThe current approach of wrapping setuptools does not get us closer to PEP 516/517/518 support. The monkeypatching of setuptools, which is monkeypatching distutils, and trying to masquerade C-extension as package_data is problematic (see e.g. #117, #106, #84, #107). It does not move towards better pypackage.toml adoption and independence from distutils/setuptools. It should be abandoned."}}
{"actor":{"display_login":"thewtex"}}