question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Call for clarification: acceptable values for build-system.requires in pyproject.toml

See original GitHub issue

Environment

  • pip version: 19.0.3
  • Python version: 3.7
  • OS: GNU/Linux

Description

It’s not clear nor is clearly specified by PEP518. But I was having a need to have an in-tree build back-end. So I’ve hacked it via installing with a relative path. And it works! Yet, @pradyunsg has pointed out that the way I used probably doesn’t conform to PEP 508. So I tried some other ways to point to the in-tree distribution. And those didn’t work.

How to Reproduce

(this works)

[build-system]
requires = ["./build-aiohttp", ]
build-backend = "build_aiohttp.api"

# not yet supported, so it doesn't influence anything, it's for forward-compat:
backend-path = "./build-aiohttp"

But if instead of "./build-aiohttp" in requires I try any of "file://build-aiohttp", "file:///./build-aiohttp", "build_aiohttp @ file://./build-aiohttp", "build_aiohttp @ file:./build-aiohttp" pip fails to recognize those as installables.

Expected behavior

I don’t know what to expect. The method which works seems to be undefined in PEPs so I probably shouldn’t rely on it.

Pip may either decide to improve the filtering of requires option or document it being permissive…

P.S. Oh and, by the way, I was able to test my other PEP517 backend outside of the project tree via

[build-system]
requires = ["../fortunate_pkg"]

so this relative path feature proves to be quite useful for development/debugging purposes.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
chrahuntcommented, Jul 21, 2019

Agreed, especially since this use case is covered by intreehooks and (soon) backend-path.

1reaction
pradyunsgcommented, Jul 21, 2019

I’m inclined to say let’s actually abort in this edge case.

I don’t want people trying things they shouldn’t and it sort-of working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 518 – Specifying Minimum Build System Requirements ...
This key must have a value of a list of strings representing PEP 508 dependencies required to execute the build system (currently that...
Read more >
"requires" (pyproject.toml) with a local package in editable mode
Here's what my pyproject.toml file looks like currently: [build-system] requires = ["setuptools", "wheel", "toml", "my_local_package"].
Read more >
Packaging Your Python Code With pyproject.toml - YouTube
... using a pyproject. toml file and installing your package with pip. This offers nice benefits, such as: - Being able to call...
Read more >
Clarifying PEP 518 (a.k.a. pyproject.toml)
But what if your project wanted to use flit instead of setuptools? [build-system] requires = ["flit"].
Read more >
pyproject.toml - pip documentation v22.3.1
toml file is a list of requirement specifiers for build-time dependencies of a package. [build-system] requires = ["setuptools ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found