Skip to content

Use python-bundled sqlite3 library instead of py-sqlite3#26

Closed
svmhdvn wants to merge 1 commit into
markjdb:masterfrom
svmhdvn:push-mvntupwxlloy
Closed

Use python-bundled sqlite3 library instead of py-sqlite3#26
svmhdvn wants to merge 1 commit into
markjdb:masterfrom
svmhdvn:push-mvntupwxlloy

Conversation

@svmhdvn

@svmhdvn svmhdvn commented May 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@svmhdvn svmhdvn marked this pull request as draft May 5, 2026 15:19
@svmhdvn svmhdvn marked this pull request as ready for review May 5, 2026 15:20
@svmhdvn

svmhdvn commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

Might need a bit of testing on your machine. Hatch is making things a bit funny here, but it should work.

@markjdb markjdb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS the python shipped with FreeBSD doesn't have sqlite3 bundled. I see _sqlite3 in the DISABLED_EXTENSIONS list in the port makefiles, and:

markj@xinde> python
Python 3.11.15 (main, Apr  7 2026, 01:08:37) [Clang 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd7080 on freebsd16
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.11/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

One can install py-sqlite3 to get the "builtin" module, but the intent was to try and minimize system dependencies. So, if we do this we should update the README to list required packages.

@svmhdvn

svmhdvn commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

py-sqlite3 still needs the system dependency to build successfully, since it's building from source using /usr/local/include/sqlite.h.

I think this still adheres to the "lower dependencies" goal. Most non-freebsd distributions will include it in their python packages, since there usually isn't a choice in customization like there is in the Ports collection. And on FreeBSD, we will still need to install something (databases/py-sqlite3 port vs pysqlite3 with built-from-source components in PyPI).

@markjdb

markjdb commented May 5, 2026

Copy link
Copy Markdown
Owner

py-sqlite3 still needs the system dependency to build successfully, since it's building from source using /usr/local/include/sqlite.h.

I think this still adheres to the "lower dependencies" goal. Most non-freebsd distributions will include it in their python packages, since there usually isn't a choice in customization like there is in the Ports collection. And on FreeBSD, we will still need to install something (databases/py-sqlite3 port vs pysqlite3 with built-from-source components in PyPI).

Ok, then do you mind updating the README as well?

@ngie-eign

ngie-eign commented May 7, 2026

Copy link
Copy Markdown

The alternative approach I took in #27 was to document the need for installing py311-sqlite3. This is the package that comes with cpython.

@markjdb

markjdb commented May 7, 2026

Copy link
Copy Markdown
Owner

I took @ngie-eign's commit, thanks.

@markjdb markjdb closed this May 7, 2026
@svmhdvn svmhdvn deleted the push-mvntupwxlloy branch May 7, 2026 16:33
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

Successfully merging this pull request may close these issues.

3 participants