Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated API #2425

Merged
merged 6 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update API Gen Code
  • Loading branch information
sampathweb committed Apr 26, 2024
commit 1e5f8261a164321fe801aa81212c2c22b6f28454
2 changes: 1 addition & 1 deletion api_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def export_version_string(api_init_fname):
with open(api_init_fname) as f:
contents = f.read()
with open(api_init_fname, "w") as f:
contents += "from keras_cv.src.version import __version__\n"
contents += "from keras_cv.src.version_utils import __version__\n"
f.write(contents)


Expand Down
10 changes: 5 additions & 5 deletions pip_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def export_version_string(version, is_nightly=False):
f.write(setup_contents)

# Make sure to export the __version__ string
with open(os.path.join(package, "src", "version.py")) as f:
with open(os.path.join(package, "src", "version_utils.py")) as f:
init_contents = f.read()
with open(os.path.join(package, "src", "version.py"), "w") as f:
with open(os.path.join(package, "src", "version_utils.py"), "w") as f:
init_contents = re.sub(
"\n__version__ = .*\n",
f'\n__version__ = "{version}"\n',
Expand All @@ -72,17 +72,17 @@ def copy_source_to_build_directory(root_path):
os.chdir(build_directory)


def build(root_path, is_nightly=False, rc_index=None):
def build(root_path, is_nightly=False):
if os.path.exists(build_directory):
raise ValueError(f"Directory already exists: {build_directory}")

try:
copy_source_to_build_directory(root_path)
print(os.getcwd())

from keras_cv.src.version import __version__ # noqa: E402
from keras_cv.src.version_utils import __version__ # noqa: E402

export_version_string(__version__, is_nightly, rc_index)
export_version_string(__version__, is_nightly)
return build_and_save_output(root_path, __version__)
finally:
# Clean up: remove the build directory (no longer needed)
Expand Down
Loading