lightning/.github/prepare-nightly_pkg-name.py

13 lines
388 B
Python
Raw Normal View History

2020-09-30 12:37:52 +00:00
import os
import re
PATH_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PATH_SETUP = os.path.join(PATH_ROOT, 'setup.py')
print(f"rename package '{PATH_SETUP}'")
with open(PATH_SETUP, 'r') as fp:
setup = fp.read()
setup = re.sub(r'name=[\'"]pytorch-lightning[\'"]', 'name="pytorch-lightning-nightly"', setup)
with open(PATH_SETUP, 'w') as fp:
fp.write(setup)