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

How do I build this addon? / Old build instructions fail with FileNotFoundError #197

Open
2 of 3 tasks
starptr opened this issue Sep 3, 2024 · 2 comments
Open
2 of 3 tasks
Labels
question Further information is requested

Comments

@starptr
Copy link

starptr commented Sep 3, 2024

See #197 (comment)


Checklist

Please replace the space inside the brackets with an x if the following items apply:

  • I've verified that I use the latest version of the add-on by redownloading it from AnkiWeb
  • I've verified that I use the latest version of Anki by checking at https://apps.ankiweb.net#download
  • I've checked if anyone else asked this question before by looking through the issue reports.

Your question

I installed aab with Qt support using

pip install --upgrade git+https://github.com/glutanimate/anki-addon-builder.git#egg=aab[qt5,qt6]

as described in anki-addon-builder. But when I run aab build, the build seems to fail from a file not getting found in the optional resources.

Anki Add-on Builder v1.0.0-dev.5

Copyright (C) 2016-2022  Aristotelis P. (Glutanimate)  <https://glutanimate.com>

This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions; For details please see the LICENSE file.

Getting Git version info...

=== Build task 1/1 ===

--- Building Review Heatmap v1.0.1 for local ---

Preparing source tree for Review Heatmap v1.0.1 ...
Cleaning repository...
Exporting Git archive...
Copying licenses...
Copying changelog...
Writing manifest...
Starting UI build tasks for target 'qt5'...
Qt resources folder found. Attempting to migrate...
Traceback (most recent call last):
  File "/Users/yuto/src/review-heatmap-upstream/.venv/bin/aab", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/yuto/src/review-heatmap-upstream/.venv/lib/python3.12/site-packages/aab/cli.py", line 310, in main
    args.func(args)
  File "/Users/yuto/src/review-heatmap-upstream/.venv/lib/python3.12/site-packages/aab/cli.py", line 92, in build
    builder.build(qt_versions=qt_versions, disttype=dist)
  File "/Users/yuto/src/review-heatmap-upstream/.venv/lib/python3.12/site-packages/aab/builder.py", line 89, in build
    self.build_dist(qt_versions=qt_versions, disttype=disttype, pyenv=pyenv)
  File "/Users/yuto/src/review-heatmap-upstream/.venv/lib/python3.12/site-packages/aab/builder.py", line 120, in build_dist
    if ui_builder.build(qt_version=qt_version, pyenv=pyenv):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yuto/src/review-heatmap-upstream/.venv/lib/python3.12/site-packages/aab/ui.py", line 142, in build
    resource_prefixes_to_replace = self._migrate_resources()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yuto/src/review-heatmap-upstream/.venv/lib/python3.12/site-packages/aab/ui.py", line 305, in _migrate_resources
    integration_snippet = migrator.migrate_resources(resources=resources)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yuto/src/review-heatmap-upstream/.venv/lib/python3.12/site-packages/aab/legacy.py", line 168, in migrate_resources
    shutil.copy(source_path, target_path)
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 435, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 260, in copyfile
    with open(src, 'rb') as fsrc:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/yuto/src/review-heatmap-upstream/build/dist/resources/icons/optional/patreon.svg'

I'm using a MacOS laptop and python 3.12.4. Any pointers appreciated :)

@starptr starptr added the question Further information is requested label Sep 3, 2024
@starptr
Copy link
Author

starptr commented Sep 5, 2024

Actually, I noticed that the readme says this project's build system has changed. If there's a quick & dirty way to build this project until proper documentation is written, I'll take that too!

@starptr starptr changed the title Build fails with FileNotFoundError How do I build this addon? / Old build instructions fail with FileNotFoundError Sep 5, 2024
@romulofer
Copy link

I would also love to know

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

No branches or pull requests

2 participants