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

Pip install version 3.0.0 is not up to date // Partially broken #77

Open
gmaOCR opened this issue Dec 3, 2024 · 4 comments
Open

Pip install version 3.0.0 is not up to date // Partially broken #77

gmaOCR opened this issue Dec 3, 2024 · 4 comments

Comments

@gmaOCR
Copy link

gmaOCR commented Dec 3, 2024

https://pypi.org/project/django-oscar-elasticsearch/ version is from 20th of september.
Some CLI command like python manage.py update_oscar_index need a "newer" version:

Traceback (most recent call last):
  File "/home/greg/PythonProject/shop-oscar/manage.py", line 22, in <module>
    main()
    ~~~~^^
  File "/home/greg/PythonProject/shop-oscar/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
    ~~~~~~~~~~~~~~~^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar_elasticsearch/search/management/commands/update_oscar_index.py", line 7, in handle
    call_command("update_index_products")
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/django/core/management/__init__.py", line 194, in call_command
    return command.execute(*args, **defaults)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar_elasticsearch/search/management/commands/update_index_products.py", line 28, in handle
    index.reindex_objects(chunk)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar_elasticsearch/search/indexing/indexer.py", line 136, in reindex_objects
    es_data = self.make_documents(objects)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar_elasticsearch/search/api/product.py", line 59, in make_documents
    ProductElasticSearchMapping = get_class(
        "search.mappings.products", "ProductElasticSearchMapping"
    )
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 40, in get_class
    return get_classes(module_label, [classname], module_prefix)[0]
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 50, in get_classes
    return class_loader(module_label, classnames, module_prefix)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 120, in default_class_loader
    local_module = _import_module(local_module_label, classnames)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 141, in _import_module
    return __import__(module_label, fromlist=classnames)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar_elasticsearch/search/mappings/__init__.py", line 1, in <module>
    from .categories import *
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar_elasticsearch/search/mappings/categories.py", line 11, in <module>
    OscarElasticSearchResourceMixin = get_class(
        "search.mappings.mixins", "OscarElasticSearchResourceMixin"
    )
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 40, in get_class
    return get_classes(module_label, [classname], module_prefix)[0]
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 50, in get_classes
    return class_loader(module_label, classnames, module_prefix)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 120, in default_class_loader
    local_module = _import_module(local_module_label, classnames)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar/core/loading.py", line 141, in _import_module
    return __import__(module_label, fromlist=classnames)
  File "/home/greg/PythonProject/shop-oscar/env/lib/python3.13/site-packages/oscar_elasticsearch/search/mappings/mixins.py", line 1, in <module>
    from oscar_odin.resources._base import OscarResource
ModuleNotFoundError: No module named 'oscar_odin.resources._base'

One of the difference can be seen in search>mappings>mixins.py . The lines:

from oscar.core.loading import get_class

OscarResource = get_class("oscar_odin.resources.base", "OscarResource")

are missing and mandatory.
You can also compare with the sandbox which is up to date

@specialunderwear
Copy link
Member

Yeah I think the odin version is too new, try pip install "django-oscar-odin < 3.0" and see if that works?

@gmaOCR
Copy link
Author

gmaOCR commented Dec 3, 2024

The conflict is caused by:
    The user requested django-oscar-odin<0.3.0
    django-oscar-elasticsearch 3.0.0 depends on django-oscar-odin>=0.3.0

Should I force the install ? Req from elasticsearch is 0.3.0 mini

FYI: pip install git+https://github.com/django-oscar/django-oscar-elasticsearch.git@4b46d8396d4180bf8ef5371abeace7ed55195d70 works well !

@joeyjurjens
Copy link
Contributor

django-oscar-elasticsearch needs a new release. It has been a while since it was released.

@viggo-devries can you do this this week maybe?

@gmaOCR
Copy link
Author

gmaOCR commented Jan 21, 2025

Any news ?

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

3 participants