Skip to content

Commit 5e890d1

Browse files
Joaldmeta-codesync[bot]
authored andcommitted
Enable Python thrift codegen for bookmark_service and mononoke_types_serialization
Summary: Add Python language to bookmark_service_if and mononoke_types_serialization thrift_library targets, and add namespace py3 directives to all thrift files. This enables Python client generation needed by Cogwheel tests. Reviewed By: clara-9 Differential Revision: D99985460 fbshipit-source-id: 9d327882f4802126cc01e1a384a06e0e216fbfcb
1 parent 1765085 commit 5e890d1

24 files changed

+49
-1
lines changed

eden/mononoke/mononoke_types/serialization/BUCK

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ oncall("scm_server_infra")
55
thrift_library(
66
name = "mononoke_types_serialization",
77
languages = [
8-
"rust",
98
"cpp2",
9+
"python",
10+
"rust",
1011
],
12+
py3_namespace = "eden.mononoke.mononoke_types.serialization",
1113
rust_deps = [
1214
"fbsource//third-party/rust:bytes",
1315
"fbsource//third-party/rust:smallvec",

eden/mononoke/mononoke_types/serialization/acl_manifest.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ include "thrift/annotation/thrift.thrift"
2323
@thrift.AllowLegacyMissingUris
2424
package;
2525

26+
namespace py3 eden.mononoke.mononoke_types.serialization
27+
2628
/// Whether a directory itself is restricted
2729
union AclManifestDirectoryRestriction {
2830
/// Directory is not restricted (waypoint to reach restriction roots)

eden/mononoke/mononoke_types/serialization/blame.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ include "thrift/annotation/thrift.thrift"
2323
@thrift.AllowLegacyMissingUris
2424
package;
2525

26+
namespace py3 eden.mononoke.mononoke_types.serialization
27+
2628
@rust.NewType
2729
typedef i32 BlameChangeset
2830
@rust.NewType

eden/mononoke/mononoke_types/serialization/bonsai.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ include "thrift/annotation/thrift.thrift"
2525
@thrift.AllowLegacyMissingUris
2626
package;
2727

28+
namespace py3 eden.mononoke.mononoke_types.serialization
29+
2830
// Bonsai Changeset is the fundamental commit object of Mononoke's internal
2931
// representation.
3032
//

eden/mononoke/mononoke_types/serialization/bssm.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ include "thrift/annotation/thrift.thrift"
2222
@thrift.AllowLegacyMissingUris
2323
package;
2424

25+
namespace py3 eden.mononoke.mononoke_types.serialization
26+
2527
// Basename suffix manifest stores file trees in a way that allows fast filtering
2628
// based on suffix of basenames as well as directory prefix of root.
2729
// See docs/basename_suffix_skeleton_manifest.md for more documentation on this.

eden/mononoke/mononoke_types/serialization/ccsm.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ include "thrift/annotation/thrift.thrift"
2222
@thrift.AllowLegacyMissingUris
2323
package;
2424

25+
namespace py3 eden.mononoke.mononoke_types.serialization
26+
2527
// Case conflict skeleton manifest stores a version of the file tree that's transformed in a way
2628
// that allows quickly finding case conflicts. The transformation works on file paths by adding
2729
// before each path element its lowercase form:

eden/mononoke/mononoke_types/serialization/changeset_info.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ include "thrift/annotation/thrift.thrift"
1414
@thrift.AllowLegacyMissingUris
1515
package;
1616

17+
namespace py3 eden.mononoke.mononoke_types.serialization
18+
1719
// Derived data structure that represents a Bonsai changeset's metadata.
1820
// It contains the same data as Bonsai itself except of the file changes,
1921
// which can be a pretty high number of and take a long time to deserialize.

eden/mononoke/mononoke_types/serialization/content.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ include "thrift/annotation/thrift.thrift"
2323
@thrift.AllowLegacyMissingUris
2424
package;
2525

26+
namespace py3 eden.mononoke.mononoke_types.serialization
27+
2628
@rust.Exhaustive
2729
struct ContentChunkPointer {
2830
1: id.ContentChunkId chunk_id;

eden/mononoke/mononoke_types/serialization/content_manifest.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ include "thrift/annotation/thrift.thrift"
2424
@thrift.AllowLegacyMissingUris
2525
package;
2626

27+
namespace py3 eden.mononoke.mononoke_types.serialization
28+
2729
@rust.Exhaustive
2830
struct ContentManifestFile {
2931
1: id.ContentId content_id;

eden/mononoke/mononoke_types/serialization/data.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
include "thrift/annotation/rust.thrift"
1919

20+
namespace py3 eden.mononoke.mononoke_types.serialization
21+
2022
/// Binary data that may be large, stored in `Bytes`.
2123
@rust.Type{name = "Bytes"}
2224
typedef binary LargeBinary

0 commit comments

Comments
 (0)