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
d5dcc5c6
Commit
d5dcc5c6
authored
Aug 05, 2024
by
lijian6
Browse files
Modify setup.py
Signed-off-by:
lijian
<
lijian6@sugon.com
>
parent
02afa546
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
DIFFUSERS_VERSION_NUMBER
DIFFUSERS_VERSION_NUMBER
+1
-1
setup.py
setup.py
+8
-8
No files found.
DIFFUSERS_VERSION_NUMBER
View file @
d5dcc5c6
__dcu_version__ = '0.29.0+das1.2.git
fe0fecc
.abi0.dtk2404'
__dcu_version__ = '0.29.0+das1.2.git
02afa54
.abi0.dtk2404'
setup.py
View file @
d5dcc5c6
...
@@ -254,9 +254,9 @@ install_requires = [
...
@@ -254,9 +254,9 @@ 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
(
ort_
root
:
Union
[
str
,
Path
])
->
str
:
def
get_sha
(
root
_dir
:
Union
[
str
,
Path
])
->
str
:
try
:
try
:
return
subprocess
.
check_output
([
'git'
,
'rev-parse'
,
'HEAD'
],
cwd
=
ort_
root
).
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'
...
@@ -272,11 +272,11 @@ def get_abi():
...
@@ -272,11 +272,11 @@ def get_abi():
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
version
=
''
version
=
''
ort_
root
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
root
_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
add_version_path
=
os
.
path
.
join
(
ort_
root
,
"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
(
ort_
root
)
sha
=
get_sha
(
root
_dir
)
version
=
'git'
+
sha
[:
7
]
version
=
'git'
+
sha
[:
7
]
# abi
# abi
...
@@ -299,7 +299,7 @@ def get_version_add(sha: Optional[str] = None) -> str:
...
@@ -299,7 +299,7 @@ def get_version_add(sha: Optional[str] = None) -> str:
file
.
writelines
(
lines
)
file
.
writelines
(
lines
)
file
.
close
()
file
.
close
()
init_path
=
os
.
path
.
join
(
ort_
root
,
"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+das1.2.{}'
\n
"
.
format
(
version
)
lines
[
1
]
=
"__dcu_version__ = '0.29.0+das1.2.{}'
\n
"
.
format
(
version
)
...
@@ -310,8 +310,8 @@ def get_version_add(sha: Optional[str] = None) -> str:
...
@@ -310,8 +310,8 @@ def get_version_add(sha: Optional[str] = None) -> str:
def
get_version
():
def
get_version
():
get_version_add
()
get_version_add
()
ort_
root
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
root
_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
version_file
=
os
.
path
.
join
(
ort_
root
,
"DIFFUSERS_VERSION_NUMBER"
)
version_file
=
os
.
path
.
join
(
root
_dir
,
"DIFFUSERS_VERSION_NUMBER"
)
with
open
(
version_file
,
encoding
=
'utf-8'
)
as
f
:
with
open
(
version_file
,
encoding
=
'utf-8'
)
as
f
:
exec
(
compile
(
f
.
read
(),
version_file
,
'exec'
))
exec
(
compile
(
f
.
read
(),
version_file
,
'exec'
))
return
locals
()[
'__dcu_version__'
]
return
locals
()[
'__dcu_version__'
]
...
...
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