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

enable sqlite math functions on macos #91045

Closed
lyinch mannequin opened this issue Mar 1, 2022 · 6 comments
Closed

enable sqlite math functions on macos #91045

lyinch mannequin opened this issue Mar 1, 2022 · 6 comments
Labels
3.11 only security fixes OS-mac stdlib Python modules in the Lib dir topic-sqlite3 type-feature A feature request or enhancement

Comments

@lyinch
Copy link
Mannequin

lyinch mannequin commented Mar 1, 2022

BPO 46889
Nosy @ronaldoussoren, @ned-deily, @erlend-aasland, @lyinch
PRs
  • bpo-46889 Add compile flag for math support for sqlite3 on macos #31635
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2022-03-02.17:20:18.596>
    created_at = <Date 2022-03-01.15:18:14.604>
    labels = ['OS-mac', 'type-feature', 'library', '3.11']
    title = 'enable sqlite math functions on macos'
    updated_at = <Date 2022-03-02.17:20:18.595>
    user = 'https://github.com/lyinch'

    bugs.python.org fields:

    activity = <Date 2022-03-02.17:20:18.595>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-03-02.17:20:18.596>
    closer = 'ned.deily'
    components = ['Library (Lib)', 'macOS']
    creation = <Date 2022-03-01.15:18:14.604>
    creator = 'lyinch'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46889
    keywords = ['patch']
    message_count = 6.0
    messages = ['414272', '414374', '414375', '414376', '414377', '414381']
    nosy_count = 4.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'erlendaasland', 'lyinch']
    pr_nums = ['31635']
    priority = 'normal'
    resolution = 'works for me'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue46889'
    versions = ['Python 3.11']

    @lyinch
    Copy link
    Mannequin Author

    lyinch mannequin commented Mar 1, 2022

    Similar to these PRs: https://github.com/python/cpython/pull/24053/files and https://github.com/python/cpython/pull/25892/files which enable the built-in sqlite3 math functions for Windows, I want to have support for them on macos. As per the sqlite3 documentation: https://sqlite.org/releaselog/3_35_0.html this requires compilation with -DSQLITE_ENABLE_MATH_FUNCTIONS . On master, the flag is missing for macos : https://github.com/python/cpython/blob/main/Mac/BuildScript/build-installer.py#L364

    @lyinch lyinch mannequin added 3.11 only security fixes stdlib Python modules in the Lib dir OS-mac type-feature A feature request or enhancement labels Mar 1, 2022
    @erlend-aasland
    Copy link
    Contributor

    This is not needed. Quoting https://sqlite.org/compile.html#enable_math_functions:

    This option is automatically added to the Makefile by the configure script on unix platforms, unless the --disable-math option is used.
    

    @erlend-aasland
    Copy link
    Contributor

    Suggesting to close as "not a bug".

    @erlend-aasland
    Copy link
    Contributor

    Duplicate of bpo-42686.

    @erlend-aasland
    Copy link
    Contributor

    FTR, here's 3.10 and 3.11 on my Mac, using the official Python.org installers:

        $ python3.10
        Python 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import sqlite3
        >>> cx = sqlite3.connect(":memory:")
        >>> cx.execute("select sin('1')").fetchone()
        (0.8414709848078965,)
    
        $ python3.11
        Python 3.11.0a5 (v3.11.0a5:c4e4b91557, Feb  3 2022, 14:54:01) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import sqlite3
        >>> cx = sqlite3.connect(":memory:")
        >>> cx.execute("select sin('1')").fetchone()
        (0.8414709848078965,)

    @ned-deily
    Copy link
    Member

    Thanks for the suggested PR. And thanks for noticing, Erlend! I should have checked with you first!

    To reiterate what I noted on the PR, this (reduntant) change would only have affected the Pythons provided by the python.org macOS installers; this behavior doesn't necessarily apply to all macOS Pythons. In particular, it appears that the Apple-provided system libsqlite3 does not have this option enabled so if you are building Python on macOS you'd need to supply another version of libsqlite3, like from a third-party distributor (say MacPorts or Homebrew) or build it yourself.

    @ned-deily ned-deily removed the invalid label Mar 2, 2022
    @ned-deily ned-deily removed the invalid label Mar 2, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes OS-mac stdlib Python modules in the Lib dir topic-sqlite3 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants