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
ee567a72
Unverified
Commit
ee567a72
authored
May 14, 2023
by
Riccardo Albertazzi
Committed by
GitHub
May 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix url dependency caching when special urlencoded chars (#7921)
parent
e5bbc604
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
src/poetry/packages/direct_origin.py
+2
-5
No files found.
src/poetry/packages/direct_origin.py
View file @
ee567a72
from
__future__
import
annotations
import
functools
import
os
import
urllib.parse
from
pathlib
import
Path
from
typing
import
TYPE_CHECKING
...
...
@@ -77,20 +75,19 @@ class DirectOrigin:
return
PackageInfo
.
from_directory
(
path
=
directory
)
.
to_package
(
root_dir
=
directory
)
def
get_package_from_url
(
self
,
url
:
str
)
->
Package
:
file_name
=
os
.
path
.
basename
(
urllib
.
parse
.
urlparse
(
url
)
.
path
)
link
=
Link
(
url
)
artifact
=
self
.
_artifact_cache
.
get_cached_archive_for_link
(
link
,
strict
=
True
)
if
not
artifact
:
artifact
=
(
self
.
_artifact_cache
.
get_cache_directory_for_link
(
link
)
/
file_
name
self
.
_artifact_cache
.
get_cache_directory_for_link
(
link
)
/
link
.
file
name
)
artifact
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
download_file
(
url
,
artifact
)
package
=
self
.
get_package_from_file
(
artifact
)
package
.
files
=
[
{
"file"
:
file_
name
,
"hash"
:
"sha256:"
+
get_file_hash
(
artifact
)}
{
"file"
:
link
.
file
name
,
"hash"
:
"sha256:"
+
get_file_hash
(
artifact
)}
]
package
.
_source_type
=
"url"
...
...
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