Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
8e8aa44c
Commit
8e8aa44c
authored
Sep 25, 2022
by
David Hotham
Committed by
Bjorn Neergaard
Oct 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
normalized name when registering package at upload
parent
1215ba8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
src/poetry/publishing/uploader.py
+5
-7
tests/helpers.py
+1
-2
No files found.
src/poetry/publishing/uploader.py
View file @
8e8aa44c
...
...
@@ -77,13 +77,10 @@ class Uploader:
def
files
(
self
)
->
list
[
Path
]:
dist
=
self
.
_poetry
.
file
.
parent
/
"dist"
version
=
self
.
_package
.
version
.
to_string
()
escaped_name
=
distribution_name
(
self
.
_package
.
name
)
wheels
=
list
(
dist
.
glob
(
f
"{distribution_name(self._package.name)}-{version}-*.whl"
)
)
tars
=
list
(
dist
.
glob
(
f
"{distribution_name(self._package.name)}-{version}.tar.gz"
)
)
wheels
=
list
(
dist
.
glob
(
f
"{escaped_name}-{version}-*.whl"
))
tars
=
list
(
dist
.
glob
(
f
"{escaped_name}-{version}.tar.gz"
))
return
sorted
(
wheels
+
tars
)
...
...
@@ -303,7 +300,8 @@ class Uploader:
Register a package to a repository.
"""
dist
=
self
.
_poetry
.
file
.
parent
/
"dist"
file
=
dist
/
f
"{self._package.name}-{self._package.version.to_string()}.tar.gz"
escaped_name
=
distribution_name
(
self
.
_package
.
name
)
file
=
dist
/
f
"{escaped_name}-{self._package.version.to_string()}.tar.gz"
if
not
file
.
exists
():
raise
RuntimeError
(
f
'"{file.name}" does not exist.'
)
...
...
tests/helpers.py
View file @
8e8aa44c
...
...
@@ -11,7 +11,6 @@ from pathlib import Path
from
typing
import
TYPE_CHECKING
from
typing
import
Any
from
poetry.core.masonry.utils.helpers
import
distribution_name
from
poetry.core.packages.package
import
Package
from
poetry.core.packages.utils.link
import
Link
from
poetry.core.toml.file
import
TOMLFile
...
...
@@ -235,7 +234,7 @@ class TestRepository(Repository):
def
find_links_for_package
(
self
,
package
:
Package
)
->
list
[
Link
]:
return
[
Link
(
f
"https://foo.bar/files/{
distribution_name(package.name
)}"
f
"https://foo.bar/files/{
package.name.replace('-', '_'
)}"
f
"-{package.version.to_string()}-py2.py3-none-any.whl"
)
]
...
...
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