[Python-Dev] Compiling Python with SQLite when SQLite is in an arbitrary place

2019-11-08 Thread Coirier, Emmanuel
Hello everyone,

I've created an issue some months ago of what I considered as bug : 
https://bugs.python.org/issue37784 that I have now closed since it is not 
relevant.

To sum up, when the SQLite binaries are not in a standard place, it seemed for 
me to be impossible to include sqlite into Python. In the end, I noticed I 
missed the CPPFLAGS env variable, that I thought was for C++ compilation.

So why is the setup.py looking into the CPPFLAGS variable instead of the CFLAGS 
variable ?

Best regards,

--
Emmanuel Coirier

Interne
Ce message et toutes les pièces jointes (ci-après le «message») sont 
confidentiels et établis à l’intention exclusive de ses destinataires. Toute 
utilisation de ce message non conforme à sa destination, toute diffusion ou 
toute publication, totale ou partielle, est interdite, sauf autorisation 
expresse. Si vous recevez ce message par erreur, merci de le détruire sans en 
conserver de copie et d’en avertir immédiatement l’expéditeur. Internet ne 
permettant pas de garantir l’intégrité de ce message, la Caisse des Dépôts et 
Consignations décline toute responsabilité au titre de ce message s’il a été 
modifié, altéré, déformé ou falsifié. Par ailleurs et malgré toutes les 
précautions prises pour éviter la présence de virus dans nos envois, nous vous 
recommandons de prendre, de votre côté, les mesures permettant d'assurer la 
non-introduction de virus dans votre système informatique. This email message 
and any attachments (“the email”) are confidential and intended only for the 
recipient(s) indicated. If you are not an intended recipient, please be advised 
that any use, dissemination, forwarding or copying of this email whatsoever is 
prohibited without prior written consent of Caisse des Depots et Consignations. 
If you have received this email in error, please delete it without saving a 
copy and notify the sender immediately. Internet emails are not necessarily 
secure, and Caisse des Depots et Consignations declines responsibility for any 
changes that may have been made to this email after it was sent. While we take 
all reasonable precautions to ensure that viruses are not transmitted via 
emails, we recommend that you take your own measures to prevent viruses from 
entering your computer system.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/RCSJMKYB773UD7UWOU7QXC43MTQ4NW27/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Compiling Python with SQLite when SQLite is in an arbitrary place

2019-11-08 Thread Lele Gaifax
"Coirier, Emmanuel"  writes:

> To sum up, when the SQLite binaries are not in a standard place, it seemed
> for me to be impossible to include sqlite into Python. In the end, I noticed
> I missed the CPPFLAGS env variable, that I thought was for C++ compilation.
>
> So why is the setup.py looking into the CPPFLAGS variable instead of the
> CFLAGS variable ?

AFAIK, CPPFLAGS stands for "C Pre Processor Flags", not C++, so it seems the
right place to put/look for stuff consumed by the preprocessor, as headers
inclusion is.

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/33YKN54LGLTU6VDKBKQXKBZFQQGANBA7/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Summary of Python tracker Issues

2019-11-08 Thread Python tracker

ACTIVITY SUMMARY (2019-11-01 - 2019-11-08)
Python tracker at https://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.

Issues counts and deltas:
  open7140 (+49)
  closed 43359 (+34)
  total  50499 (+83)

Open issues with patches: 2809 


Issues opened (64)
==

#16575: ctypes: unions as arguments
https://bugs.python.org/issue16575  reopened by vstinner

#37527: Timestamp conversion on windows fails with timestamps close to
https://bugs.python.org/issue37527  reopened by p-ganssle

#38668: Update os.path documentation regarding recommended types
https://bugs.python.org/issue38668  opened by lazka

#38669: patch.object should raise another error when first argument is
https://bugs.python.org/issue38669  opened by Elena.Oat

#38670: can we accept os.PathLike objects within the subprocess args= 
https://bugs.python.org/issue38670  opened by gregory.p.smith

#38671: pathlib.Path.resolve(strict=False) returns relative path on Wi
https://bugs.python.org/issue38671  opened by uranusjr

#38672: Crash on mimetypes.init() if there is no access to one of know
https://bugs.python.org/issue38672  opened by Michał Szymaniak

#38673: REPL shows continuation prompt (...) when comment or space ent
https://bugs.python.org/issue38673  opened by gvanrossum

#38675: Sug. for the scope example in TPT Chapter 9
https://bugs.python.org/issue38675  opened by David Goldsmith

#38677: Arraymodule initialization error handling improvements
https://bugs.python.org/issue38677  opened by mpaolini

#38678: TypeError raised trying to run TPT 10.3 Example 2 in Python 3.
https://bugs.python.org/issue38678  opened by David Goldsmith

#38679: Scipy and Scikit learn library installation issues
https://bugs.python.org/issue38679  opened by marvinmckinneyii

#38680: PyGILState_Release does not release gil correctly, resulting i
https://bugs.python.org/issue38680  opened by 123 wlpha

#38681: 2to3 Conversion Result using BlankLine() can be Syntactically 
https://bugs.python.org/issue38681  opened by Samuel Tatasurya

#38682: struct timeval is not declared
https://bugs.python.org/issue38682  opened by Mithil

#38686: WWW-Authenticate qop="auth,auth-int" rejected by urllib
https://bugs.python.org/issue38686  opened by PypeBros

#38687: Expose 'adler32_combine' function from zlib
https://bugs.python.org/issue38687  opened by callumattryde

#38688: Python 3.8 regression: endless loop in shutil.copytree
https://bugs.python.org/issue38688  opened by cboltz

#38689: IDLE crashes when KeyError is raised during calltip generation
https://bugs.python.org/issue38689  opened by bup

#38690: Command line option with &/or without a space results in the s
https://bugs.python.org/issue38690  opened by jgors

#38691: importlib: PYTHONCASEOK should be ignored when using python3 -
https://bugs.python.org/issue38691  opened by vstinner

#38692: add a pidfd child process watcher
https://bugs.python.org/issue38692  opened by benjamin.peterson

#38693: Use f-strings instead of str.format within importlib
https://bugs.python.org/issue38693  opened by gregory.p.smith

#38695: IDLE should restart instead of hanging when subprocess exits
https://bugs.python.org/issue38695  opened by terry.reedy

#38697: test.support.find_unused_port() race condition: test_socket fa
https://bugs.python.org/issue38697  opened by vstinner

#38698: While parsing email message id: UnboundLocalError
https://bugs.python.org/issue38698  opened by Nikita Hoffmann

#38699: socket: change listen() default backlog from 128 to 4096?
https://bugs.python.org/issue38699  opened by vstinner

#38701: datetime.timedelta string representation is ambiguous
https://bugs.python.org/issue38701  opened by lig

#38702: Adding new types to parser/unparse.py
https://bugs.python.org/issue38702  opened by ju-sh

#38704: Prevent installation on unsupported Windows versions
https://bugs.python.org/issue38704  opened by senyai

#38706: What should the error message in the exception raised by asser
https://bugs.python.org/issue38706  opened by mkarotsieris

#38707: Multiprocessing: bug with Native ID for threading.mainthread()
https://bugs.python.org/issue38707  opened by jaketesler

#38708: parse_message_id in email module is very buggy / crashy
https://bugs.python.org/issue38708  opened by xnox

#38709: distutils - setuptools - alias command removes comments from s
https://bugs.python.org/issue38709  opened by acue

#38710: unsynchronized write pointer in io.TextIOWrapper in 'r+' mode
https://bugs.python.org/issue38710  opened by Manuel Ignacio Pérez Alcolea

#38711: setup parameter 'distclass' ignored for configuration files
https://bugs.python.org/issue38711  opened by acue

#38712: add signal.pidfd_send_signal
https://bugs.python.org/issue38712  opened by benjamin.peterson

#38714: setup command alias erroneous for names with hyphens
https://bugs.python.org/issue38714  opened by acue

#38715: Regression in compileall ddir 

[Python-Dev] Re: Compiling Python with SQLite when SQLite is in an arbitrary place

2019-11-08 Thread Brett Cannon
Lele Gaifax wrote:
> "Coirier, Emmanuel" emmanuel.coir...@caissedesdepots.fr
> writes:
> > To sum up, when the SQLite binaries are not in a
> > standard place, it seemed
> > for me to be impossible to include sqlite into Python. In the end, I noticed
> > I missed the CPPFLAGS env variable, that I thought was for C++ compilation.
> > So why is the setup.py looking into the CPPFLAGS variable instead of the
> > CFLAGS variable ?
> > AFAIK, CPPFLAGS stands for "C Pre Processor Flags", not C++, so it seems the
> right place to put/look for stuff consumed by the preprocessor, as headers
> inclusion is.

You're correct, Lele, and this is documented as such when you run `./configure 
-h` and look at the end where we document environment variables that affect 
compilation.

-Brett

> ciao, lele.
> nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
> real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
> l...@metapensiero.it  | -- Fortunato Depero, 1929.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/TO7UDFOJCGZNGWCMP5BCFUXM6KLIKWL4/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Implementation of PEP-0604

2019-11-08 Thread Richard Eames
Hi Philippe and list, 

Long time lurker here, I've had a few spare cycles at $work this week that I 
spent exploring an alternate implementation to PEP604 starting with the 
implementation from Philippe. I don't say "reference implementation", because 
it doesn't implement PEP604 faithfully, but it does try to implement it's goal. 
 My thinking was that the "runtime" component to it only needs to support the 
isinstance/issubclass methods and so can be pretty minimal without need to 
import all the typing.py machinery. At which point, when actual type checking 
was done (anything in typing.py or mypy), the `union` type can be special 
cased, or promoted to a `typing.Union`.

I started by creating a built-in "union" type, that was a thin wrapper around a 
tuple, such that type.__or__ will return `union(lhs, rhs)` which stored the two 
items in a 2-length tuple. I also changed the methods in `typing.Union` to 
return a `union`. However, I hit my first issue: `int | int | str` would then 
return `union(int, union(int, str))`, whereas it should deduplicate the types. 
So, I implemented logic to detect and merge union | union, but changed the 
underlying data to a plain flat tuple. And the next issue I hit was that some 
of the other `typing.py` types weren't being detected as valid types (probably 
due to my limited understanding of the PyObject datastructure/flags), 
specifically, `int | "forwardref"`, I needed a way to signal to typing.py that 
I had a forwardref without importing it. This is where I changed my approach to 
the problem.

I wanted to find a way to have these metatypes (Union/TypeVar/ForwardRef) 
without re-implementing them in c, or importing them. My Idea was to change the 
builtin type to what I called a "shadow type". In the C layer it's just holds a 
tuple of objects/parameters, and has a type field to say what it is, then when 
in the type checking/typing.py layer, if it detects an object is a 
"shadowobject", then it promotes it to a full type. What I liked about this 
approach, is that for isinstance/issubclass, when it see a "shadowobject" it 
can just grab the underlying types from the shadowobject->params tuple and no 
import magic needs to happen. All of the type magic can be left to 
mypy/typing.py without much knowledge of the shadowobject. I've mostly got 
through this implementation with all but one test passing. 

At this point, I've got as far as I can go without help, so I'm posting here, 
looking for feedback or discussion. I expect that maybe the next step should be 
me commenting on the PEP604 itself for implementation concerns regarding 
`_GenericAlias`?

Implementation is located at https://github.com/Naddiseo/cpython/tree/PEP604

Richard
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/P56ZE6USNIGCQU5PIOLKC65VHD5DM37U/
Code of Conduct: http://python.org/psf/codeofconduct/