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
renzhc
diffusers_dcu
Commits
7054a349
Unverified
Commit
7054a349
authored
Apr 11, 2025
by
Sayak Paul
Committed by
GitHub
Apr 11, 2025
Browse files
do not use `DIFFUSERS_REQUEST_TIMEOUT` for notification bot (#11273)
fix to a constant
parent
511d7381
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
utils/notify_slack_about_release.py
utils/notify_slack_about_release.py
+2
-4
No files found.
utils/notify_slack_about_release.py
View file @
7054a349
...
@@ -17,8 +17,6 @@ import os
...
@@ -17,8 +17,6 @@ import os
import
requests
import
requests
from
..src.diffusers.utils.constants
import
DIFFUSERS_REQUEST_TIMEOUT
# Configuration
# Configuration
LIBRARY_NAME
=
"diffusers"
LIBRARY_NAME
=
"diffusers"
...
@@ -28,7 +26,7 @@ SLACK_WEBHOOK_URL = os.getenv("SLACK_WEBHOOK_URL")
...
@@ -28,7 +26,7 @@ SLACK_WEBHOOK_URL = os.getenv("SLACK_WEBHOOK_URL")
def
check_pypi_for_latest_release
(
library_name
):
def
check_pypi_for_latest_release
(
library_name
):
"""Check PyPI for the latest release of the library."""
"""Check PyPI for the latest release of the library."""
response
=
requests
.
get
(
f
"https://pypi.org/pypi/
{
library_name
}
/json"
,
timeout
=
DIFFUSERS_REQUEST_TIMEOUT
)
response
=
requests
.
get
(
f
"https://pypi.org/pypi/
{
library_name
}
/json"
,
timeout
=
60
)
if
response
.
status_code
==
200
:
if
response
.
status_code
==
200
:
data
=
response
.
json
()
data
=
response
.
json
()
return
data
[
"info"
][
"version"
]
return
data
[
"info"
][
"version"
]
...
@@ -40,7 +38,7 @@ def check_pypi_for_latest_release(library_name):
...
@@ -40,7 +38,7 @@ def check_pypi_for_latest_release(library_name):
def
get_github_release_info
(
github_repo
):
def
get_github_release_info
(
github_repo
):
"""Fetch the latest release info from GitHub."""
"""Fetch the latest release info from GitHub."""
url
=
f
"https://api.github.com/repos/
{
github_repo
}
/releases/latest"
url
=
f
"https://api.github.com/repos/
{
github_repo
}
/releases/latest"
response
=
requests
.
get
(
url
,
timeout
=
DIFFUSERS_REQUEST_TIMEOUT
)
response
=
requests
.
get
(
url
,
timeout
=
60
)
if
response
.
status_code
==
200
:
if
response
.
status_code
==
200
:
data
=
response
.
json
()
data
=
response
.
json
()
...
...
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