Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
FastFold
Commits
edcb2f85
You need to sign in or sign up before continuing.
Commit
edcb2f85
authored
Nov 17, 2022
by
zhuww
Browse files
add version.py
parent
76ee6412
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
setup.py
setup.py
+41
-1
version.py
version.py
+1
-0
No files found.
setup.py
View file @
edcb2f85
...
@@ -5,6 +5,11 @@ import torch
...
@@ -5,6 +5,11 @@ import torch
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
,
ROCM_HOME
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
,
ROCM_HOME
from
typing
import
Optional
,
Union
import
subprocess
from
pathlib
import
Path
# ninja build does not work unless include_dirs are abs path
# ninja build does not work unless include_dirs are abs path
this_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
this_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
...
@@ -92,9 +97,44 @@ else:
...
@@ -92,9 +97,44 @@ else:
cuda_ext_helper
(
'fastfold_softmax_cuda'
,
[
'softmax_cuda.cpp'
,
'softmax_cuda_kernel.cu'
],
cuda_ext_helper
(
'fastfold_softmax_cuda'
,
[
'softmax_cuda.cpp'
,
'softmax_cuda_kernel.cu'
],
extra_cuda_flags
+
cc_flag
))
extra_cuda_flags
+
cc_flag
))
def
get_sha
(
pytorch_root
:
Union
[
str
,
Path
])
->
str
:
try
:
return
subprocess
.
check_output
([
'git'
,
'rev-parse'
,
'HEAD'
],
cwd
=
pytorch_root
).
decode
(
'ascii'
).
strip
()
except
Exception
:
return
'Unknown'
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
add_version_path
=
"jax/version.py"
if
sha
!=
'Unknown'
:
if
sha
is
None
:
sha_path
=
os
.
getenv
(
'FASTFOLD_DOWNLOAD_PATH'
,
""
)
sha
=
get_sha
(
sha_path
)
version
=
'git'
+
sha
[:
7
]
if
os
.
getenv
(
'FASTFOLD_BUILD_VERSION'
):
version_dtk
=
os
.
getenv
(
'FASTFOLD_BUILD_VERSION'
,
""
)
version
+=
"."
+
version_dtk
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
file
.
write
(
"__version__='0.2.21'+'+{}'
\n
"
.
format
(
version
))
file
.
write
(
"_minimum_jaxlib_version='0.1.69'
\n
"
)
file
.
close
()
def
get_version
():
get_version_add
()
version_file
=
'version.py'
with
open
(
version_file
,
encoding
=
'utf-8'
)
as
f
:
exec
(
compile
(
f
.
read
(),
version_file
,
'exec'
))
return
locals
()[
'__version__'
]
setup
(
setup
(
name
=
'fastfold'
,
name
=
'fastfold'
,
version
=
'0.2.0'
,
#version='0.2.0',
version
=
get_version
(),
packages
=
find_packages
(
exclude
=
(
packages
=
find_packages
(
exclude
=
(
'assets'
,
'assets'
,
'benchmark'
,
'benchmark'
,
...
...
version.py
0 → 100644
View file @
edcb2f85
__version__
=
"0.2.0"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment