Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
111 lines (93 loc) · 4.01 KB
/
Copy pathpyproject.toml
File metadata and controls
111 lines (93 loc) · 4.01 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
[project]
name = "torchcodec"
description = "A video decoder for PyTorch"
readme = "README.md"
requires-python = ">=3.11"
license-files = ["LICENSE"]
authors = [
{ name = "PyTorch Team", email = "packages@pytorch.org" },
]
dynamic = ["version"]
[project.urls]
GitHub = "https://github.com/pytorch/torchcodec"
Documentation = "https://pytorch.org/torchcodec/stable/index.html"
[build-system]
requires = ["scikit-build-core>=0.10"]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
minimum-version = "build-system.requires"
build-dir = "build/{wheel_tag}"
wheel.packages = ["src/torchcodec"]
# Tag wheels as py3-none-<platform>: We only need to build one wheel per `arch x
# accelerator` configuration, on the minimum Python version we support, and that
# wheel works on other Python versions (free-threaded included).
wheel.py-api = "py3"
# Required to use our own dynamic-metadata plugin (packaging/torchcodec_version.py)
# for the version field below.
experimental = true
# Do NOT strip symbols from the built .so files. scikit-build-core strips by
# default, but packaging/post_build_script.sh inspects the .so symbol table
# (objdump --syms | grep GLIBCXX) to enforce manylinux GLIBCXX compatibility;
# stripping leaves that check with no symbols to read. This also matches the
# behavior of the previous setuptools build, which did not strip.
install.strip = false
# Restores the version-handling logic that used to live in setup.py: honor the
# BUILD_VERSION env var (set by test-infra release/nightly jobs), and otherwise
# append the short git sha to the contents of version.txt for dev builds. See
# packaging/torchcodec_version.py.
[tool.scikit-build.metadata.version]
provider = "torchcodec_version"
provider-path = "packaging" # gets added to sys.path
[[tool.scikit-build.generate]]
path = "torchcodec/version.py"
template = "__version__ = '${version}'"
location = "install"
[[tool.scikit-build.generate]]
path = "src/torchcodec/version.py"
template = "__version__ = '${version}'"
location = "source"
[tool.scikit-build.cmake.define]
ENABLE_CUDA = {env = "ENABLE_CUDA", default = ""}
TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR = {env = "TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR", default = "OFF"}
TORCHCODEC_DISABLE_HOMEBREW_RPATH = {env = "TORCHCODEC_DISABLE_HOMEBREW_RPATH", default = "OFF"}
# Image decoder build toggles. By default all image decoders are built and
# *required*: if a codec's lib can't be found/fetched the build fails loudly.
# flags default to "AUTO", meaning they inherit from TORCHCODEC_BUILD_IMAGE.
TORCHCODEC_BUILD_IMAGE = {env = "TORCHCODEC_BUILD_IMAGE", default = "ON"}
TORCHCODEC_BUILD_JPEG = {env = "TORCHCODEC_BUILD_JPEG", default = "AUTO"}
TORCHCODEC_BUILD_PNG = {env = "TORCHCODEC_BUILD_PNG", default = "AUTO"}
TORCHCODEC_BUILD_WEBP = {env = "TORCHCODEC_BUILD_WEBP", default = "AUTO"}
TORCHCODEC_BUILD_AVIF = {env = "TORCHCODEC_BUILD_AVIF", default = "AUTO"}
TORCHCODEC_BUILD_GIF = {env = "TORCHCODEC_BUILD_GIF", default = "AUTO"}
TORCHCODEC_BUILD_HEIC = {env = "TORCHCODEC_BUILD_HEIC", default = "AUTO"}
TORCHCODEC_BUILD_NVJPEG = {env = "TORCHCODEC_BUILD_NVJPEG", default = "AUTO"}
[project.optional-dependencies]
dev = [
"numpy",
"pytest",
"pillow",
]
[tool.usort]
# Needed for compatibility with internal linter
first_party_detection = false
[tool.black]
target-version = ["py310"]
[tool.ufmt]
excludes = [
"examples",
]
[tool.pytest.ini_options]
markers = [
# defines a 'slow' mark to mark slow tests with `@pytest.mark.slow`
"slow: mark test as slow"
]
# Tells pytest not to run tests within this directory by default.
# These tests can still be run by manually specifying the path.
norecursedirs = ["third-party-interface"]
# We don't want to run the slow tests by default. These options are ignored in
# the CI, where we definitely want the 'slow' tests to run.
addopts = "-v -m 'not slow'"
# Tells pytest to keep around temporary paths (via tmp_path fixture) for
# *failed tests* only. Otherwise, the /tmp folder can grow too large.
tmp_path_retention_policy = "failed"
testpaths = ["test"]