pypa / pyproject-hooks

A low-level library for calling build-backends in `pyproject.toml`-based project
https://pyproject-hooks.readthedocs.io/
MIT License
122 stars 49 forks source link

0.11.0: switch from flit to setuptools ot put stub setup.py which impoerts setuptools? #126

Closed kloczek closed 3 years ago

kloczek commented 3 years ago

I just fount that pep517 is using flit and because of that I'm not able to use setuptools<>sphinx integration to generate man page :/ Looks like flit autogenerated setyp.py with imports distutils.core instead setuptools. I see two options:

To be honets I don't see to much sense of using now flit as it has no integration with sphinx and looks like flit maintainer has no intention to take care of test suite and documentation :/ https://github.com/takluyver/flit/issues/429

kloczek commented 3 years ago

Because setup.py imprts distutils.core insteadsetuptools` it is not possible to use command like below

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
/usr/lib64/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_require'
  warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'build_sphinx'
kloczek commented 3 years ago

FYI: https://www.sphinx-doc.org/en/master/usage/advanced/setuptools.html

takluyver commented 3 years ago

Bad luck, I also maintain this package, and I don't find the argument about setup.py build_sphinx any more compelling here. :wink:

Note also that the generated setup.py will be going away sooner or later. It was there to allow older versions of pip, without PEP 517 support, to install packages from sdists. Pip added support a couple of years ago, so sooner or later we'll stop generating setup.py.

pradyunsg commented 3 years ago

@kloczek Please stop filing such issues. You've singlehandedly wasted 1000s of hours of volunteer labor on open source projects, by refusing to accommodate for pyproject.toml based builds.

The Python ecosystem as a whole is moving away from setuptools as the only build backend. I strongly encourage you to accommodate to this changing reality, instead of asking 100s of open source projects to accommodate for your company's repackaging of them.

kloczek commented 3 years ago

Note also that the generated setup.py will be going away sooner or later. It was there to allow older versions of pip, without PEP 517 support, to install packages from sdists. Pip added support a couple of years ago, so sooner or later we'll stop generating setup.py.

So how it will be possible to generate documenation in exact format using new way?

pradyunsg commented 3 years ago

So how it will be possible to generate documenation in exact format using new way?

Use Sphinx directly. It provides a CLI command: sphinx-build.

https://www.sphinx-doc.org/en/master/man/sphinx-build.html

pradyunsg commented 3 years ago

Closing this out -- relying on sphinx's setuptools integration is a choice made in whatever packaging mechanism that @kloczek's developed/using. Not being able to use that with non-setuptools projects is a direct consequence of that.

IMO they should move away from relying on that integration and depend on the sphinx directly instead.