Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bazeliskrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BAZELISK_BASE_URL=https://static.aspect.build/aspect
USE_BAZEL_VERSION=aspect/2025.15.20

27 changes: 27 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# =============================================================================
# Common Settings
# =============================================================================
# This makes sure bazel doesn't implicitly create missing __init__.py files.
build --incompatible_default_to_explicit_init_py
build --experimental_isolated_extension_usages

# =============================================================================
# Build Performance
# =============================================================================
build --jobs=auto
build --experimental_remote_merkle_tree_cache
build --experimental_remote_cache_compression
build --experimental_remote_cache_async
build --experimental_guard_against_concurrent_changes
build --experimental_reuse_sandbox_directories

# =============================================================================
# Developer Experience
# =============================================================================
build --show_progress_rate_limit=0.5
build --color=yes
build --terminal_columns=120
build --show_timestamps
build --announce_rc # Show which config files are read
build --heap_dump_on_oom # Dump heap on out-of-memory
test --test_output=all # Show all test output in real time
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.6.1
27 changes: 12 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ __pycache__/
# C extensions
*.so

# CMake
CMakeCache.txt
CMakeFiles
# Bazel
bazel-*
MODULE.bazel.lock

# node
node_modules

# OS X
.DS_Store

# Pycharm
.idea/

# Distribution / packaging
.Python
Expand Down Expand Up @@ -107,15 +116,3 @@ ENV/

# IDE settings
.vscode/
.idea/

# Output of tests
dlup/preprocessors/tests/data/test_output

# OS files
.DS_Store


tools/logs
config/machine_settings/*
!config/machine_settings/example.yaml
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hoist=false
62 changes: 62 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Same as Black.
line-length = 120
indent-width = 4

target-version = "py311"

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
ignore = []

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
56 changes: 56 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_multirun//:defs.bzl", "multirun")
load("@rules_uv//uv:pip.bzl", "pip_compile")

package(default_visibility = ["//visibility:public"])

npm_link_all_packages(name = "node_modules")

exports_files(
[
".ruff.toml",
],
visibility = ["//visibility:public"],
)

pip_compile(
name = "generate_requirements_linux_txt",
python_platform = "x86_64-unknown-linux-gnu",
requirements_in = "requirements.in",
requirements_txt = "requirements_linux.txt",
)

pip_compile(
name = "generate_requirements_darwin_txt",
python_platform = "aarch64-apple-darwin",
requirements_in = "requirements.in",
requirements_txt = "requirements_darwin.txt",
)

multirun(
name = "generate_requirements_lock",
commands = [
":generate_requirements_linux_txt",
":generate_requirements_darwin_txt",
],
# Running in a single threaded mode allows consecutive `uv` invocations to benefit
# from the `uv` cache from the first run.
jobs = 1,
)

js_library(
name = "prettierrc",
srcs = ["prettier.config.cjs"],
visibility = ["//tools/format:__pkg__"],
deps = [
":node_modules/@prettier/plugin-xml",
":node_modules/prettier-plugin-gherkin",
":node_modules/prettier-plugin-sql",
],
)

alias(
name = "format",
actual = "//tools/format",
)
File renamed without changes.
64 changes: 64 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""
This module defines the dependencies and configurations for DIRECT.
"""

module(name = "stapler")

bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "bazel_features", version = "1.23.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "gazelle", version = "0.41.0")
bazel_dep(name = "cython", version = "3.0.11-1")
bazel_dep(name = "rules_multirun", version = "0.10.0")
bazel_dep(name = "rules_python", version = "1.4.0-rc0")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "buildifier_prebuilt", version = "8.0.1")
bazel_dep(name = "aspect_rules_lint", version = "1.2.0")
bazel_dep(name = "aspect_rules_js", version = "2.0.0")
bazel_dep(name = "aspect_rules_py", version = "1.3.2")

# We are using this commit because it's not yet released
# https://github.com/aspect-build/rules_py/commit/6ad466797d8e595016c5a8bec7186268b9ea7f6f
# This allows sharding of tests and easier setup
archive_override(
module_name = "aspect_rules_py",
integrity = "sha256-p7Fo6yMoh96SurOcGt1uLt95vRf/RUeuPvr/1oA6jzw=",
strip_prefix = "rules_py-1296c6b88156594543b7f41ceb331bdc9a053055",
urls = ["https://github.com/aspect-build/rules_py/archive/1296c6b88156594543b7f41ceb331bdc9a053055.zip"],
)

bazel_dep(name = "rules_uv", version = "0.65.0", dev_dependency = True)

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.11",
)

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
enable_implicit_namespace_pkgs = True,
hub_name = "pip",
python_version = "3.11",
requirements_darwin = ":requirements_darwin.txt",
requirements_lock = ":requirements_linux.txt",
)
use_repo(pip, "pip")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
npmrc = ".npmrc",
pnpm_lock = "pnpm-lock.yaml",
public_hoist_packages = {
"typescript-eslint": [""],
},
)
use_repo(npm, "npm")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")

# Allows developers to use the matching pnpm version, for example:
# bazelisk run @pnpm -- --dir /home/runner/work/rules_js/rules_js install
use_repo(pnpm, "pnpm")
Loading