-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
3,479 additions
and
1,249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from datetime import datetime | ||
|
||
|
||
def open_setup_file(): | ||
with open("setup.py", "r") as f: | ||
file_lines = f.readlines() | ||
return file_lines | ||
|
||
|
||
def replace_nightly_package_info(file_lines): | ||
version = datetime.today().strftime("%Y.%m.%d") | ||
package_name = "colossalai-nightly" | ||
|
||
for idx, line in enumerate(file_lines): | ||
if "version = get_version()" in line: | ||
file_lines[idx] = f'version = "{version}"\n' | ||
if 'package_name = "colossalai"' in line: | ||
file_lines[idx] = f'package_name = "{package_name}"\n' | ||
return file_lines | ||
|
||
|
||
def write_setup_file(file_lines): | ||
with open("setup.py", "w") as f: | ||
f.writelines(file_lines) | ||
|
||
|
||
def main(): | ||
file_lines = open_setup_file() | ||
file_lines = replace_nightly_package_info(file_lines) | ||
write_setup_file(file_lines) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.