-
Notifications
You must be signed in to change notification settings - Fork 493
Expand file tree
/
Copy pathsetup.py
More file actions
41 lines (35 loc) · 1.63 KB
/
Copy pathsetup.py
File metadata and controls
41 lines (35 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""Build-time package configuration for flag_gems.
This shim exists only to ship the operator test and benchmark suites inside the
wheel under collision-safe, importable names — without moving them on disk:
tests/ -> flaggems_tests
benchmark/ -> flaggems_benchmark
All project metadata (name, version, dependencies, …) lives in ``pyproject.toml``
under ``[project]``; this file intentionally sets *only* ``packages`` and
``package_dir`` (fields that PEP 621 does not own), so there is no metadata
conflict. It is consumed by the setuptools build backend (PEP 517); the legacy
``python setup.py install`` path is never used by pip/uv.
Note: on ``master`` the declared backend is scikit-build-core, which ignores this
file. The released wheel is built by ``.github/workflows/release.yaml`` after it
patches the backend to ``setuptools.build_meta`` — that build honors this shim.
"""
from setuptools import find_packages, setup
setup(
package_dir={
"": "src",
"flaggems_tests": "tests",
"flaggems_benchmark": "benchmark",
},
# flaggems_setup is a top-level module (the flaggems-setup console script),
# kept out of the flag_gems package so its entry point does not import
# torch/triton — it runs before those are installed. package_dir[""]="src"
# means it is found at src/flaggems_setup.py.
py_modules=["flaggems_setup"],
packages=(
find_packages("src")
+ ["flaggems_tests", *(f"flaggems_tests.{p}" for p in find_packages("tests"))]
+ [
"flaggems_benchmark",
*(f"flaggems_benchmark.{p}" for p in find_packages("benchmark")),
]
),
)