Commit 9cf87a28 by Sébastien Eustace

Prefer path to file for file dependencies

parent 2d567b68
...@@ -78,6 +78,9 @@ ...@@ -78,6 +78,9 @@
}, },
{ {
"$ref": "#/definitions/file-dependency" "$ref": "#/definitions/file-dependency"
},
{
"$ref": "#/definitions/path-dependency"
} }
] ]
} }
...@@ -252,9 +255,31 @@ ...@@ -252,9 +255,31 @@
"type": "string", "type": "string",
"description": "The python versions for which the dependency should be installed." "description": "The python versions for which the dependency should be installed."
}, },
"allows-prereleases": { "optional": {
"type": "boolean", "type": "boolean",
"description": "Whether the dependency allows prereleases or not." "description": "Whether the dependency is optional or not."
},
"extras": {
"type": "array",
"description": "The required extras for this dependency.",
"items": {
"type": "string"
}
}
}
},
"path-dependency": {
"type": "object",
"required": ["path"],
"additionalProperties": false,
"properties": {
"path": {
"type": "string",
"description": "The path to the dependency."
},
"python": {
"type": "string",
"description": "The python versions for which the dependency should be installed."
}, },
"optional": { "optional": {
"type": "boolean", "type": "boolean",
......
...@@ -283,6 +283,10 @@ class Package(object): ...@@ -283,6 +283,10 @@ class Package(object):
file_path = Path(constraint['file']) file_path = Path(constraint['file'])
dependency = FileDependency(file_path, base=self.cwd) dependency = FileDependency(file_path, base=self.cwd)
elif 'path' in constraint:
path = Path(constraint['path'])
dependency = FileDependency(path, base=self.cwd)
else: else:
version = constraint['version'] version = constraint['version']
......
...@@ -31,7 +31,7 @@ pathlib2 = { version = "^2.2", python = "~2.7" } ...@@ -31,7 +31,7 @@ pathlib2 = { version = "^2.2", python = "~2.7" }
orator = { version = "^0.9", optional = true } orator = { version = "^0.9", optional = true }
# File dependency # File dependency
demo = { file = "../distributions/demo-0.1.0-py2.py3-none-any.whl" } demo = { path = "../distributions/demo-0.1.0-py2.py3-none-any.whl" }
[tool.poetry.extras] [tool.poetry.extras]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment