Bug 253115 - www/trac-devel: Fix dependency to SQLite3 support
Summary: www/trac-devel: Fix dependency to SQLite3 support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Oleksii Samorukov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-31 05:29 UTC by Norikatsu Shigemura
Modified: 2021-02-01 12:21 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (samm)


Attachments
add a force dependency on databases/py-sqlite3. (1.61 KB, patch)
2021-01-31 05:29 UTC, Norikatsu Shigemura
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Norikatsu Shigemura 2021-01-31 05:29:01 UTC
Created attachment 222033 [details]
add a force dependency on databases/py-sqlite3.

Hi.
In recently www/trac-devel(1.5 and after), it's required SQLite3 module.
So, to fix dependency error even if we don't want a SQLite3 database,
please apply attached a patch.


= A error message with trac on uwsgi ===================================
*** Operational MODE: threaded ***
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/trac/db/sqlite_backend.py", line 37, in <module>
    import pysqlite2.dbapi2 as sqlite
ModuleNotFoundError: No module named 'pysqlite2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/trac/web/main.py", line 40, in <module>
    from trac.env import open_environment
  File "/usr/local/lib/python3.7/site-packages/trac/env.py", line 42, in <module>
    from trac.db.convert import copy_tables
  File "/usr/local/lib/python3.7/site-packages/trac/db/convert.py", line 18, in <module>
    from trac.db import sqlite_backend
  File "/usr/local/lib/python3.7/site-packages/trac/db/sqlite_backend.py", line 39, in <module>
    import sqlite3 as sqlite
  File "/usr/local/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
unable to load app 0 (mountpoint='') (callable not found or import error)
Comment 1 KONDOU, Kazuhiro 2021-01-31 07:25:55 UTC
trac-admin command requires py-sqlite3 backend in trac/db/convert.py. (for convert_db sub command)

> from trac.db import sqlite_backend

But, this patch does not seem to be able to convert between MySQL and PostgreSQL.

Maybe the DB backend should be selectable with checkboxes.
Comment 2 Oleksii Samorukov freebsd_committer freebsd_triage 2021-01-31 10:29:26 UTC
Hi, according to my knowledge it depends on the backend you choosing. So not needed in case of MySQL or PgSQL backends. Please let me know if i am not correct.
Comment 3 Oleksii Samorukov freebsd_committer freebsd_triage 2021-01-31 10:31:01 UTC
Ah, i see. Convert command is kind of specific edge case. I do not want to set dependency on it.
Comment 4 Oleksii Samorukov freebsd_committer freebsd_triage 2021-01-31 10:32:47 UTC
But i see your point. In fact you are right, it should not be radio but checkboxes. As one may serve few trac envs on the same hosts, with a different backends. Let me fix that.
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-01-31 10:47:24 UTC
A commit references this bug:

Author: samm
Date: Sun Jan 31 10:47:03 UTC 2021
New revision: 563484
URL: https://svnweb.freebsd.org/changeset/ports/563484

Log:
  www/trac-devel: allow to select multiply database backends

  Trac supports multiply environments with different database backends. Also it
  enable usage of the "convert" admin command to migrate between backends

  PR:		253115
  Reported by:	nork@ninth-nine.com

Changes:
  head/www/trac-devel/Makefile
Comment 6 Oleksii Samorukov freebsd_committer freebsd_triage 2021-01-31 10:48:55 UTC
Fixed in r563484. It is now possible to select > 1 database backend. Thank you for reporting!
Comment 7 Norikatsu Shigemura 2021-01-31 19:53:19 UTC
Hi Alex,

Thank you, but my report's theme is
not OPTIONS_RADIO v.s. OPTIONS_MULTI, and
    No SQLite3 No Trac.
Comment 8 Norikatsu Shigemura 2021-01-31 19:56:07 UTC
Hi Oleksii,

I'm sorry, you are Oleksii not Alex.
Comment 9 Oleksii Samorukov freebsd_committer freebsd_triage 2021-02-01 12:21:51 UTC
Hi, i explained why i dont want to set mandatory dependency on SQLite. Instead i did ability to select > 1 sql backend, so your use-case is covered. Please let me know if you think that its not working for you.