Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
9ce1a53c
Commit
9ce1a53c
authored
2 years ago
by
reivilibre
Committed by
Olivier Wilkinson (reivilibre)
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix the release script not publishing binary wheels. (#13850)
parent
ab86743f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/13850.misc
+1
-0
1 addition, 0 deletions
changelog.d/13850.misc
scripts-dev/release.py
+34
-11
34 additions, 11 deletions
scripts-dev/release.py
with
35 additions
and
11 deletions
changelog.d/13850.misc
0 → 100644
+
1
−
0
View file @
9ce1a53c
Fix the release script not publishing binary wheels.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts-dev/release.py
+
34
−
11
View file @
9ce1a53c
...
...
@@ -427,11 +427,12 @@ def _publish(gh_token: str) -> None:
@cli.command
()
def
upload
()
->
None
:
_upload
()
@click.option
(
"
--gh-token
"
,
envvar
=
[
"
GH_TOKEN
"
,
"
GITHUB_TOKEN
"
],
required
=
False
)
def
upload
(
gh_token
:
Optional
[
str
])
->
None
:
_upload
(
gh_token
)
def
_upload
()
->
None
:
def
_upload
(
gh_token
:
Optional
[
str
]
)
->
None
:
"""
Upload release to pypi.
"""
current_version
=
get_package_version
()
...
...
@@ -444,18 +445,40 @@ def _upload() -> None:
click
.
echo
(
"
Tag {tag_name} (tag.commit) is not currently checked out!
"
)
click
.
get_current_context
().
abort
()
pypi_asset_names
=
[
f
"
matrix_synapse-
{
current_version
}
-py3-none-any.whl
"
,
f
"
matrix-synapse-
{
current_version
}
.tar.gz
"
,
]
# Query all the assets corresponding to this release.
gh
=
Github
(
gh_token
)
gh_repo
=
gh
.
get_repo
(
"
matrix-org/synapse
"
)
gh_release
=
gh_repo
.
get_release
(
tag_name
)
all_assets
=
set
(
gh_release
.
get_assets
())
# Only accept the wheels and sdist.
# Notably: we don't care about debs.tar.xz.
asset_names_and_urls
=
sorted
(
(
asset
.
name
,
asset
.
browser_download_url
)
for
asset
in
all_assets
if
asset
.
name
.
endswith
((
"
.whl
"
,
"
.tar.gz
"
))
)
# Print out what we've determined.
print
(
"
Found relevant assets:
"
)
for
asset_name
,
_
in
asset_names_and_urls
:
print
(
f
"
-
{
asset_name
}
"
)
ignored_asset_names
=
sorted
(
{
asset
.
name
for
asset
in
all_assets
}
-
{
asset_name
for
asset_name
,
_
in
asset_names_and_urls
}
)
print
(
"
\n
Ignoring irrelevant assets:
"
)
for
asset_name
in
ignored_asset_names
:
print
(
f
"
-
{
asset_name
}
"
)
with
TemporaryDirectory
(
prefix
=
f
"
synapse_upload_
{
tag_name
}
_
"
)
as
tmpdir
:
for
name
in
pypi_
asset_names
:
for
name
,
asset_download_url
in
asset_names
_and_urls
:
filename
=
path
.
join
(
tmpdir
,
name
)
url
=
f
"
https://github.com/matrix-org/synapse/releases/download/
{
tag_name
}
/
{
name
}
"
click
.
echo
(
f
"
Downloading
{
name
}
into
{
filename
}
"
)
urllib
.
request
.
urlretrieve
(
url
,
filename
=
filename
)
urllib
.
request
.
urlretrieve
(
asset_download_
url
,
filename
=
filename
)
if
click
.
confirm
(
"
Upload to PyPI?
"
,
default
=
True
):
subprocess
.
run
(
"
twine upload *
"
,
shell
=
True
,
cwd
=
tmpdir
)
...
...
@@ -672,7 +695,7 @@ def full(gh_token: str) -> None:
_publish
(
gh_token
)
click
.
echo
(
"
\n
*** upload ***
"
)
_upload
()
_upload
(
gh_token
)
click
.
echo
(
"
\n
*** merge back ***
"
)
_merge_back
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment