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

flet build fails to parse file and git dependencies from tool.poetry.dependencies in pyproject.toml #4547

Closed
1 task done
FeodorFitsner opened this issue Dec 11, 2024 Discussed in #4546 · 0 comments · Fixed by #4554
Closed
1 task done
Assignees
Labels
bug Something isn't working packaging Related to app packaging
Milestone

Comments

@FeodorFitsner
Copy link
Contributor

Discussed in #4546

Originally posted by amcraig December 11, 2024

Question

Hi all,
I've tried including my python package(not on PyPi) through both relative paths to the whl/tar.gz and via git in both requirements.txt and in pyproject.toml (including poetry) but any attempts I do fail due to a distutils Module not found error or KeyError: 'version'.

Does anyone have a guaranteed way to provide a local/private python package to Flet in the build process?
Thanks!

Code sample

##### Pyproject Poetry 
[tool.poetry]
name = "file_tracker"
version = "0.5.0"
description = "redacted"
authors = ["amcraig"]

[tool.poetry.dependencies]
python = "^3.10"
private_package = { git = "https://github.com/private/package.git" }
flet = "^0.25.1"

##### requirements.txt
python==3.10
flet
datateam @ git+https://github.com/private/package

Error message

No response

------------------------------------------------------

  • I have searched for answers to my question both in the issues and in previous discussions.
@FeodorFitsner FeodorFitsner added the help wanted Extra attention is needed label Dec 11, 2024
@FeodorFitsner FeodorFitsner self-assigned this Dec 11, 2024
@FeodorFitsner FeodorFitsner removed the help wanted Extra attention is needed label Dec 11, 2024
@ndonkoHenri ndonkoHenri added bug Something isn't working packaging Related to app packaging labels Dec 12, 2024
@ndonkoHenri ndonkoHenri added this to the Flet v0.25.2 milestone Dec 12, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Flet Development Dec 14, 2024
FeodorFitsner added a commit that referenced this issue Jan 9, 2025
* Add `flet` if no dependencies provided for `flet publish` command (#4508)

Fix #4493

* Update project_dependencies.py (#4459)

# `Fixed` when I get no markers key in the version_value variable.

```bash
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main
    flet_cli.cli.main()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main
    args.handler(args)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle
    self.package_python_app()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app
    toml_dependencies = get_poetry_dependencies(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies
    format_dependency_version(dependency, version)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version
    if version_value["markers"]:
       ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'markers'
```

* Fix PyInstaller hook to avoid download Flet app bundle on first run (#4552)

* Fix PyInstaller hook to avoid download Flet app bundle on first run

Fix #4549

* Fix web job

* Support `git`, `path`, `url` Poetry-style dependencies in pyproject.toml (#4554)

Fix #4547

* Prepare Flet 0.25.2 (#4541)

* feat: implement `Window.ignore_mouse_events` (#4465)

* Update project_dependencies.py (#4459)

# `Fixed` when I get no markers key in the version_value variable.

```bash
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main
    flet_cli.cli.main()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main
    args.handler(args)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle
    self.package_python_app()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app
    toml_dependencies = get_poetry_dependencies(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies
    format_dependency_version(dependency, version)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version
    if version_value["markers"]:
       ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'markers'
```

* Remove `v0.26.0` deprecations (#4479)

* delete deprecations on py end

* delete deprecations on dart end

* fix: `SafeArea` object has no attribute `_SafeArea__minimum` (#4500)

* remove minimum from SafeArea

* remove deprecated props

* Changelog updated

* Fix publishing flet-windows.zip to releases

* Revert "Merge branch 'main' into feodor/prepare-0-25-2"

This reverts commit 32a7343, reversing
changes made to 3dc01e1.

* Changelog updated

* Update changelog.

* Changelog updated with cherry-picked bug fixes

* fix broken `Map.center_on()` and default animations (#4519)

* fix center_on

* get default animation duration and curve

* fix: Tooltip corruption in `Segment` and `BarChartRod` on `update()` (#4525)

* avoid jsonDecoding `Segment` and `BarChartRod` tooltips

* avoid jsonEncoding `Segment` and `BarChartRod` tooltips

* Unset theme visual density default

* Unset `SegmentedButton` border side default

* `TextField.hint_text` should be displayed if `label` is not specified

* fix: Setting `CheckBox.border_side.stroke_align` to an Enum fails (#4526)

* `BorderSideStrokeAlign` should inherit from float

* properly parse `Chip.border_side`

* fix:`ControlState` should be resolved based on user-defined order (#4556)

* ControlState: rename "" to "default"

* resolve ControlState on user-defined order

* fix failing tests

* remove breaking line

* fix wrong attribute name (#4557)

* Publish flet wheels to GitHub releases

* remove redeclared `MapPointerDeviceType`

---------

Co-authored-by: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Co-authored-by: Osama Mohammed Al-zabidi <57198110+omamkaz@users.noreply.github.com>
Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>

* restore `AudioRecorder.start_recording_async`

* clean imports

---------

Co-authored-by: Osama Mohammed Al-zabidi <57198110+omamkaz@users.noreply.github.com>
Co-authored-by: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>
FeodorFitsner added a commit that referenced this issue Jan 16, 2025
…4721)

* Added deprecatation to Video control

* Automatic registration of custom Flutter extensions

* Add `flet` if no dependencies provided for `flet publish` command (#4508)

Fix #4493

* Update project_dependencies.py (#4459)

# `Fixed` when I get no markers key in the version_value variable.

```bash
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main
    flet_cli.cli.main()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main
    args.handler(args)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle
    self.package_python_app()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app
    toml_dependencies = get_poetry_dependencies(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies
    format_dependency_version(dependency, version)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version
    if version_value["markers"]:
       ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'markers'
```

* Fix PyInstaller hook to avoid download Flet app bundle on first run (#4552)

* Fix PyInstaller hook to avoid download Flet app bundle on first run

Fix #4549

* Fix web job

* Support `git`, `path`, `url` Poetry-style dependencies in pyproject.toml (#4554)

Fix #4547

* Prepare Flet 0.25.2 (#4541)

* feat: implement `Window.ignore_mouse_events` (#4465)

* Update project_dependencies.py (#4459)

# `Fixed` when I get no markers key in the version_value variable.

```bash
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main
    flet_cli.cli.main()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main
    args.handler(args)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle
    self.package_python_app()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app
    toml_dependencies = get_poetry_dependencies(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies
    format_dependency_version(dependency, version)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version
    if version_value["markers"]:
       ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'markers'
```

* Remove `v0.26.0` deprecations (#4479)

* delete deprecations on py end

* delete deprecations on dart end

* fix: `SafeArea` object has no attribute `_SafeArea__minimum` (#4500)

* remove minimum from SafeArea

* remove deprecated props

* Changelog updated

* Fix publishing flet-windows.zip to releases

* Revert "Merge branch 'main' into feodor/prepare-0-25-2"

This reverts commit 32a7343, reversing
changes made to 3dc01e1.

* Changelog updated

* Update changelog.

* Changelog updated with cherry-picked bug fixes

* fix broken `Map.center_on()` and default animations (#4519)

* fix center_on

* get default animation duration and curve

* fix: Tooltip corruption in `Segment` and `BarChartRod` on `update()` (#4525)

* avoid jsonDecoding `Segment` and `BarChartRod` tooltips

* avoid jsonEncoding `Segment` and `BarChartRod` tooltips

* Unset theme visual density default

* Unset `SegmentedButton` border side default

* `TextField.hint_text` should be displayed if `label` is not specified

* fix: Setting `CheckBox.border_side.stroke_align` to an Enum fails (#4526)

* `BorderSideStrokeAlign` should inherit from float

* properly parse `Chip.border_side`

* fix:`ControlState` should be resolved based on user-defined order (#4556)

* ControlState: rename "" to "default"

* resolve ControlState on user-defined order

* fix failing tests

* remove breaking line

* fix wrong attribute name (#4557)

* Publish flet wheels to GitHub releases

* remove redeclared `MapPointerDeviceType`

---------

Co-authored-by: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Co-authored-by: Osama Mohammed Al-zabidi <57198110+omamkaz@users.noreply.github.com>
Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>

* flet_video removed and replaced with git dependency

* removed flet_audio

* Install Flutter function

* Install JDK

* Update poetry.lock

* platform-specific dependencies in `tool.flet.{platform}.dependencies`

* deleted flet_ads folder

* Fix __download_flet_client in dev mode

* deleted flet_audio_recorder folder

* Create android_sdk.py

* accept_sdkmanager_licenses

* Fix temp dir

* removed flet_flashlight folder

* deleted flet_geolocator folder

* deleted flet_lottie

* deleted flet_map

* Update android_sdk.py

* deleted flet_permissions_handler

* Fix deprecated imports

* deleted flet_rive

* deleted flet_webview

* Extract common utils

* Replace tqdm with Rich

* Replace print() with log()

* Package app first

* Build command logging, styling, progresses

* Android SDK: cmdline-tools installation

* Install cmdlinetools

* Skip Android SDK installation if managed by Android Studio

* Cleanup

* flutter-extension choice for create

* Nice way to install Android SDK packages

* "sep" for template

* fix badge bug

* Fix process output

* Disable Flutter/Dart version check and analytics

* All extensions are from git tags

* Flet desktop: load pre-build desktop client from build/{platform} dir

* Change color theme to look nice in Ubuntu

* Update poetry.lock

* do not install virtualenv

* do not install virtualenv in python tests

* Pin virtualenv==20.28.1

* Add `flet=={version}` to requirements if no dependencies defined

* Install poetry into virtual environment

* add poetry to path

* Remove Python 3.8 tests

* Fix Windows job

* Flutter 3.27.2, enable all CI jobs

* update template choices

* default template

---------

Co-authored-by: Osama Mohammed Al-zabidi <57198110+omamkaz@users.noreply.github.com>
Co-authored-by: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>
Co-authored-by: InesaFitsner <inesa@appveyor.com>
FeodorFitsner added a commit that referenced this issue Jan 16, 2025
…to `Text` content (#4673)

* Add `flet` if no dependencies provided for `flet publish` command (#4508)

Fix #4493

* Update project_dependencies.py (#4459)

# `Fixed` when I get no markers key in the version_value variable.

```bash
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main
    flet_cli.cli.main()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main
    args.handler(args)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle
    self.package_python_app()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app
    toml_dependencies = get_poetry_dependencies(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies
    format_dependency_version(dependency, version)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version
    if version_value["markers"]:
       ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'markers'
```

* Fix PyInstaller hook to avoid download Flet app bundle on first run (#4552)

* Fix PyInstaller hook to avoid download Flet app bundle on first run

Fix #4549

* Fix web job

* Support `git`, `path`, `url` Poetry-style dependencies in pyproject.toml (#4554)

Fix #4547

* Prepare Flet 0.25.2 (#4541)

* feat: implement `Window.ignore_mouse_events` (#4465)

* Update project_dependencies.py (#4459)

# `Fixed` when I get no markers key in the version_value variable.

```bash
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main
    flet_cli.cli.main()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main
    args.handler(args)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle
    self.package_python_app()
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app
    toml_dependencies = get_poetry_dependencies(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies
    format_dependency_version(dependency, version)
  File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version
    if version_value["markers"]:
       ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'markers'
```

* Remove `v0.26.0` deprecations (#4479)

* delete deprecations on py end

* delete deprecations on dart end

* fix: `SafeArea` object has no attribute `_SafeArea__minimum` (#4500)

* remove minimum from SafeArea

* remove deprecated props

* Changelog updated

* Fix publishing flet-windows.zip to releases

* Revert "Merge branch 'main' into feodor/prepare-0-25-2"

This reverts commit 32a7343, reversing
changes made to 3dc01e1.

* Changelog updated

* Update changelog.

* Changelog updated with cherry-picked bug fixes

* fix broken `Map.center_on()` and default animations (#4519)

* fix center_on

* get default animation duration and curve

* fix: Tooltip corruption in `Segment` and `BarChartRod` on `update()` (#4525)

* avoid jsonDecoding `Segment` and `BarChartRod` tooltips

* avoid jsonEncoding `Segment` and `BarChartRod` tooltips

* Unset theme visual density default

* Unset `SegmentedButton` border side default

* `TextField.hint_text` should be displayed if `label` is not specified

* fix: Setting `CheckBox.border_side.stroke_align` to an Enum fails (#4526)

* `BorderSideStrokeAlign` should inherit from float

* properly parse `Chip.border_side`

* fix:`ControlState` should be resolved based on user-defined order (#4556)

* ControlState: rename "" to "default"

* resolve ControlState on user-defined order

* fix failing tests

* remove breaking line

* fix wrong attribute name (#4557)

* Publish flet wheels to GitHub releases

* remove redeclared `MapPointerDeviceType`

---------

Co-authored-by: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Co-authored-by: Osama Mohammed Al-zabidi <57198110+omamkaz@users.noreply.github.com>
Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>

* wrap CupertinoBottomSheet content in a Material

---------

Co-authored-by: Feodor Fitsner <feodor@appveyor.com>
Co-authored-by: Osama Mohammed Al-zabidi <57198110+omamkaz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working packaging Related to app packaging
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants