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

Update project_dependencies.py #4459

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

omamkaz
Copy link
Contributor

@omamkaz omamkaz commented Dec 1, 2024

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

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'

Description

Test Code

# Test code for the review of this PR

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Screenshots

Additional details

Summary by Sourcery

Bug Fixes:

  • Fix a KeyError in format_dependency_version by using get() to safely access the 'markers' key.

# `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'
```
@CLAassistant
Copy link

CLAassistant commented Dec 1, 2024

CLA assistant check
All committers have signed the CLA.

@omamkaz
Copy link
Contributor Author

omamkaz commented Dec 1, 2024

  • Fixed flet_cli/utils/project_dependencies.py

@FeodorFitsner FeodorFitsner merged commit d5fe9c5 into flet-dev:main Dec 3, 2024
2 checks passed
@omamkaz omamkaz deleted the patch-2 branch December 4, 2024 22:30
FeodorFitsner pushed a commit that referenced this pull request Dec 10, 2024
# `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'
```
FeodorFitsner added a commit that referenced this pull request Dec 13, 2024
* 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 <[email protected]>
Co-authored-by: Osama Mohammed Al-zabidi <[email protected]>
Co-authored-by: ndonkoHenri <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants