MCPcopy Create free account
hub / github.com/apache/arrow / ArrowSources

Class ArrowSources

dev/archery/archery/utils/source.py:44–236  ·  view source on GitHub ↗

ArrowSources is a companion class representing a directory containing Apache Arrow's sources.

Source from the content-addressed store, hash-verified

42
43
44class ArrowSources:
45 """ ArrowSources is a companion class representing a directory containing
46 Apache Arrow's sources.
47 """
48 # Note that WORKSPACE is a reserved git revision name by this module to
49 # reference the current git workspace. In other words, this indicates to
50 # ArrowSources.at_revision that no cloning/checkout is required.
51 WORKSPACE = "WORKSPACE"
52
53 def __init__(self, path):
54 """ Initialize an ArrowSources
55
56 The caller must ensure that path is valid arrow source directory (can
57 be checked with ArrowSources.valid)
58
59 Parameters
60 ----------
61 path : src
62 """
63 path = Path(path)
64 # validate by checking a specific path in the arrow source tree
65 if not (path / 'cpp' / 'CMakeLists.txt').exists():
66 raise InvalidArrowSource(
67 f"No Arrow C++ sources found in {path}."
68 )
69 self.path = path
70
71 @property
72 def archery(self):
73 """ Returns the archery directory of an Arrow sources. """
74 return self.dev / "archery"
75
76 @property
77 def cpp(self):
78 """ Returns the cpp directory of an Arrow sources. """
79 return self.path / "cpp"
80
81 @property
82 def dev(self):
83 """ Returns the dev directory of an Arrow sources. """
84 return self.path / "dev"
85
86 @property
87 def java(self):
88 """ Returns the java directory of an Arrow sources. """
89 return self.path / "java"
90
91 @property
92 def python(self):
93 """ Returns the python directory of an Arrow sources. """
94 return self.path / "python"
95
96 @property
97 def pyarrow(self):
98 """ Returns the python/pyarrow directory of an Arrow sources. """
99 return self.python / "pyarrow"
100
101 @property

Callers 4

at_revisionMethod · 0.85
findMethod · 0.85
from_rev_or_pathMethod · 0.85
from_rev_or_pathMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected