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
gaoqiong
flash-attention
Commits
31f78a98
Commit
31f78a98
authored
May 19, 2023
by
Max H. Gerlach
Browse files
Allow adding an optional local version to the package version
parent
40a25c8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
flash_attn/__init__.py
flash_attn/__init__.py
+1
-0
setup.py
setup.py
+13
-1
No files found.
flash_attn/__init__.py
View file @
31f78a98
__version__
=
"1.0.5"
setup.py
View file @
31f78a98
...
...
@@ -2,6 +2,8 @@
import
sys
import
warnings
import
os
import
re
import
ast
from
pathlib
import
Path
from
packaging.version
import
parse
,
Version
...
...
@@ -160,9 +162,19 @@ ext_modules.append(
)
)
def
get_package_version
():
with
open
(
Path
(
this_dir
)
/
"flash_attn"
/
"__init__.py"
,
"r"
)
as
f
:
version_match
=
re
.
search
(
r
"^__version__\s*=\s*(.*)$"
,
f
.
read
(),
re
.
MULTILINE
)
public_version
=
ast
.
literal_eval
(
version_match
.
group
(
1
))
local_version
=
os
.
environ
.
get
(
"FLASH_ATTN_LOCAL_VERSION"
)
if
local_version
:
return
f
"
{
public_version
}
+
{
local_version
}
"
else
:
return
str
(
public_version
)
setup
(
name
=
"flash_attn"
,
version
=
"1.0.5"
,
version
=
get_package_version
()
,
packages
=
find_packages
(
exclude
=
(
"build"
,
"csrc"
,
"include"
,
"tests"
,
"dist"
,
"docs"
,
"benchmarks"
,
"flash_attn.egg-info"
,)
),
...
...
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