Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Frappe package dependencies #1524

Open
ankush opened this issue Jan 31, 2024 · 0 comments
Open

feat: Frappe package dependencies #1524

ankush opened this issue Jan 31, 2024 · 0 comments

Comments

@ankush
Copy link
Member

ankush commented Jan 31, 2024

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():

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant