Skip to content

Commit 40eca66

Browse files
authored
docs: add conda help to faqs (#868)
Adding some more FAQs. Signed-off-by: Henry Schreiner <[email protected]>
1 parent 6b02b1b commit 40eca66

File tree

4 files changed

+60
-14
lines changed

4 files changed

+60
-14
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ repos:
8888
- rich
8989
- setuptools-scm
9090
- tomli
91-
- types-setuptools~=70.0
91+
- types-setuptools>=70.1
9292

9393
- repo: https://github.com/henryiii/check-sdist
9494
rev: "v1.0.0rc2"

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
[![PyPI version][pypi-version]][pypi-link]
1111
[![Conda-Forge][conda-badge]][conda-link]
1212
[![PyPI platforms][pypi-platforms]][pypi-link]
13+
[![Downloads][download-badge]][download-link]
1314

1415
> [!NOTE]
1516
>
@@ -366,26 +367,28 @@ those of the author(s) and do not necessarily reflect the views of the National
366367
Science Foundation.
367368

368369
<!-- prettier-ignore-start -->
370+
[OAC-2209877]: https://www.nsf.gov/awardsearch/showAward?AWD_ID=2209877&HistoricalAwards=false
369371
[actions-badge]: https://github.com/scikit-build/scikit-build-core/workflows/CI/badge.svg
370372
[actions-link]: https://github.com/scikit-build/scikit-build-core/actions
373+
[cmeel]: https://github.com/cmake-wheel/cmeel
374+
[codecov-badge]: https://codecov.io/gh/scikit-build/scikit-build-core/branch/main/graph/badge.svg?token=ZLbQzIvyG8
375+
[codecov-link]: https://codecov.io/gh/scikit-build/scikit-build-core
371376
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/scikit-build-core
372377
[conda-link]: https://github.com/conda-forge/scikit-build-core-feedstock
373-
[cmeel]: https://github.com/cmake-wheel/cmeel
374-
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
375-
[github-discussions-link]: https://github.com/orgs/scikit-build/discussions
376378
[discord-badge]: https://img.shields.io/discord/803025117553754132?label=Discord%20chat%20%23scikit-build
377379
[discord-link]: https://discord.gg/pypa
378-
[codecov-badge]: https://codecov.io/gh/scikit-build/scikit-build-core/branch/main/graph/badge.svg?token=ZLbQzIvyG8
379-
[codecov-link]: https://codecov.io/gh/scikit-build/scikit-build-core
380+
[download-badge]: https://static.pepy.tech/badge/scikit-build-core/month
381+
[download-link]: https://pepy.tech/project/scikit-build-core
382+
[enscons]: https://pypi.org/project/enscons
383+
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
384+
[github-discussions-link]: https://github.com/orgs/scikit-build/discussions
385+
[hatchling]: https://hatch.pypa.io/latest
386+
[maturin]: https://www.maturin.rs
387+
[meson-python]: https://meson-python.readthedocs.io
388+
[py-build-cmake]: https://tttapa.github.io/py-build-cmake
380389
[pypi-link]: https://pypi.org/project/scikit-build-core/
381390
[pypi-platforms]: https://img.shields.io/pypi/pyversions/scikit-build-core
382391
[pypi-version]: https://badge.fury.io/py/scikit-build-core.svg
383392
[rtd-badge]: https://readthedocs.org/projects/scikit-build-core/badge/?version=latest
384393
[rtd-link]: https://scikit-build-core.readthedocs.io/en/latest/?badge=latest
385-
[OAC-2209877]: https://www.nsf.gov/awardsearch/showAward?AWD_ID=2209877&HistoricalAwards=false
386-
[hatchling]: https://hatch.pypa.io/latest
387-
[maturin]: https://www.maturin.rs
388-
[meson-python]: https://meson-python.readthedocs.io
389-
[enscons]: https://pypi.org/project/enscons
390-
[py-build-cmake]: https://tttapa.github.io/py-build-cmake
391394
<!-- prettier-ignore-end -->

docs/faqs.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,48 @@ are not redistrubutable cannot be uploaded to PyPI[^2]. You have to run your
7676
wheels through `auditwheel` to make `manylinux` wheels. `cibuildwheel`
7777
automatically does this for you. See [repairing](#repairing-wheels).
7878

79+
## Making a Conda recipe
80+
81+
`scikit-build-core` is available on conda-forge, and is used in [dozens of recipes][]. There are a few things to keep in mind.
82+
83+
You need to recreate your `build-system.requires` in the `host` table, with the
84+
conda versions of your dependencies. You also need to add `cmake` and either
85+
`make` or `ninja` to your `build:` table. Conda-build hard-codes
86+
`CMAKE_GENERATOR="Unix Makefiles` on UNIX systems, so you have to set or unset
87+
this to use Ninja if you prefer Ninja. The `scikit-build-core` recipe cannot
88+
depend on `cmake`, `make`, or `ninja`, because that would add those to the
89+
wrong table (`host` instead of `build`). Here's an example:
90+
91+
```yaml
92+
build:
93+
script:
94+
- {{ PYTHON }} -m pip install . -vv
95+
96+
requirements:
97+
build:
98+
- python # [build_platform != target_platform]
99+
- cross-python_{{ target_platform }} # [build_platform != target_platform]
100+
- {{ compiler('c') }}
101+
- {{ stdlib('c') }}
102+
- {{ compiler('cxx') }}
103+
- cmake >=3.15
104+
- make # [not win]
105+
host:
106+
- python
107+
- pip
108+
- scikit-build-core >=0.2.0
109+
run:
110+
- python
111+
```
112+
113+
114+
115+
## Supporting free-threaded builds on Windows
116+
117+
Windows currently requires a little extra care. You should set the C define
118+
`Py_GIL_DISABLED` on Windows; due to the way the two builds share the same
119+
config files, Python cannot set it for you on the free-threaded variant.
120+
79121
[^1]:
80122
Due to a [bug in packaging](https://github.com/pypa/packaging/issues/160),
81123
some backends may mistakenly produce the wrong tags (including
@@ -91,5 +133,6 @@ automatically does this for you. See [repairing](#repairing-wheels).
91133
[scientific python cookie]: https://github.com/scientific-python/cookie
92134
[scientific python development guidelines]: https://learn.scientific-python.org/development
93135
[pybind11 example]: https://github.com/pybind/scikit_build_example
136+
[dozens of recipes]: https://github.com/search?type=code&q=org%3Aconda-forge+path%3Arecipe%2Fmeta.yaml+scikit-build-core
94137

95138
<!-- prettier-ignore-end -->

src/scikit_build_core/setuptools/build_cmake.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def run(self) -> None:
112112

113113
bdist_wheel = dist.get_command_obj("bdist_wheel")
114114
assert bdist_wheel is not None
115-
limited_api = bdist_wheel.py_limited_api # type: ignore[attr-defined]
115+
limited_api = bdist_wheel.py_limited_api
116116

117117
# TODO: this is a hack due to moving temporary paths for isolation
118118
if build_temp.exists():
@@ -150,7 +150,7 @@ def run(self) -> None:
150150
name=dist.get_name(),
151151
version=Version(dist.get_version()),
152152
defines=defines,
153-
limited_api=limited_api,
153+
limited_api=bool(limited_api),
154154
configure_args=configure_args,
155155
)
156156

0 commit comments

Comments
 (0)