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
diffusers
Commits
7fae23b4
Commit
7fae23b4
authored
Aug 16, 2024
by
lijian6
Browse files
Modify setup.py for new whl name
Signed-off-by:
lijian
<
lijian6@sugon.com
>
parent
03470cd3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
DIFFUSERS_VERSION_NUMBER
DIFFUSERS_VERSION_NUMBER
+1
-1
setup.py
setup.py
+25
-25
No files found.
DIFFUSERS_VERSION_NUMBER
View file @
7fae23b4
__dcu_version__ = '0.29.0+das
1.2.git02afa54.abi0
.dtk2404'
__dcu_version__ = '0.29.0+das
.opt1
.dtk2404
0
'
setup.py
View file @
7fae23b4
...
@@ -254,33 +254,33 @@ install_requires = [
...
@@ -254,33 +254,33 @@ install_requires = [
version_range_max
=
max
(
sys
.
version_info
[
1
],
10
)
+
1
version_range_max
=
max
(
sys
.
version_info
[
1
],
10
)
+
1
def
get_sha
(
root_dir
:
Union
[
str
,
Path
])
->
str
:
#
def get_sha(root_dir: Union[str, Path]) -> str:
try
:
#
try:
return
subprocess
.
check_output
([
'git'
,
'rev-parse'
,
'HEAD'
],
cwd
=
root_dir
).
decode
(
'ascii'
).
strip
()
#
return subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=root_dir).decode('ascii').strip()
except
Exception
:
#
except Exception:
return
'Unknown'
#
return 'Unknown'
#
def
get_abi
():
#
def get_abi():
try
:
#
try:
command
=
"echo '#include <string>' | gcc -x c++ -E -dM - | fgrep _GLIBCXX_USE_CXX11_ABI"
#
command = "echo '#include <string>' | gcc -x c++ -E -dM - | fgrep _GLIBCXX_USE_CXX11_ABI"
result
=
subprocess
.
run
(
command
,
shell
=
True
,
capture_output
=
True
,
text
=
True
)
#
result = subprocess.run(command, shell=True, capture_output=True, text=True)
output
=
result
.
stdout
.
strip
()
#
output = result.stdout.strip()
abi
=
"abi"
+
output
.
split
(
" "
)[
-
1
]
#
abi = "abi" + output.split(" ")[-1]
return
abi
#
return abi
except
Exception
:
#
except Exception:
return
'abiUnknown'
#
return 'abiUnknown'
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
version
=
''
version
=
''
root_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
root_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
add_version_path
=
os
.
path
.
join
(
root_dir
,
"DIFFUSERS_VERSION_NUMBER"
)
add_version_path
=
os
.
path
.
join
(
root_dir
,
"DIFFUSERS_VERSION_NUMBER"
)
if
sha
!=
'Unknown'
:
#
if sha != 'Unknown':
if
sha
is
None
:
#
if sha is None:
sha
=
get_sha
(
root_dir
)
#
sha = get_sha(root_dir)
version
=
'git'
+
sha
[:
7
]
#
version = 'git' + sha[:7]
# abi
#
#
abi
version
+=
"."
+
get_abi
()
#
version += "." + get_abi()
# dtk version
# dtk version
if
os
.
getenv
(
"ROCM_PATH"
):
if
os
.
getenv
(
"ROCM_PATH"
):
...
@@ -288,13 +288,13 @@ def get_version_add(sha: Optional[str] = None) -> str:
...
@@ -288,13 +288,13 @@ def get_version_add(sha: Optional[str] = None) -> str:
rocm_version_path
=
os
.
path
.
join
(
rocm_path
,
'.info'
,
"rocm_version"
)
rocm_version_path
=
os
.
path
.
join
(
rocm_path
,
'.info'
,
"rocm_version"
)
with
open
(
rocm_version_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
with
open
(
rocm_version_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
lines
=
file
.
readlines
()
lines
=
file
.
readlines
()
rocm_version
=
lines
[
0
][:
-
2
].
replace
(
"."
,
""
)
rocm_version
=
lines
[
0
][:
-
1
].
replace
(
"."
,
""
)
version
+=
"
.
dtk"
+
rocm_version
version
+=
"dtk"
+
rocm_version
lines
=
[]
lines
=
[]
with
open
(
add_version_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
with
open
(
add_version_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
lines
=
file
.
readlines
()
lines
=
file
.
readlines
()
lines
[
0
]
=
"__dcu_version__ = '0.29.0+das
1.2
.{}'
\n
"
.
format
(
version
)
lines
[
0
]
=
"__dcu_version__ = '0.29.0+das
.opt1
.{}'
\n
"
.
format
(
version
)
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
file
.
writelines
(
lines
)
file
.
writelines
(
lines
)
file
.
close
()
file
.
close
()
...
@@ -302,7 +302,7 @@ def get_version_add(sha: Optional[str] = None) -> str:
...
@@ -302,7 +302,7 @@ def get_version_add(sha: Optional[str] = None) -> str:
init_path
=
os
.
path
.
join
(
root_dir
,
"src/diffusers/__init__.py"
)
init_path
=
os
.
path
.
join
(
root_dir
,
"src/diffusers/__init__.py"
)
with
open
(
init_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
with
open
(
init_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
lines
=
file
.
readlines
()
lines
=
file
.
readlines
()
lines
[
1
]
=
"__dcu_version__ = '0.29.0+das
1.2
.{}'
\n
"
.
format
(
version
)
lines
[
1
]
=
"__dcu_version__ = '0.29.0+das
.opt1
.{}'
\n
"
.
format
(
version
)
lines
[
818
]
=
" extra_objects={
\"
__version__
\"
: __version__,
\"
__dcu_version__
\"
: __dcu_version__},
\n
"
lines
[
818
]
=
" extra_objects={
\"
__version__
\"
: __version__,
\"
__dcu_version__
\"
: __dcu_version__},
\n
"
with
open
(
init_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
with
open
(
init_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
file
.
writelines
(
lines
)
file
.
writelines
(
lines
)
...
...
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