Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
168 lines (154 loc) · 6.29 KB
/
Copy pathpyproject.toml
File metadata and controls
168 lines (154 loc) · 6.29 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
[project]
name = "pyscriptc"
version = "0.10.0b1"
description = "Lower a typed subset of Python to LLVM, with CPython as the island."
readme = "README.md"
requires-python = ">=3.11"
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [{ name = "Joaquin Terrasa" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Software Development :: Compilers",
]
dependencies = [
"pyrefly>=1.4.0,<1.5",
]
[project.optional-dependencies]
# Deprecated `--checker mypy` / `--checker pyright` lanes and external
# cross-checking (.agents/docs/spec/external-oracles.md). Not needed for a normal compile.
oracle-mypy = ["mypy>=2.4,<2.5"]
oracle-pyright = ["pyright>=1.1.400"]
# The C toolchain, as a wheel: `uv tool install "pyscriptc[zig]"` gives a host
# with no system zig a working driver in one command. The wheel ships the zig
# binary but only the `python-zig` console script, so pyscriptc installs a
# `zig` PATH shim over `python -m ziglang` (src/pyscriptc/zigshim.py). The
# range is the CI-verified one (packaging/TOOLCHAIN.md).
zig = ["ziglang>=0.16,<0.18"]
[project.urls]
Homepage = "https://github.com/sigilco/pyscriptc"
Repository = "https://github.com/sigilco/pyscriptc"
Issues = "https://github.com/sigilco/pyscriptc/issues"
Reference = "https://github.com/vercel-labs/scriptc"
[project.scripts]
pyscriptc = "pyscriptc.cli:main"
[dependency-groups]
dev = [
"pytest>=8",
"pytest-xdist>=3.8",
"pytest-split>=0.11",
"ruff>=0.14",
"mypy>=2.4",
"orjson>=3.13.0",
"requests>=2.34.2",
"hypothesis>=6.170.9",
# A pure-Python dependency the embed acceptance program bundles
# (issue #660): the bundle stages the installed distribution.
"pathspec>=1.1.1",
# The Arrow acceptance oracle (issue #1209). The wheel coverage is
# 3.14-first, so the dep is marked to the interpreter that can install
# it from a wheel; a floor host (3.11) would otherwise build Arrow from
# source, which no floor job should.
'pyarrow>=26.0.1; python_full_version >= "3.14"',
]
# Release binary build only (packaging/). Not installed by a plain `uv sync`.
packaging = ["nuitka>=4.0", "zstandard>=0.23", "ordered-set>=4.1"]
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
pyscriptc = [
"runtime/*.c",
"runtime/*.h",
"native_packages.json",
"target.json",
"_pyright_stubs/*/__init__.pyi",
"_typeshed/LICENSE",
"_typeshed/stdlib/VERSIONS",
"_typeshed/stdlib/**/*.pyi",
"pbs_licenses/LICENSE.*",
"pbs_licenses/NOTICE",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src", "."]
markers = [
"linux_container: Linux dev container suite (HEAVY=1 docker/run.sh). Shells out to clang or only passes on Linux. CI does not run these.",
"slow: builds the self-compiled pyscriptc and compiles through it; minutes, not seconds. CI does not run these.",
]
[tool.ruff]
target-version = "py311"
line-length = 120
src = ["src", "tests", "benchmarks"]
extend-exclude = [
"benchmarks/compat/top100",
"benchmarks/compat/pyjwt/src/jwt",
"benchmarks/compat2/corpus/src",
"benchmarks/compat2/corpus/tests",
"benchmarks/compat2/corpus/holdout/src",
"benchmarks/compat2/corpus/holdout/tests",
"benchmarks/compat2/corpus/scripts",
"benchmarks/compat2/corpus/holdout/scripts",
"benchmarks/real_scripts/scripts",
"src/pyscriptc/_pyright_stubs",
"src/pyscriptc/_typeshed",
]
[tool.ruff.per-file-target-version]
# The frozen v2 scorer files keep their 3.12+ syntax (tag gates-v2; changes
# need a recorded decision first), so they lint against their own floor
# while the tool host stays 3.11+. The two that also carry unparenthesized
# 3.14 except lists are out of the format check (same list as the
# `ruff and compat2` job in ci.yml), because the py314 formatter would
# un-parenthesize what the py311 lint tolerates only at py314.
"benchmarks/compat2/bundle.py" = "py314"
"benchmarks/compat2/cache.py" = "py314"
"benchmarks/compat2/corpus/spec.py" = "py314"
"benchmarks/compat2/coverage_map.py" = "py314"
"benchmarks/compat2/score.py" = "py314"
# The probe corpus runs against the pinned 3.14 oracle, so it may use
# constructs the oracle knows that a 3.11 host does not (PEP 649 deferred
# annotations in a class body, for example). Lint at the oracle's floor.
"probes/**" = "py314"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
[tool.ruff.lint.per-file-ignores]
# The table generator emits C source with percent formats.
"scripts/gen_case_tables.py" = ["UP031"]
# The erased-annotation probe exercises the PEP 613 TypeAlias spelling the
# subset lowers (issue #413); PEP 695 `type` is a different construct.
"probes/differential/erased_annotations.py" = ["UP040"]
# Self-host spell: the `Dict` container form is deliberate (the lowercase
# `dict[str, Any]` annotation fences PS1106 dynamic-annotation rows on
# every signature; the census lowerer does not resolve PEP 585 spellings).
"src/pyscriptc/mirlower.py" = ["UP006", "UP035"]
"src/pyscriptc/miremit.py" = ["UP006", "UP035"]
# The B11 adapter keeps the same self-host `Dict` spell as the MIR lane.
"src/pyscriptc/emit/_mir_in.py" = ["UP006", "UP035"]
# Same self-host spell for the deps report row builder: the lowercase
# `dict[str, Any]` return/local annotation fences PS1106 (the census
# lowerer does not resolve PEP 585 spellings on a returned dict).
"src/pyscriptc/deps.py" = ["UP006", "UP035"]
"src/pyscriptc/config.py" = ["UP006", "UP035"]
"src/pyscriptc/ffi_manifest.py" = ["UP006", "UP035"]
"src/pyscriptc/embed.py" = ["UP006", "UP035"]
[tool.ruff.lint.isort]
known-first-party = ["pyscriptc"]
[tool.ruff.format]
quote-style = "double"
# The frozen v2 files carry unparenthesized 3.14 except lists; the py314
# formatter would un-parenthesize what the py311 lint only tolerates at
# py314. Same list as the `ruff and compat2` job in ci.yml.
exclude = [
"benchmarks/compat2/bundle.py",
"benchmarks/compat2/corpus/spec.py",
]