Skip to content

feat: Frappe package dependencies #1524

Open
@ankush

Description

@ankush

We can specify python dependencies in pyproject.toml

dependencies = [
    # Core dependencies
    "pycountry~=22.3.5",
    "Unidecode~=1.3.6",
    "barcodenumber~=0.5.0",
    "rapidfuzz~=2.15.0",
    "holidays~=0.28",
]

However we can't use Frappe app versions here because they are not published on pypi and pip can possibly fuckup and try to fetch it from pypi and fail catastrophically. (ref frappe/erpnext#25501)

Possible solution:

  1. We use same syntax as requirements.txt https://pip.pypa.io/en/stable/reference/requirements-file-format/
  2. We add a special section in pyproject.toml
[tool.bench.frappe-dependencies]
frappe = ">=15.2.0"
erpnext = "~=15.1.1"
  1. When doing bench get-app bench ensures that dependencies are present before installing app.

Note: This won't resolve and install them at all. (Not ideal for platforms like FC where we can't just install arbitrary app dependencies) That can be handled some other day.

Possible problems:

  • Frappe is installed first but other apps aren't really providing any guarantee for ordering. Order of installation can matter here. No idea how to solve this. Mostly, in Frappe ecosystem currently Frappe and ERPNext version targeting is required first.

Example usage of custom pyproject config blocks:

for pkg, version in pyroject_config["tool"]["bench"]["dev-dependencies"].items():

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions