Name | depsolve JSON |
Version |
0.2.1
JSON |
| download |
home_page | |
Summary | Agnostic dependencies solver |
upload_time | 2023-10-14 14:00:52 |
maintainer | |
docs_url | None |
author | Sebastien Nicolet |
requires_python | >=3.10,<4.0 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# DepSolve
This is an asyncio agnostic dependency tree solver
The idea is to take out the problem of depencies solving from packages managers or importers
## Usage
```python
import asyncio
from depsolve import Dependency, walk
async def perform_importation(dependency: Dependency):
# here your package/whatever is supposed to inherit from `Dependency`
# if any other argument is need for the command line in the package
# have a look to functools.partial()
await asyncio.sleep(2)
async def main():
dependencies = [
Dependency(name='land'),
Dependency(name='hen', depends_on=['land']),
Dependency(name='eggs', depends_on=['hen']),
Dependency(name='sugar_cane', depends_on=['land']),
Dependency(name='plain flour', depends_on=['wheat']),
Dependency(name='sugar', depends_on=['sugar_cane']),
Dependency(name='genoise', depends_on=['eggs', 'sugar']),
Dependency(name='strawberry', depends_on=['land']),
Dependency(name='wheat', depends_on=['land']),
Dependency(name='sirop', depends_on=['strawberry']),
Dependency(name='cake', depends_on=['genoise', 'strawberry', 'sirop']),
Dependency(name='cooking', depends_on=['cake'])
]
for items in walk(dependencies):
deps_names = [dep.name for dep in items]
print(f'dependencies to install: {len(items)} : {", ".join(deps_names)}')
tasks = asyncio.gather(*[perform_importation(dep) for dep in items])
await tasks
if __name__ == "__main__":
asyncio.run(main())
```
wich output:
```
dependencies to install: 1 : land
dependencies to install: 4 : hen, sugar_cane, strawberry, wheat
dependencies to install: 4 : eggs, plain flour, sugar, sirop
dependencies to install: 1 : genoise
dependencies to install: 1 : cake
dependencies to install: 1 : cooking
```
Raw data
{
"_id": null,
"home_page": "",
"name": "depsolve",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Sebastien Nicolet",
"author_email": "snicolet95@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c4/98/6f09e342e2a933b8e193fabc41a806097f9c07ab124b44a74d51c03bbb58/depsolve-0.2.1.tar.gz",
"platform": null,
"description": "# DepSolve\nThis is an asyncio agnostic dependency tree solver\n\nThe idea is to take out the problem of depencies solving from packages managers or importers\n\n## Usage\n```python\nimport asyncio\nfrom depsolve import Dependency, walk\n\n\nasync def perform_importation(dependency: Dependency):\n # here your package/whatever is supposed to inherit from `Dependency`\n # if any other argument is need for the command line in the package\n # have a look to functools.partial()\n await asyncio.sleep(2)\n\n\nasync def main():\n dependencies = [\n Dependency(name='land'),\n Dependency(name='hen', depends_on=['land']),\n Dependency(name='eggs', depends_on=['hen']),\n Dependency(name='sugar_cane', depends_on=['land']),\n Dependency(name='plain flour', depends_on=['wheat']),\n Dependency(name='sugar', depends_on=['sugar_cane']),\n Dependency(name='genoise', depends_on=['eggs', 'sugar']),\n Dependency(name='strawberry', depends_on=['land']),\n Dependency(name='wheat', depends_on=['land']),\n Dependency(name='sirop', depends_on=['strawberry']),\n Dependency(name='cake', depends_on=['genoise', 'strawberry', 'sirop']),\n Dependency(name='cooking', depends_on=['cake'])\n ]\n for items in walk(dependencies):\n deps_names = [dep.name for dep in items]\n print(f'dependencies to install: {len(items)} : {\", \".join(deps_names)}')\n tasks = asyncio.gather(*[perform_importation(dep) for dep in items])\n await tasks\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\nwich output:\n```\ndependencies to install: 1 : land\ndependencies to install: 4 : hen, sugar_cane, strawberry, wheat\ndependencies to install: 4 : eggs, plain flour, sugar, sirop\ndependencies to install: 1 : genoise\ndependencies to install: 1 : cake\ndependencies to install: 1 : cooking\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Agnostic dependencies solver",
"version": "0.2.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6bffe5378131e0c5434458527d17bbad42341788c0ad809cbf3259c709b6704",
"md5": "e9b533edf3a31aed52c98b5610900e03",
"sha256": "ff20075600c3ec26804fc30b7006eef69770623622768c6f5b2036ecc5a53699"
},
"downloads": -1,
"filename": "depsolve-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e9b533edf3a31aed52c98b5610900e03",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 3307,
"upload_time": "2023-10-14T14:00:48",
"upload_time_iso_8601": "2023-10-14T14:00:48.467308Z",
"url": "https://files.pythonhosted.org/packages/e6/bf/fe5378131e0c5434458527d17bbad42341788c0ad809cbf3259c709b6704/depsolve-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c4986f09e342e2a933b8e193fabc41a806097f9c07ab124b44a74d51c03bbb58",
"md5": "2ff01d0b015e43ae262e48eda8f5fcf5",
"sha256": "98bffc138121fd767780b4bdf8bce30e3888d97a460964b530afc5b4230492ca"
},
"downloads": -1,
"filename": "depsolve-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "2ff01d0b015e43ae262e48eda8f5fcf5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 2499,
"upload_time": "2023-10-14T14:00:52",
"upload_time_iso_8601": "2023-10-14T14:00:52.807874Z",
"url": "https://files.pythonhosted.org/packages/c4/98/6f09e342e2a933b8e193fabc41a806097f9c07ab124b44a74d51c03bbb58/depsolve-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-14 14:00:52",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "depsolve"
}