Skip to content
Merged
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
8 changes: 8 additions & 0 deletions bazel-registry/modules/thrift/0.22.0.envoy/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module(
name = "thrift",
version = "0.22.0.envoy",
compatibility_level = 1,
)

bazel_dep(name = "aspect_bazel_lib", version = "2.7.0")
bazel_dep(name = "rules_python", version = "1.0.0")
18 changes: 18 additions & 0 deletions bazel-registry/modules/thrift/0.22.0.envoy/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@rules_python//python:defs.bzl", "py_library")

licenses(["notice"]) # Apache 2

copy_to_directory(
name = "thrift_pkg",
srcs = glob(["src/**/*.py"]),
out = "thrift",
root_paths = ["src"],
)

py_library(
name = "thrift",
srcs = [":thrift_pkg"],
imports = ["."],
visibility = ["//visibility:public"],
)
51 changes: 51 additions & 0 deletions bazel-registry/modules/thrift/0.22.0.envoy/patches/thrift.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 000000000..638dd9c54
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
diff --git a/setup.py b/setup.py
index 2a170a411..0f7cf0a5b 100644
--- a/setup.py
+++ b/setup.py
@@ -20,13 +20,10 @@
#

import sys
-try:
- from setuptools import setup, Extension
-except Exception:
- from distutils.core import setup, Extension

-from distutils.command.build_ext import build_ext
-from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError
+from setuptools import Extension, setup
+from setuptools.command.build_ext import build_ext
+from setuptools.errors import CompileError, ExecError, PlatformError

# Fix to build sdist under vagrant
import os
@@ -39,9 +36,9 @@ if 'vagrant' in str(os.environ):
include_dirs = ['src']
if sys.platform == 'win32':
include_dirs.append('compat/win32')
- ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError, IOError)
+ ext_errors = (CompileError, ExecError, PlatformError, IOError)
else:
- ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
+ ext_errors = (CompileError, ExecError, PlatformError)


class BuildFailed(Exception):
@@ -52,7 +49,7 @@ class ve_build_ext(build_ext):
def run(self):
try:
build_ext.run(self)
- except DistutilsPlatformError:
+ except PlatformError:
raise BuildFailed()

def build_extension(self, ext):
16 changes: 16 additions & 0 deletions bazel-registry/modules/thrift/0.22.0.envoy/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
matrix:
platform:
- debian11
- ubuntu2004
- ubuntu2204
- ubuntu2404
bazel:
- 7.x
- 8.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@thrift//:thrift'
12 changes: 12 additions & 0 deletions bazel-registry/modules/thrift/0.22.0.envoy/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"url": "https://github.com/apache/thrift/archive/refs/tags/v0.22.0.tar.gz",
"integrity": "sha256-xGScWHndVsiPHnocA+D7/MOyoocvuBYWv/ulqooiWjc=",
"strip_prefix": "thrift-0.22.0/lib/py",
"overlay": {
"BUILD.bazel": "sha256-PFpIBCfkbEWzgyn+7M3fmwTnhSdute2qWsZSgYQq0kg="
},
"patch_strip": 1,
"patches": {
"thrift.patch": "sha256-rzAy2/J27BsoBv0OJVxmU2LYYJifT5p0/i8XR19iId0="
}
}
11 changes: 11 additions & 0 deletions bazel-registry/modules/thrift/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"homepage": "https://github.com/apache/thrift",
"maintainers": [],
"repository": [
"github:apache/thrift"
],
"versions": [
"0.22.0.envoy"
],
"yanked_versions": {}
}