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

Importing fails since logging.yaml is not included in package. #9

Open
acederberg opened this issue Sep 13, 2024 · 1 comment
Open

Comments

@acederberg
Copy link
Owner

Installing in a virtual environment and saying captura config results in

Traceback (most recent call last):
  File "/home/adrian/Projects/LiftsExtension/.venv/bin/captura", line 5, in <module>
    from captura.__main__ import main
  File "/home/adrian/Projects/LiftsExtension/.venv/lib/python3.12/site-packages/captura/__init__.py", line 5, in <module>
    from . import hooks, util
  File "/home/adrian/Projects/LiftsExtension/.venv/lib/python3.12/site-packages/captura/hooks.py", line 9, in <module>
    from captura import util
  File "/home/adrian/Projects/LiftsExtension/.venv/lib/python3.12/site-packages/captura/util.py", line 167, in <module>
    DEFAULT_LOGGING_CONFIG, _get_logger = setup_logging()
                                          ^^^^^^^^^^^^^^^
  File "/home/adrian/Projects/LiftsExtension/.venv/lib/python3.12/site-packages/captura/util.py", line 159, in setup_logging
    with open(config_path, "r") as file:
         ^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: /home/adrian/Projects/LiftsExtension/.venv/lib/python3.12/logging.yaml'
@acederberg
Copy link
Owner Author

acederberg commented Oct 15, 2024

Frustratingly this is not fixed in version 0.1.9. Running captura results in

Traceback (most recent call last):
  File "/home/sisyphus/.venv/bin/captura", line 5, in <module>
    from captura.__main__ import main
  File "/home/sisyphus/.venv/lib/python3.11/site-packages/captura/__init__.py", line 5, in <module>
    from . import hooks, util
  File "/home/sisyphus/.venv/lib/python3.11/site-packages/captura/hooks.py", line 9, in <module>
    from captura import util
  File "/home/sisyphus/.venv/lib/python3.11/site-packages/captura/util.py", line 167, in <module>
    DEFAULT_LOGGING_CONFIG, _get_logger = setup_logging()
                                          ^^^^^^^^^^^^^^^
  File "/home/sisyphus/.venv/lib/python3.11/site-packages/captura/util.py", line 159, in setup_logging
    with open(config_path, "r") as file:
         ^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/sisyphus/.venv/lib/python3.11/logging.yaml'

This happens because the project root is used to determine where captura is installed, which is not the case when it comes from pypi.

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

No branches or pull requests

1 participant