Skip to content

Commit

Permalink
Update project_dependencies.py (#4459)
Browse files Browse the repository at this point in the history
# `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'
```
  • Loading branch information
omamkaz authored Dec 3, 2024
1 parent 0727bdd commit d5fe9c5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ def format_dependency_version(dependency: str, version_value: Any):
suffix = ""
if isinstance(version_value, dict):
version = version_value["version"]
if version_value["markers"]:
suffix = f";{version_value['markers']}"
markers = version_value.get("markers")
if markers is not None:
suffix = f";{markers}"
else:
version = version_value

Expand Down

0 comments on commit d5fe9c5

Please sign in to comment.