AuHau/dpip

Requirement's syntax extension

Opened this issue · 0 comments

AuHau commented

I also have a proposal for extending the current pip's dependency syntax. Users could benefit from being able to specify dependency using IPFS/IPNS hash. pip already currently support to specify dependency using HTTP or several VCS system. The new syntax should use inspiration from these integrations and use similar syntax and features.

Basic overview:

  • Syntax: ipfs://<hash> ; ipns://<hash>
  • Support for #egg=<package> and #subdirectory=<subdir>
  • Support for version fixing

Detection and handling of this syntax should be dpip's responsibility. Even though the implementation of this extended syntax most probably won't be part of the first scope of dpip's implementation, it should be in mind of the implementors that this extension will most likely follow.

The resolution should follow these steps:

  1. If the address is IPNS, resolve it for IPFS address
  2. The address points to file
    1. If it is a wheel, then verify that it can be installed with the current Python version, type of interpreter and platform.
    2. Skip any version validation (??? - does it make sense to ignore it or raise an error?)
    3. Install the file
  3. The address points to a folder
    1. If the dependency is provided with version specifier, look for the specific version of the wheel or sdist using the PEP427 convention and install it
    2. If the dependency was not provided with version specifier, fetch the latest version