Commit 52c0a2cc authored by zhuwenwen's avatar zhuwenwen
Browse files

modify version

parent 1f6d6678
Pipeline #239 failed with stages
in 0 seconds
...@@ -113,19 +113,19 @@ else: ...@@ -113,19 +113,19 @@ else:
extra_cuda_flags + cc_flag)) extra_cuda_flags + cc_flag))
def get_sha(pytorch_root: Union[str, Path]) -> str: def get_sha(root: Union[str, Path]) -> str:
try: try:
return subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=pytorch_root).decode('ascii').strip() return subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=root).decode('ascii').strip()
except Exception: except Exception:
return 'Unknown' return 'Unknown'
def get_version_add(sha: Optional[str] = None) -> str: def get_version_add(sha: Optional[str] = None) -> str:
fastfold_root = os.path.dirname(os.path.abspath(__file__))
add_version_path = "version.py" add_version_path = "version.py"
if sha != 'Unknown': if sha != 'Unknown':
if sha is None: if sha is None:
sha_path = os.getenv('FASTFOLD_DOWNLOAD_PATH', "") sha = get_sha(fastfold_root)
sha = get_sha(sha_path)
version = 'git' + sha[:7] version = 'git' + sha[:7]
if os.getenv('FASTFOLD_BUILD_VERSION'): if os.getenv('FASTFOLD_BUILD_VERSION'):
...@@ -158,5 +158,5 @@ setup( ...@@ -158,5 +158,5 @@ setup(
ext_modules=ext_modules, ext_modules=ext_modules,
package_data={'fastfold': ['model/fastnn/kernel/cuda_native/csrc/*', 'common/stereo_chemical_props.txt']}, package_data={'fastfold': ['model/fastnn/kernel/cuda_native/csrc/*', 'common/stereo_chemical_props.txt']},
cmdclass={'build_ext': BuildExtension} if ext_modules else {}, cmdclass={'build_ext': BuildExtension} if ext_modules else {},
install_requires=['einops', 'colossalai'], install_requires=['einops'],
) )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment