-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
129 lines (110 loc) · 3.64 KB
/
Copy pathpyproject.toml
File metadata and controls
129 lines (110 loc) · 3.64 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
[build-system]
requires = [
"scikit-build-core>=0.10",
"pybind11",
"setuptools_scm[toml]>=6.2"
]
build-backend = "scikit_build_core.build"
[project]
name = "libcachesim"
version = "0.3.5"
description="Python bindings for libCacheSim"
readme = "README.md"
requires-python = ">=3.11"
keywords = ["performance", "cache", "simulator"]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"numpy>=1.20.0",
"boto3", # For S3
"pybind11>=2.10.0",
"pytest>=8.4.1",
]
[project.optional-dependencies]
test = ["pytest"]
dev = ["pytest", "pre-commit", "ruff>=0.7.0", "mypy>=1.0.0"]
# ============================================================
# pytest
# ============================================================
[tool.pytest.ini_options]
minversion = "8.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config", "-m", "not optional"]
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
"error",
"ignore::pytest.PytestCacheWarning",
]
testpaths = ["tests"]
markers = [
"optional: mark test as optional",
]
python_files = ["test.py", "test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# ============================================================
# scikit-build
# ============================================================
[tool.scikit-build]
build-dir = "build"
[tool.scikit-build.cmake]
build-type = "Release"
args = ["-G", "Ninja"]
define = { CMAKE_OSX_DEPLOYMENT_TARGET = "15.0" }
version = ">=3.15"
source-dir = "."
[tool.scikit-build.install]
strip = false
[tool.cibuildwheel]
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_34_x86_64"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_34_aarch64"
build = ["cp311-*", "cp312-*", "cp313-*", "cp314-*"]
skip = ["*-win32", "*-manylinux_i686", "*-musllinux*", "pp*"]
# Set the environment variable for the wheel build step.
# NOTE(haocheng): we enable all the optional features for the wheel build.
# And MACOSX_DEPLOYMENT_TARGET should be kept in sync with [tool.scikit-build.cmake].define.CMAKE_OSX_DEPLOYMENT_TARGET
environment = { LCS_BUILD_DIR = "{project}/src/libCacheSim/build", MACOSX_DEPLOYMENT_TARGET = "15.0", CMAKE_ARGS = "-DENABLE_3L_CACHE=ON -DENABLE_GLCACHE=ON -DENABLE_LRB=ON" }
# Test that the wheel can be imported
test-command = "python -c 'import libcachesim; print(\"Import successful\")'; cp -r {project}/tests .; python -m pytest tests/ -v -m 'not optional'; python -m pytest tests/ -v -m 'optional'"
[tool.cibuildwheel.linux]
before-all = "yum install -y yum-utils && yum-config-manager --set-enabled crb && yum install -y git && git submodule update --init --recursive && bash scripts/install_deps.sh"
before-build = "pip install pybind11 && rm -rf src/libCacheSim/build"
[tool.cibuildwheel.macos]
before-all = "brew install git && git submodule update --init --recursive && bash scripts/install_deps.sh"
before-build = "pip install pybind11 && rm -rf src/libCacheSim/build"
[tool.ruff]
# Allow lines to be as long as 120.
line-length = 120
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
# "I",
# flake8-logging-format
"G",
]
ignore = [
# star imports
"F405", "F403",
# lambda expression assignment
"E731",
# Loop control variable not used within loop body
"B007",
# f-string format
"UP032",
]