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
275d09f9
Commit
275d09f9
authored
Dec 24, 2019
by
finswimmer
Committed by
Sébastien Eustace
Dec 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix (git.py): git url's can now contain longer path names, e.g. projects like in gitlab (#1756)
parent
dbe2c380
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
poetry/vcs/git.py
+14
-13
tests/vcs/test_git.py
+8
-0
No files found.
poetry/vcs/git.py
View file @
275d09f9
...
...
@@ -9,24 +9,24 @@ from poetry.utils._compat import decode
PATTERNS
=
[
re
.
compile
(
r"^(git\+)?"
r"(?P<protocol>https?|git|ssh|rsync|file)://"
r"(?:(?P<user>.+)@)*"
r"(?P<resource>[a-z0-9_.-]*)"
r"(:?P<port>[\d]+)?"
r"(?P<pathname>[:/]((?P<owner>[\w\-]+)/)?"
r"((?P<name>[\w\-.]+?)(\.git|/)?)?)"
r"([@#](?P<rev>[^@#]+))?"
r"$"
),
re
.
compile
(
r"(git\+)?"
r"((?P<protocol>\w+)://)"
r"((?P<user>\w+)@)?"
r"(?P<resource>[\w.\-]+)"
r"(:(?P<port>\d+))?"
r"(?P<pathname>(/(?P<owner>\w+)/)"
r"(/?(?P<name>[\w\-]+)(\.git|/)?)?)"
r"((?P<projects>([\w\-/]+)/)?(?P<name>[\w\-]+)(\.git|/)?)?)"
r"([@#](?P<rev>[^@#]+))?"
r"$"
),
re
.
compile
(
r"^(git\+)?"
r"(?P<protocol>https?|git|ssh|rsync|file)://"
r"(?:(?P<user>.+)@)*"
r"(?P<resource>[a-z0-9_.-]*)"
r"(:?P<port>[\d]+)?"
r"(?P<pathname>[:/]((?P<owner>[\w\-]+)/(?P<projects>([\w\-/]+)/)?)?"
r"((?P<name>[\w\-.]+?)(\.git|/)?)?)"
r"([@#](?P<rev>[^@#]+))?"
r"$"
),
...
...
@@ -34,7 +34,7 @@ PATTERNS = [
r"^(?:(?P<user>.+)@)*"
r"(?P<resource>[a-z0-9_.-]*)[:]*"
r"(?P<port>[\d]+)?"
r"(?P<pathname>/?(?P<owner>.+)/(?P<name>.+).git)"
r"(?P<pathname>/?(?P<owner>.+)/(?P<
projects>([\w\-/]+)/)?(?P<
name>.+).git)"
r"([@#](?P<rev>[^@#]+))?"
r"$"
),
...
...
@@ -43,6 +43,7 @@ PATTERNS = [
r"(?P<resource>[\w.\-]+)"
r"[:/]{1,2}"
r"(?P<pathname>((?P<owner>\w+)/)?"
r"(?P<projects>([\w\-/]+)/)?"
r"((?P<name>[\w\-]+)(\.git|/)?)?)"
r"([@#](?P<rev>[^@#]+))?"
r"$"
...
...
tests/vcs/test_git.py
View file @
275d09f9
...
...
@@ -62,6 +62,14 @@ from poetry.vcs.git import GitUrl
"git+file://C:
\\
Users
\\
hello
\\
testing.git#zkat/windows-files"
,
GitUrl
(
"file://C:
\\
Users
\\
hello
\\
testing.git"
,
"zkat/windows-files"
),
),
(
"git+https://git.example.com/sdispater/project/my_repo.git"
,
GitUrl
(
"https://git.example.com/sdispater/project/my_repo.git"
,
None
),
),
(
"git+ssh://git@git.example.com:sdispater/project/my_repo.git"
,
GitUrl
(
"git@git.example.com:sdispater/project/my_repo.git"
,
None
),
),
],
)
def
test_normalize_url
(
url
,
normalized
):
...
...
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