[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-25 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 53efbf3977a44e382397e7994a2524b4f8c9d053 by Nick Coghlan in branch 'master': bpo-11063: Handle uuid.h being in default include path (GH-4565) https://github.com/python/cpython/commit/53efbf3977a44e382397e7994a2524b4f8c9d053 -- __

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-25 Thread Nick Coghlan
Nick Coghlan added the comment: The header file check in setup.py incorrectly reported "not found" if `uuid.h` was in one of the standard include directories, so I've submitted a tweak to fix that: https://github.com/python/cpython/pull/4565 -- nosy: +ncoghlan ___

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-25 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +4493 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-08 Thread Berker Peksag
Berker Peksag added the comment: New changeset 0e163d2ced28ade8ff526e8c663faf03c2c0b168 by Berker Peksag in branch 'master': bpo-11063: Use more reliable way to check if uuid function exists (GH-4343) https://github.com/python/cpython/commit/0e163d2ced28ade8ff526e8c663faf03c2c0b168 -

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-08 Thread Berker Peksag
Berker Peksag added the comment: It worked for me on OS X (returns no) and Linux (returns yes after I installed uuid-dev) but I didn't test it on both systems at the same. Travis CI also returned 'no': https://travis-ci.org/python/cpython/jobs/299285001 In any case, Serhiy's suggestion is bet

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-08 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: +4301 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-08 Thread Stefan Krah
Stefan Krah added the comment: On Wed, Nov 08, 2017 at 08:28:10PM +, Serhiy Storchaka wrote: > Does this check work? I tried similar checks with other functions and they > were falsely passed because calling an undeclared function is not an error in > C. Not here. If I replace uuid_genera

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does this check work? I tried similar checks with other functions and they were falsely passed because calling an undeclared function is not an error in C. The reliable check of the existence of the uuid_generate_time_safe function is: void *x = uuid_ge

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-08 Thread Berker Peksag
Change by Berker Peksag : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-08 Thread Berker Peksag
Berker Peksag added the comment: New changeset 9a10ff4deb2494e22bc0dbea3e3a6f9e8354d995 by Berker Peksag in branch 'master': bpo-11063: Add a configure check for uuid_generate_time_safe (GH-4287) https://github.com/python/cpython/commit/9a10ff4deb2494e22bc0dbea3e3a6f9e8354d995 -- __

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-06 Thread STINNER Victor
STINNER Victor added the comment: """ Unrelated to the patch (same before and after), this looks odd to me: >>> import uuid >>> uuid._has_uuid_generate_time_safe is None True >>> >>> import _uuid >>> _uuid.has_uuid_generate_time_safe 1 """ None means "not initialized yet". It's initialized o

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-05 Thread Stefan Krah
Stefan Krah added the comment: Berker's latest patch looks good to me. Unrelated to the patch (same before and after), this looks odd to me: >>> import uuid >>> uuid._has_uuid_generate_time_safe is None True >>> >>> import _uuid >>> _uuid.has_uuid_generate_time_safe 1 [Also, I thought we we

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-05 Thread Berker Peksag
Berker Peksag added the comment: I've followed Stefan's suggestion and opened PR 4287 (tested on 10.10.5) -- nosy: +berker.peksag ___ Python tracker ___ ___

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-11-05 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: +4250 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread Stefan Krah
Stefan Krah added the comment: I think the configure check should be this (sets HAVE_LIBUUID in pyconfig.h): diff --git a/configure.ac b/configure.ac index 41bd9effbf..90d53c1b7d 100644 --- a/configure.ac +++ b/configure.ac @@ -2657,6 +2657,7 @@ AC_MSG_RESULT($SHLIBS) AC_CHECK_LIB(sendfile, se

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread Ned Deily
Ned Deily added the comment: I agree with Barry's comment on PR 3855: "I'd rather see a configure check for the existence of uuid_generate_time_safe() rather than hard coding it to platforms !APPLE for two reasons. 1) If macOS ever adds this API in some future release, this ifndef will be inc

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4337a0d9955f0855ba38ef30feec3858d304abf0 by Victor Stinner in branch 'master': bpo-11063: Fix _uuid module on macOS (#3855) https://github.com/python/cpython/commit/4337a0d9955f0855ba38ef30feec3858d304abf0 -- __

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread STINNER Victor
STINNER Victor added the comment: I proposed PR 3855 to add macOS support to _uuid (and fix the compilation error). -- ___ Python tracker ___ _

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +3835 stage: resolved -> patch review ___ Python tracker ___ ___ Python-bugs-list mailin

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: pkg-config is a Linux-ism. But Linux already works fine... $ uname Darwin $ pkg-config -bash: pkg-config: command not found -- ___ Python tracker _

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread STINNER Victor
STINNER Victor added the comment: > Though I don't know how to reuse the find_file() logic in configure... Maybe we could use pkg-config instead? haypo@selma$ pkg-config uuid --cflags -I/usr/include/uuid haypo@selma$ pkg-config uuid --libs -luuid -- _

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Though I don't know how to reuse the find_file() logic in configure... -- ___ Python tracker ___ _

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Would it possible to check if uuid_generate_time_safe() is available, maybe > in configure? That's probably possible. -- ___ Python tracker __

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-10-02 Thread STINNER Victor
STINNER Victor added the comment: > It's expected if uuid_generate_time_safe() isn't available on your platform. > But test_uuid still passes? I would prefer to avoid compilation errors on a popular platforms like macOS. Would it possible to check if uuid_generate_time_safe() is available, m

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's expected if uuid_generate_time_safe() isn't available on your platform. But test_uuid still passes? -- ___ Python tracker ___ _

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-29 Thread Łukasz Langa
Łukasz Langa added the comment: uuid fails to build for me on master since that change landed: cpython/Modules/_uuidmodule.c:13:11: error: implicit declaration of function 'uuid_generate_time_safe' is invalid in C99 [-Werror,-Wimplicit-function-declaration] res = uuid_generate_time_

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Crude import benchmark (Ubuntu): * before: $ time ./python -c "import uuid" real0m0.074s user0m0.056s sys 0m0.012s * after: $ time ./python -c "import uuid" real0m0.030s user0m0.028s sys 0m0.000s * baseline: $ time ./python -c pas

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor
STINNER Victor added the comment: I ran two benchmarks on my Fedora 26. * new = master (commit a106aec2ed6ba171838ca7e6ba43c4e722bbecd1) * ref = commit 8d59aca4a953b097a9b02b0ecafef840e4ac5855 git co master ./python -m perf timeit -s 'import sys, uuid' "del sys.modules['uuid']; import uuid; u

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset a106aec2ed6ba171838ca7e6ba43c4e722bbecd1 by Antoine Pitrou in branch 'master': bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid (#3796) https://github.com/python/cpython/commit/a106aec2ed6ba171838ca7e6ba43c4e722bbecd1 ---

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor
STINNER Victor added the comment: I abandonned my PR and started to review Antoine's PR 3796 which basically combines all previous patches proposed last 6 years :-) -- ___ Python tracker

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +3784 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor
Change by STINNER Victor : -- title: uuid.py module import has heavy side effects -> Rework uuid module: lazy initialization and add a new C extension ___ Python tracker ___ __