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

[BUG] Namespace conflict with scikit's ninja #1395

Open
Lrakotoson opened this issue Jan 22, 2025 · 1 comment
Open

[BUG] Namespace conflict with scikit's ninja #1395

Lrakotoson opened this issue Jan 22, 2025 · 1 comment

Comments

@Lrakotoson
Copy link

Describe the bug

django-ninja uses the same namespace as the scikit build ninja package.
When it is needed for both to work on the same environment, this conflict causes:

  • the last installed to overwrite the files of first in site-packages
  • the namespace conflict: import ninja; from ninja import xxx

What did not work

Separate directory installation: poetry or pip custom path, manual package folder renaming.
This did not work as django-ninja uses itself the namespace ninja, so internal import are broken.
This cannot, practically, be done the other way (eg: changing ninja to scikit_ninja) as there are more packages depending on ninja than django-ninja (which is also higher level).

What did work for now

Changing django-ninja namespace: in a local fork, I changed every occurrence of ninja to django_ninja

Versions:

  • Python version: 3.12
  • Django version: 5.1
  • Django-Ninja version: 1.3.0
  • Pydantic version: 2.10.3
@baseplate-admin
Copy link
Contributor

baseplate-admin commented Jan 23, 2025

This sounds more of a python issue to me than django-ninja

I dont think adding relative import in a pythonic codebase is good

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

2 participants