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
6646afe8
Unverified
Commit
6646afe8
authored
May 24, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README
parent
248b84ed
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
58 additions
and
12 deletions
+58
-12
CHANGELOG.md
+1
-0
poetry/console/commands/install.py
+2
-0
poetry/installation/installer.py
+16
-2
poetry/installation/pip_installer.py
+14
-2
poetry/json/schemas/poetry-schema.json
+4
-0
poetry/packages/directory_dependency.py
+8
-3
poetry/packages/package.py
+2
-0
poetry/puzzle/operations/operation.py
+6
-0
poetry/puzzle/provider.py
+1
-1
tests/installation/fixtures/with-directory-dependency.test
+2
-2
tests/installation/fixtures/with-file-dependency.test
+2
-2
No files found.
CHANGELOG.md
View file @
6646afe8
...
...
@@ -12,6 +12,7 @@
-
Added support for specifying the
`platform`
for dependencies.
-
Added the
`--python`
option to the
`add`
command.
-
Added the
`--platform`
option to the
`add`
command.
-
Added a
`--develop`
option to the install command to install path dependencies in development/editable mode.
### Changed
...
...
poetry/console/commands/install.py
View file @
6646afe8
...
...
@@ -10,6 +10,7 @@ class InstallCommand(VenvCommand):
{ --dry-run : Outputs the operations but will not execute anything
(implicitly enables --verbose). }
{ --E|extras=* : Extra sets of dependencies to install. }
{ --develop=* : Install given packages in development mode. }
"""
help
=
"""The <info>install</info> command reads the <comment>pyproject.toml</> file from
...
...
@@ -37,6 +38,7 @@ exist it will look for <comment>pyproject.toml</> and do the same.
installer
.
extras
(
self
.
option
(
'extras'
))
installer
.
dev_mode
(
not
self
.
option
(
'no-dev'
))
installer
.
develop
(
self
.
option
(
'develop'
))
installer
.
dry_run
(
self
.
option
(
'dry-run'
))
installer
.
verbose
(
self
.
option
(
'verbose'
))
...
...
poetry/installation/installer.py
View file @
6646afe8
...
...
@@ -44,6 +44,7 @@ class Installer:
self
.
_verbose
=
False
self
.
_write_lock
=
True
self
.
_dev_mode
=
True
self
.
_develop
=
[]
self
.
_execute_operations
=
True
self
.
_whitelist
=
{}
...
...
@@ -99,6 +100,11 @@ class Installer:
def
is_dev_mode
(
self
):
# type: () -> bool
return
self
.
_dev_mode
def
develop
(
self
,
packages
):
# type: (dict) -> Installer
self
.
_develop
=
[
canonicalize_name
(
p
)
for
p
in
packages
]
return
self
def
update
(
self
,
update
=
True
):
# type: (bool) -> Installer
self
.
_update
=
update
...
...
@@ -404,13 +410,16 @@ class Installer:
installed
,
locked
))
if
not
is_installed
:
# If it's optional and not in required extras
# we do not install
if
locked
.
optional
and
locked
.
name
not
in
extra_packages
:
continue
ops
.
append
(
Install
(
locked
))
op
=
Install
(
locked
)
if
is_installed
:
op
.
skip
(
'Already installed'
)
ops
.
append
(
op
)
return
ops
...
...
@@ -429,6 +438,11 @@ class Installer:
if
op
.
job_type
==
'uninstall'
:
continue
if
package
.
name
in
self
.
_develop
and
package
.
source_type
==
'directory'
:
package
.
develop
=
True
if
op
.
skipped
:
op
.
unskip
()
python
=
Version
.
parse
(
'.'
.
join
([
str
(
i
)
for
i
in
self
.
_venv
.
version_info
[:
3
]]))
if
'python'
in
package
.
requirements
:
python_constraint
=
parse_constraint
(
...
...
poetry/installation/pip_installer.py
View file @
6646afe8
...
...
@@ -39,7 +39,11 @@ class PipInstaller(BaseInstaller):
finally
:
os
.
unlink
(
req
)
else
:
args
.
append
(
self
.
requirement
(
package
))
req
=
self
.
requirement
(
package
)
if
not
isinstance
(
req
,
list
):
args
.
append
(
req
)
else
:
args
+=
req
self
.
run
(
*
args
)
...
...
@@ -69,7 +73,15 @@ class PipInstaller(BaseInstaller):
return
req
if
package
.
source_type
in
[
'file'
,
'directory'
]:
return
os
.
path
.
realpath
(
package
.
source_reference
)
if
package
.
root_dir
:
req
=
os
.
path
.
join
(
package
.
root_dir
,
package
.
source_url
)
else
:
req
=
os
.
path
.
realpath
(
package
.
source_url
)
if
package
.
develop
:
req
=
[
'-e'
,
req
]
return
req
if
package
.
source_type
==
'git'
:
return
'git+{}@{}#egg={}'
.
format
(
...
...
poetry/json/schemas/poetry-schema.json
View file @
6646afe8
...
...
@@ -307,6 +307,10 @@
"items"
:
{
"type"
:
"string"
}
},
"develop"
:
{
"type"
:
"boolean"
,
"description"
:
"Whether to install the dependency in development mode."
}
}
},
...
...
poetry/packages/directory_dependency.py
View file @
6646afe8
...
...
@@ -34,6 +34,7 @@ class DirectoryDependency(Dependency):
develop
=
False
# type: bool
):
from
.
import
dependency_from_pep_508
from
.package
import
Package
self
.
_path
=
path
self
.
_base
=
base
...
...
@@ -79,9 +80,13 @@ class DirectoryDependency(Dependency):
with
setup
.
open
(
'w'
)
as
f
:
f
.
write
(
decode
(
builder
.
build_setup
()))
self
.
_package
=
poetry
.
package
package
=
poetry
.
package
self
.
_package
=
Package
(
package
.
pretty_name
,
package
.
version
)
self
.
_package
.
requires
+=
package
.
requires
self
.
_package
.
dev_requires
+=
package
.
dev_requires
self
.
_package
.
python_versions
=
package
.
python_versions
self
.
_package
.
platform
=
package
.
platform
else
:
from
poetry.packages
import
Package
# Execute egg_info
current_dir
=
os
.
getcwd
()
os
.
chdir
(
str
(
self
.
_full_path
))
...
...
@@ -129,7 +134,7 @@ class DirectoryDependency(Dependency):
self
.
_package
=
package
self
.
_package
.
source_type
=
'directory'
self
.
_package
.
source_
reference
=
str
(
self
.
_path
)
self
.
_package
.
source_
url
=
str
(
self
.
_path
)
super
(
DirectoryDependency
,
self
)
.
__init__
(
self
.
_package
.
name
,
...
...
poetry/packages/package.py
View file @
6646afe8
...
...
@@ -94,6 +94,8 @@ class Package(object):
self
.
root_dir
=
None
self
.
develop
=
False
@property
def
name
(
self
):
return
self
.
_name
...
...
poetry/puzzle/operations/operation.py
View file @
6646afe8
...
...
@@ -35,3 +35,9 @@ class Operation(object):
self
.
_skip_reason
=
reason
return
self
def
unskip
(
self
):
# type: () -> Operation
self
.
_skipped
=
False
self
.
_skip_reason
=
None
return
self
poetry/puzzle/provider.py
View file @
6646afe8
...
...
@@ -238,7 +238,7 @@ class Provider:
):
# type: (FileDependency) -> List[Package]
package
=
Package
(
dependency
.
name
,
dependency
.
pretty_constraint
)
package
.
source_type
=
'file'
package
.
source_
reference
=
str
(
dependency
.
path
)
package
.
source_
url
=
str
(
dependency
.
path
)
package
.
description
=
dependency
.
metadata
.
summary
for
req
in
dependency
.
metadata
.
requires_dist
:
...
...
tests/installation/fixtures/with-directory-dependency.test
View file @
6646afe8
...
...
@@ -18,8 +18,8 @@ platform = "*"
[
package
.
source
]
type
=
"directory"
reference
=
"
tests/fixtures/project_with_setup
"
url
=
""
reference
=
""
url
=
"
tests/fixtures/project_with_setup
"
[
package
.
dependencies
]
cachy
=
">=0.2.0"
...
...
tests/installation/fixtures/with-file-dependency.test
View file @
6646afe8
...
...
@@ -9,8 +9,8 @@ platform = "*"
[
package
.
source
]
type
=
"file"
reference
=
"
tests/fixtures/distributions/demo-0.1.0-py2.py3-none-any.whl
"
url
=
""
reference
=
""
url
=
"
tests/fixtures/distributions/demo-0.1.0-py2.py3-none-any.whl
"
[
package
.
dependencies
]
pendulum
=
">=1.4.0.0,<2.0.0.0"
...
...
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