You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/maintainer/knowledge_base.md
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1364,6 +1364,89 @@ Currently available packages:
1364
1364
- exceptiongroup
1365
1365
- importlib-metadata
1366
1366
1367
+
## Python PEP517 Build Isolation {#pep517}
1368
+
1369
+
[PEP517](https://www.python.org/dev/peps/pep-0517/) paves the way for building python wheels in a well-defined, isolated environment, and is generally a good step forward. However, `conda-build` already performs this function, even distinguishing between the `host` and `build` environments, and supporting additional, heavyweight dependencies like compilers and other build-time language runtimes.
1370
+
1371
+
### Common PEP517 Problems
1372
+
1373
+
A number of symptoms of PEP517 build isolation conflicts with `conda-build` manifest in different ways.
1374
+
1375
+
#### `ModuleNotFoundError` during test
1376
+
1377
+
When problems occur at the interaction of `pip` and more exotic build tools like e.g. `poetry` and `flit`, the expected output can leave the as-installed package in a bad state, which might leave the following `meta.yaml` excerpt like this...
1378
+
1379
+
```yaml
1380
+
package:
1381
+
name: foopkg
1382
+
version: 0.1.0
1383
+
1384
+
build:
1385
+
script: {{ PYTHON }} -m pip install . -vv
1386
+
1387
+
requirements:
1388
+
host:
1389
+
- poetry-core
1390
+
- python
1391
+
run:
1392
+
- python
1393
+
1394
+
test:
1395
+
requires:
1396
+
- pip
1397
+
imports:
1398
+
- foopkg
1399
+
commands:
1400
+
- pip check
1401
+
```
1402
+
1403
+
...showing an error like this:
1404
+
1405
+
```sh
1406
+
File "~/conda/feedstock_root/build_artifacts/foopkg_1635435591741/test_tmp/run_test.py", line 2, in <module>
1407
+
import foopkg
1408
+
ModuleNotFoundError: No module named 'foopkg'
1409
+
import: 'foopkg'
1410
+
```
1411
+
1412
+
#### Version `0.0.0` reported
1413
+
1414
+
Further, some other tools such as `setuptools_scm` might leave the version observed by e.g. `pip check` or `entry_points` at `0.0.0`.
1415
+
1416
+
### PEP517 Workarounds
1417
+
1418
+
:::note
1419
+
Some workarounds are available for the above problems, but eventually this will have to be fixed in `conda-build` itself
This falls back to some previous `pip` behavior, and allows many builds to continue normally
1430
+
1431
+
:::tip[Hint]
1432
+
While this is a deprecated feature which will be removed in the future, it has the advantage of being a <span class="title-ref">well-known string</span> for which it might be possible to write an automated migration once a real fix is available.
In the absence of a `pyproject.toml`, installation will fall back on legacy metadata files such as `setup.py` and/or `setup.cfg`.
1445
+
1446
+
:::warning
1447
+
This relies on most PEP517-compliant tools generating these files to include in `.tar.gz` during the build process. It is unknown how long this will be supported, and is likely to introduce other, unknown issues as more build/test tools make use of `pyproject.toml`.
0 commit comments