OurchiveIO / ourchive

An easily installable fiction, audio, and image archive package.
GNU General Public License v3.0
7 stars 6 forks source link

Local dev docs do not mention importer_requirements.txt #115

Closed jdm closed 3 months ago

jdm commented 6 months ago

Describe the bug I tried to follow the steps in local-dev.md, but received a python import error on python manage.py migrate.

To Reproduce

  1. clone the repo
  2. set up a venv
  3. run pip install -r requirements.txt
  4. run python manage.py migrate
Traceback (most recent call last):
  File "/Users/jdm/src/ourchive/ourchive_app/manage.py", line 21, in <module>
    main()
  File "/Users/jdm/src/ourchive/ourchive_app/manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/Users/jdm/src/ourchive/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/Users/jdm/src/ourchive/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/Users/jdm/src/ourchive/venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/jdm/src/ourchive/venv/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate
    app_config.ready()
  File "/Users/jdm/src/ourchive/venv/lib/python3.11/site-packages/django/contrib/admin/apps.py", line 27, in ready
    self.module.autodiscover()
  File "/Users/jdm/src/ourchive/venv/lib/python3.11/site-packages/django/contrib/admin/__init__.py", line 50, in autodiscover
    autodiscover_modules("admin", register_to=site)
  File "/Users/jdm/src/ourchive/venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 58, in autodiscover_modules
    import_module("%s.%s" % (app_config.name, module_to_search))
  File "/usr/local/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/jdm/src/ourchive/ourchive_app/etl/admin.py", line 3, in <module>
    from .ao3 import work_import as importer
  File "/Users/jdm/src/ourchive/ourchive_app/etl/ao3/work_import.py", line 1, in <module>
    from ourchiveao3importer.work_list import WorkList
ModuleNotFoundError: No module named 'ourchiveao3importer'

Expected behavior The command completes successfully.

Desktop:

I was able to make progress by running pip install -r importer_requirements.txt.

c-e-p commented 5 months ago

Thank you! This is pushed to the dev branch @jdm. We had importer_requirements as a workaround as GitHub Actions wasn't working with a git-hosted repo for requirements, but this is no longer a concern and the additional file just adds complexity - so we've removed it.

This will be part of the v0.5 release on Feb 24 but is in dev now - feel free to pull & test and ping here if there are any issues.

c-e-p commented 3 months ago

Closing as I believe this is resolved.