-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpyproject.toml
More file actions
304 lines (278 loc) · 11.1 KB
/
pyproject.toml
File metadata and controls
304 lines (278 loc) · 11.1 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
[project]
name = "gigl"
description = "GIgantic Graph Learning Library"
readme = "README.md"
version = "0.2.0"
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
]
requires-python = "==3.11.*" # Limited by tfx-bsl not having wheels available for newer python versions.
dependencies = [
"argo-workflows",
"chardet",
# gigl-core hosts all C++ / CUDA / pybind11 extensions. Separate wheel per torch
# variant (cpu/cu128). Version must match gigl exactly.
"gigl-core==0.2.0",
"google-cloud-aiplatform",
"google-cloud-dataproc",
"google-cloud-logging",
"google-cloud-pipeline-components",
"google-cloud-storage",
# ipython and ipykernel are required for us to run jupyter notebooks as a part of our test suite.
# See https://stackoverflow.com/questions/69759351/error-jupyter-client-kernelspec-nosuchkernel-no-such-kernel-named-python3-occu
"ipykernel",
"ipython",
"kfp>=2.0.0",
"matplotlib",
"mmh3",
"msgpack",
"nbconvert",
"nbformat",
"numpy",
"omegaconf>=2.3.0,<3.0.0",
"pandas",
"pip~=25.3", # Used by KFP Python components - need to install pip as a package
"protobuf",
"python-dotenv",
"pyyaml",
"scikit-learn",
# When updating to a new tensorflow version, please ensure that the version changes align with
# `transform` deps listed below. Package versions for `apache-beam`, `tensorflow-transform`, etc
"tensorflow~=2.16",
]
[project.optional-dependencies]
transform = [
# Apache Beam version has to match with what is specified in `containers/Dockerfile.dataflow.base`
"apache-beam[gcp]==2.56.0",
"pyarrow==10.0.1",
# Tensorflow transform packages.
# There is no official MAC support for these packages - thus we ignore them on darwin machines.
# These packages are also required to be in sync.
# See the following for the compatibility matrix: https://pypi.org/project/tensorflow-transform/
"tensorflow-data-validation==1.16.1 ; sys_platform != 'darwin'",
"tensorflow-metadata==1.16.1 ; sys_platform != 'darwin'",
"tensorflow-transform==1.16.0 ; sys_platform != 'darwin'",
# Oct 28, 2025 - Latest ver tfx-bsl==1.17.1 requires latest version of Linux distros using glibc 2.39+
# i.e. Ubuntu 24.04. Currently, not compatible with our docker images.
"tfx-bsl==1.16.1 ; sys_platform != 'darwin'",
]
pyg27-torch28-cpu = [
"fbgemm-gpu~=1.3.0; sys_platform != 'darwin'", # Compatiblity table: https://docs.pytorch.org/FBGEMM/general/Releases.html#fbgemm-releases-compatibility
"pyg_lib; sys_platform != 'darwin'",
"torch==2.8",
# Oct 24, 25 - 2.7 is latest version and torch ver support is inconsistant accross minor version changes
"torch_cluster; sys_platform != 'darwin'",
"torch_geometric==2.7",
"torch_scatter; sys_platform != 'darwin'",
"torch_sparse; sys_platform != 'darwin'",
"torch_spline_conv; sys_platform != 'darwin'",
"torchrec ; sys_platform != 'darwin'",
]
pyg27-torch28-cu128 = [
"fbgemm-gpu~=1.3.0; sys_platform != 'darwin'",
"pyg_lib; sys_platform != 'darwin'",
"torch==2.8 ; sys_platform != 'darwin'",
"torch_cluster; sys_platform != 'darwin'",
"torch_geometric==2.7 ; sys_platform != 'darwin'",
"torch_scatter; sys_platform != 'darwin'",
"torch_sparse; sys_platform != 'darwin'",
"torch_spline_conv; sys_platform != 'darwin'",
"torchrec ; sys_platform != 'darwin'",
]
experimental = [
"hydra-core==1.3.2",
]
# Declares what deps are conflicting so they are not resolved together.
# In the case below, we cannot have both pyg27-torch28-cpu and pyg27-torch28-cu128
# installed at the same time (one is cuda and one is cpu and pull from seperate indexes).
# Thus, they are treated as conflicting and `uv.lock` will be generated in a way that
# transitive dependencies between them are resolved separately.
[tool.uv]
conflicts = [
[{ extra = "pyg27-torch28-cpu" },{ extra = "pyg27-torch28-cu128" }],
]
required-environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64'",
"sys_platform == 'darwin' and platform_machine == 'arm64'",
]
# gigl-core must build against torch, which is not on PyPI and cannot be installed
# into an isolated build environment. Disabling isolation lets cmake find torch from
# the ambient venv (installed by make install_dev_deps / base Docker images).
no-build-isolation-package = ["gigl-core"]
[dependency-groups]
# scikit-build-core is gigl-core's PEP 517 build backend. With no-build-isolation-package
# set, uv does not install [build-system].requires automatically, so it must be present
# in the ambient environment before any gigl-core build (uv sync, uv build, Dockerfiles).
gigl-core-build-backend = ["scikit-build-core>=0.10"]
dev = [
{include-group = "gigl-core-build-backend"},
{include-group = "docs"},
{include-group = "lint"},
{include-group = "test"},
{include-group = "typing-stubs"},
"pre-commit==3.3.2",
]
docs = [
"astroid==3.3.11", # Newer versions of astroid are not compatible with sphinx==7.4.7
"mistune>=2.0.3",
"myst-parser==2.0.0",
"myst_nb==1.2.0",
"nbconvert>=7.16.2",
"nbsphinx==0.9.3",
"sphinx==7.4.7",
"sphinx-autoapi==3.6.0",
"sphinx-autodoc-typehints==2.3.0",
"sphinx-copybutton==0.5.2",
"sphinx-design==0.6.0",
"sphinx-hoverxref==1.3.0",
"sphinx-rtd-theme==2.0.0",
"pydata-sphinx-theme==0.16.1",
"sphinx-tabs==3.4.5",
]
typing-stubs = [
"pandas-stubs==2.2.2.240807",
"types-psutil==7.0.0.20250401",
"types-PyYAML~=6.0.12",
"types-requests==2.31.0.6",
"types-tqdm==4.67.0.20250513",
]
test = [
"parameterized==0.9.0",
]
lint = [
"ruff==0.15.10",
"mdformat==0.7.22",
"mdformat_tables==1.0.0",
"mypy==1.8.0",
"mypy-extensions",
"mypy-protobuf==3.3.0",
]
# =============================== PyTorch Indexes =============================
[[tool.uv.index]]
name = "torch-cpu"
url = "https://download.pytorch.org/whl/cpu"
# Setting this to true prevents packages from being installed from this index
# unless explicitly pinned to it in [tool.uv.sources]
explicit = true
[[tool.uv.index]]
name = "torch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
# =============================== PyG Indexes ==================================
[[tool.uv.index]]
name = "pyg-torch28-cpu"
url = "https://data.pyg.org/whl/torch-2.8.0+cpu.html"
explicit = true
# By default, [[tool.uv.index]] entries are assumed to be PyPI-style registries
# that implement the PEP 503. However, pyg is hosted in a "flat" index, which is
# just an HTML page that contain flat lists of wheels and source distributions.
format = "flat"
[[tool.uv.index]]
name = "pyg-torch28-cu128"
url = "https://data.pyg.org/whl/torch-2.8.0+cu128.html"
explicit = true
format = "flat"
# =============================== Google Artifact Registry Index ========================
# Two separate indexes — one per torch variant — so pip always fetches the correct wheel.
# If both variants lived in the same index, pip would pick between them arbitrarily since
# both wheels share the same platform tag (linux_x86_64). Separate indexes remove the
# ambiguity and are essential once any extension contains CUDA kernels.
#
# The CPU registry reuses the original `gigl` repo for backwards compatibility.
# The CUDA registry is a new `gigl-cu128` repo that must be created in GCP project
# `external-snap-ci-github-gigl` before the release workflow will succeed.
[[tool.uv.index]]
name = "gcp-release-registry-cpu"
url = "https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl/simple/"
publish-url = "https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl"
explicit = true
[[tool.uv.index]]
name = "gcp-release-registry-cu128"
url = "https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl-cu128/simple/"
publish-url = "https://us-central1-python.pkg.dev/external-snap-ci-github-gigl/gigl-cu128"
explicit = true
# ========== Mapping individual packages to their appropriate index =============
[tool.uv.sources]
# ============= PyTorch hosted Package Index Mappings
torch = [
{ extra = "pyg27-torch28-cpu", index = "torch-cpu" },
{ extra = "pyg27-torch28-cu128", index = "torch-cu128" },
]
torchrec = [
{ extra = "pyg27-torch28-cpu", index = "torch-cpu" },
{ extra = "pyg27-torch28-cu128", index = "torch-cu128" },
]
fbgemm-gpu = [
{ extra = "pyg27-torch28-cpu", index = "torch-cpu" },
{ extra = "pyg27-torch28-cu128", index = "torch-cu128" },
]
# ============= PyG hosted Package Index Mappings
# PyG wheels are built for specific versions of torch @ a time. Thus the packages
# are mapped to the appropriate PyG index based on the torch version.
pyg_lib = [
{ extra = "pyg27-torch28-cpu", index = "pyg-torch28-cpu" },
{ extra = "pyg27-torch28-cu128", index = "pyg-torch28-cu128" },
]
torch_scatter = [
{ extra = "pyg27-torch28-cpu", index = "pyg-torch28-cpu" },
{ extra = "pyg27-torch28-cu128", index = "pyg-torch28-cu128" },
]
torch_sparse = [
{ extra = "pyg27-torch28-cpu", index = "pyg-torch28-cpu" },
{ extra = "pyg27-torch28-cu128", index = "pyg-torch28-cu128" },
]
torch_cluster = [
{ extra = "pyg27-torch28-cpu", index = "pyg-torch28-cpu" },
{ extra = "pyg27-torch28-cu128", index = "pyg-torch28-cu128" },
]
torch_spline_conv = [
{ extra = "pyg27-torch28-cpu", index = "pyg-torch28-cpu" },
{ extra = "pyg27-torch28-cu128", index = "pyg-torch28-cu128" },
]
# gigl-core is a local path dependency. In dev, uv resolves it from the adjacent
# gigl-core/ directory and builds the C++ extension via scikit-build-core.
# At release install time, published gigl and gigl-core wheels are resolved
# from the same GCP registry.
gigl-core = { path = "gigl-core" }
# ===================== Build/Project Configurations ===========================
# gigl is a pure-Python package. All C++/CUDA kernels live in the gigl-core
# wheel (see gigl-core/pyproject.toml). Release builds two variants per package:
# cpu and cu128. gigl's build stays fast because no CMake runs here.
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
include = ["gigl*", "snapchat*"]
[tool.setuptools.package-data]
# Include dep_vars.env from the root directory
"gigl" = ["dep_vars.env", "**/*.yaml"]
"gigl.scripts" = ["*.sh"]
[project.urls]
Homepage = "https://github.com/snapchat/gigl"
[project.scripts]
gigl-post-install = "gigl.scripts.post_install:main"
[tool.ruff]
# Skip generated proto files.
exclude = ["*_pb2.py", "*_pb2.pyi"]
[tool.ruff.lint]
# Rules reference: https://docs.astral.sh/ruff/rules/
#
# F401 - Unused imports (pyflakes)
# Detects imported names that are never used in the module.
# Replaces: autoflake --remove-all-unused-imports
# Docs: https://docs.astral.sh/ruff/rules/unused-import/
#
# I - Import sorting (isort)
# Enforces a consistent import order (stdlib → third-party → first-party).
# Replaces: isort
# Docs: https://docs.astral.sh/ruff/rules/#isort-i
select = ["F401", "I"]
[tool.ruff.lint.per-file-ignores]
# __init__.py files re-export symbols for the public API, so unused-import
# warnings (F401) are expected and should be suppressed.
"__init__.py" = ["F401"]
[tool.ruff.lint.isort]
# Docs: https://docs.astral.sh/ruff/settings/#lint_isort_known-first-party
known-first-party = ["gigl", "tests", "snapchat", "scripts"]