Skip to main content

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

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

Release files for depsolve 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for depsolve 0.2.1
File Size Uploaded
depsolve-0.2.1.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for depsolve 0.2.1
File Interpreter ABI Platform
depsolve-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / depsolve-0.2.1.tar.gz

Download URL depsolve-0.2.1.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
98bffc138121fd767780b4bdf8bce30e3888d97a460964b530afc5b4230492ca
BLAKE2b-256 checksum
How to use checksums
c4986f09e342e2a933b8e193fabc41a806097f9c07ab124b44a74d51c03bbb58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Linux/6.5.6-arch2-1

Release files / depsolve-0.2.1-py3-none-any.whl

Download URL depsolve-0.2.1-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff20075600c3ec26804fc30b7006eef69770623622768c6f5b2036ecc5a53699
BLAKE2b-256 checksum
How to use checksums
e6bffe5378131e0c5434458527d17bbad42341788c0ad809cbf3259c709b6704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Linux/6.5.6-arch2-1

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page