maxirobaina / django-firebird

Firebird SQL backend for Django web framework
BSD 3-Clause "New" or "Revised" License
67 stars 47 forks source link

Time to rename django-firebird python package #130

Open maxirobaina opened 2 years ago

maxirobaina commented 2 years ago

Since the last update of django-firebird at master branch, the old python driver fdb was replaced by the new and official firebird driver [1] which just work with Firebird 3+, Python 3.8+

The python firebird-driver package and the django-firebird package, both are called firebird [2] so, this make a namespaces conflict when these are called for import.

Error loading firebird driver: No module named 'firebird.base.config'; 'firebird.base' is not a package [3]

A solution is copy (or symlink) the django-firebird package into django.db.backends. namespace but is not a good practice.

So, maybe is time to rename the firebird package from django-firebird to avoid any conflict.

Suggestions:

[1] https://pypi.org/project/firebird-driver/ [2] django-firebird is just the project name.

[3] Fulll traceback as example

Python 3.9.9 (main, Apr  3 2022, 20:39:45) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from firebird import base
Traceback (most recent call last):
  File "/home/maxi/.pyenv/versions/django/lib/python3.9/site-packages/firebird/base.py", line 6, in <module>
    import firebird.driver as Database
  File "/home/maxi/.pyenv/versions/django/lib/python3.9/site-packages/firebird/driver/__init__.py", line 38, in <module>
    from .config import driver_config, ServerConfig, DatabaseConfig, DriverConfig
  File "/home/maxi/.pyenv/versions/django/lib/python3.9/site-packages/firebird/driver/config.py", line 43, in <module>
    from firebird.base.config import Config, StrOption, IntOption, BoolOption, EnumOption, \
ModuleNotFoundError: No module named 'firebird.base.config'; 'firebird.base' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/maxi/.pyenv/versions/django/lib/python3.9/site-packages/firebird/base.py", line 10, in <module>
    raise ImproperlyConfigured("Error loading firebird driver: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading firebird driver: No module named 'firebird.base.config'; 'firebird.base' is not a package
GilShoshan94 commented 2 years ago

I ran into this issue and was just about to write about it too.

I think django_firebird is the best as it matches the project name and follows better the PEP 423 naming convention

mariuz commented 2 years ago

firebirdsql is already taken https://pypi.org/project/firebirdsql/

vasiliy-yashkov commented 4 weeks ago

I agree with @GilShoshan94, django_firebird is the best package name for the driver.