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
6738f829
Unverified
Commit
6738f829
authored
Jun 28, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors when git could not be found
parent
f3017b30
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
CHANGELOG.md
+1
-0
poetry/vcs/__init__.py
+12
-1
poetry/vcs/git.py
+4
-3
No files found.
CHANGELOG.md
View file @
6738f829
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
-
Fixed detection of
`.egg-info`
directory for non-poetry projects. (Thanks to
[
@gtors
](
https://github.com/gtors
)
)
-
Fixed detection of
`.egg-info`
directory for non-poetry projects. (Thanks to
[
@gtors
](
https://github.com/gtors
)
)
-
Fixed only-wheel builds. (Thanks to
[
@gtors
](
https://github.com/gtors
)
)
-
Fixed only-wheel builds. (Thanks to
[
@gtors
](
https://github.com/gtors
)
)
-
Fixed key and array order in lock file to avoid having differences when relocking.
-
Fixed key and array order in lock file to avoid having differences when relocking.
-
Fixed errors when
`git`
could not be found.
## [0.10.3] - 2018-06-04
## [0.10.3] - 2018-06-04
...
...
poetry/vcs/__init__.py
View file @
6738f829
import
subprocess
import
warnings
from
poetry.utils._compat
import
Path
from
poetry.utils._compat
import
Path
from
.git
import
Git
from
.git
import
Git
...
@@ -8,4 +11,12 @@ def get_vcs(directory): # type: (Path) -> Git
...
@@ -8,4 +11,12 @@ def get_vcs(directory): # type: (Path) -> Git
for
p
in
[
directory
]
+
list
(
directory
.
parents
):
for
p
in
[
directory
]
+
list
(
directory
.
parents
):
if
(
p
/
".git"
)
.
is_dir
():
if
(
p
/
".git"
)
.
is_dir
():
return
Git
(
p
)
try
:
return
Git
(
p
)
except
(
subprocess
.
CalledProcessError
,
OSError
):
# Either git could not be found or does not exist
warnings
.
warn
(
"git executable could not be found"
,
category
=
RuntimeWarning
)
return
poetry/vcs/git.py
View file @
6738f829
...
@@ -7,7 +7,7 @@ from poetry.utils._compat import decode
...
@@ -7,7 +7,7 @@ from poetry.utils._compat import decode
class
GitConfig
:
class
GitConfig
:
def
__init__
(
self
):
def
__init__
(
self
,
requires_git_presence
=
False
):
self
.
_config
=
{}
self
.
_config
=
{}
try
:
try
:
...
@@ -22,7 +22,8 @@ class GitConfig:
...
@@ -22,7 +22,8 @@ class GitConfig:
for
group
in
m
:
for
group
in
m
:
self
.
_config
[
group
[
0
]]
=
group
[
1
]
self
.
_config
[
group
[
0
]]
=
group
[
1
]
except
(
subprocess
.
CalledProcessError
,
OSError
):
except
(
subprocess
.
CalledProcessError
,
OSError
):
pass
if
requires_git_presence
:
raise
def
get
(
self
,
key
,
default
=
None
):
def
get
(
self
,
key
,
default
=
None
):
return
self
.
_config
.
get
(
key
,
default
)
return
self
.
_config
.
get
(
key
,
default
)
...
@@ -33,7 +34,7 @@ class GitConfig:
...
@@ -33,7 +34,7 @@ class GitConfig:
class
Git
:
class
Git
:
def
__init__
(
self
,
work_dir
=
None
):
def
__init__
(
self
,
work_dir
=
None
):
self
.
_config
=
GitConfig
()
self
.
_config
=
GitConfig
(
requires_git_presence
=
True
)
self
.
_work_dir
=
work_dir
self
.
_work_dir
=
work_dir
@property
@property
...
...
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