Commit 9cf87a28 by Sébastien Eustace

Prefer path to file for file dependencies

parent 2d567b68
......@@ -78,6 +78,9 @@
},
{
"$ref": "#/definitions/file-dependency"
},
{
"$ref": "#/definitions/path-dependency"
}
]
}
......@@ -252,9 +255,31 @@
"type": "string",
"description": "The python versions for which the dependency should be installed."
},
"allows-prereleases": {
"optional": {
"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": {
"type": "boolean",
......
......@@ -283,6 +283,10 @@ class Package(object):
file_path = Path(constraint['file'])
dependency = FileDependency(file_path, base=self.cwd)
elif 'path' in constraint:
path = Path(constraint['path'])
dependency = FileDependency(path, base=self.cwd)
else:
version = constraint['version']
......
......@@ -31,7 +31,7 @@ pathlib2 = { version = "^2.2", python = "~2.7" }
orator = { version = "^0.9", optional = true }
# 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]
......
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