readme_renderer: this tools should install first build-requires from pep-517 before executing

Otherwise, build extensions (e.g. setuptools-scm) cannot be interpreted (unless also fored in setup_requires). This package tries to look into setup.py so should first ensure it has build-requires.

2018-09-12T17:48:42.0336128Z package-description runtests: commands[0] | python setup.py check -r -s
2018-09-12T17:48:42.3094762Z running check
2018-09-12T17:48:42.3112596Z /opt/hostedtoolcache/Python/3.7.0/x64/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version'
2018-09-12T17:48:42.3129581Z   warnings.warn(msg)
2018-09-12T17:48:42.3145311Z warning: Check: missing required meta-data: version
2018-09-12T17:48:42.3153240Z 
2018-09-12T17:48:42.9435964Z The project's long description is valid RST.
2018-09-12T17:48:42.9454270Z error: Please correct your package.
2018-09-12T17:48:43.0199465Z ERROR: InvocationError for command '/home/vsts/work/1/s/.tox/package-description/bin/python setup.py check -r -s' (exited with code 1)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

This is done, thanks for raising the issue @gaborbernat!

I see. So what would this twine require to be a reality?

https://github.com/pypa/twine/pull/395 should do it.

I’m going to leave this issue open until that’s merged/released and we’ve updated the readme_renderer documentation to tell people to use twine check instead.

This command happens too late in the process to do anything wrt to PEP517/518. One of the things that pyproject.toml enables is sticking import foo at the top of your setup.py, which would mean that the issues with setup_requires would come back, that if you wanted to use this command you’d have to delay all your imports and such so that this command had a chance to install dependencies first.

IOW, I don’t think there is a way to do this, except by not integrating as a setup.py command and working as a top level command instead. Probably it would be saner to add a twine check command or something that could do the needful and invoke readme_renderer in a post PEP 517/518 world.