Rename module to opensearchpy
To avoid conflict with an existing package by name 'opensearch' being present Signed-off-by: Rushi Agrawal <[email protected]>
This commit is contained in:
+10
-10
@@ -145,7 +145,7 @@ class Module:
|
||||
def filepath(self):
|
||||
return (
|
||||
CODE_ROOT
|
||||
/ f"opensearch/_async/client/{self.namespace}.py{'i' if self.is_pyi else ''}"
|
||||
/ f"opensearchpy/_async/client/{self.namespace}.py{'i' if self.is_pyi else ''}"
|
||||
)
|
||||
|
||||
|
||||
@@ -185,8 +185,8 @@ class API:
|
||||
# Try setting doc refs like 'current' and 'master' to our branches ref.
|
||||
if BRANCH_NAME is not None:
|
||||
revised_url = re.sub(
|
||||
"/opensearch/reference/[^/]+/",
|
||||
f"/opensearch/reference/{BRANCH_NAME}/",
|
||||
"/opensearchpy/reference/[^/]+/",
|
||||
f"/opensearchpy/reference/{BRANCH_NAME}/",
|
||||
self.doc_url,
|
||||
)
|
||||
if is_valid_url(revised_url):
|
||||
@@ -339,9 +339,9 @@ def download_artifact(version):
|
||||
resp = http.request(
|
||||
"GET", f"https://artifacts-api.elastic.co/v1/versions/{version}"
|
||||
)
|
||||
packages = json.loads(resp.data)["version"]["builds"][0]["projects"]["opensearch"][
|
||||
"packages"
|
||||
]
|
||||
packages = json.loads(resp.data)["version"]["builds"][0]["projects"][
|
||||
"opensearchpy"
|
||||
]["packages"]
|
||||
for package in packages:
|
||||
if re.match(r"^rest-resources-zip-.*\.zip$", package):
|
||||
zip_url = packages[package]["url"]
|
||||
@@ -411,14 +411,14 @@ def dump_modules(modules):
|
||||
}
|
||||
rules = [
|
||||
unasync.Rule(
|
||||
fromdir="/opensearch/_async/client/",
|
||||
todir="/opensearch/client/",
|
||||
fromdir="/opensearchpy/_async/client/",
|
||||
todir="/opensearchpy/client/",
|
||||
additional_replacements=additional_replacements,
|
||||
),
|
||||
]
|
||||
|
||||
filepaths = []
|
||||
for root, _, filenames in os.walk(CODE_ROOT / "opensearch/_async"):
|
||||
for root, _, filenames in os.walk(CODE_ROOT / "opensearchpy/_async"):
|
||||
for filename in filenames:
|
||||
if (
|
||||
filename.rpartition(".")[-1]
|
||||
@@ -431,7 +431,7 @@ def dump_modules(modules):
|
||||
filepaths.append(os.path.join(root, filename))
|
||||
|
||||
unasync.unasync_files(filepaths, rules)
|
||||
blacken(CODE_ROOT / "opensearch")
|
||||
blacken(CODE_ROOT / "opensearchpy")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user