Skip to content

bug: Dependicies not packing fully on flet build apk #5679

@amogus-gggy

Description

@amogus-gggy

Duplicate Check

Describe the bug

Flet cli doesn't pack dependency "python-access-modifiers" even when i put it in pyproject.toml
Its pure python package.

Code sample

Code
import flet as ft
from python_access_modifiers import private, protected, constant, field_access_modifiers, Protected

@field_access_modifiers
class Person:
    name: str           # по умолчанию public
    age: Protected[int] # объявим как protected поле

    def __init__(self, name: str, age: int):
        self.name = name
        self.age = age
        self._private_note = "secret"  # обычное имя

    @protected
    def get_age(self) -> int:
        return self.age

    @private
    def _private_method(self) -> str:
        return f"Private note: {self._private_note}"

    @constant
    def constant_method(self) -> str:
        return "I can't be overridden"

    def public_method(self) -> str:
        # внутри класса мы имеем доступ к protected и private
        age = self.get_age()
        pr = self._private_method()
        return f"Name: {self.name}, Age: {age}, {pr}"


def main(page: ft.Page):
    p = Person("Bob", 25)

    txt = ft.Text(f"Public method output: {p.public_method()}")
    page.add(txt)

    # Попытка вызвать защищённый метод напрямую — должно выдать ошибку
    try:
        res = p.get_age()
    except RuntimeError as e:
        res = f"RuntimeError: {e}"
    page.add(ft.Text(f"Direct get_age(): {res}"))

    # Попытка вызвать приватный метод напрямую — должно выдать ошибку
    try:
        res2 = p._private_method()
    except RuntimeError as e:
        res2 = f"RuntimeError: {e}"
    page.add(ft.Text(f"Direct _private_method(): {res2}"))

    page.update()

ft.app(main)

To reproduce

Build apk with python-access-modifiers in dependicies and use it in app.

Expected behavior

Just work with lib

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

10

Flet version

0.28.3

Regression

I'm not sure / I don't know

Suggestions

Force adding packages to sitepackages for android

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions