By splitting it into two different packages you end up with the same situation 
that currently plagues psycopg2/psycopg2-binary whereby if you depend on 
psycopg2 you can't easily swap in psycopg2-binary and vice-versa as the two 
don't satisfy the same dependency.

Number 3 is kind of what sqlalchemy does, and then provide wheels for a huge 
variety of platforms to allow people to install the package without needing a 
compiler themselves.

Bert

> On Aug 2, 2020, at 04:42, Daniele Varrazzo <daniele.varra...@gmail.com> wrote:
> 
> Hello,
> 
> packaging psycopg3, I'm wondering what is the best way to provide an
> optional optimisation module.
> 
> 1) provide a separate psycopg3-c distribution
> 2) provide an extra psycopg3[c]
> 3) try building the extension and fail quietly.
> 
> 1) seems the cleanest approach: the psycopg3 distribution would have
> no build-time external dependency (Cython, -dev packages, a compiler)
> and psycopg3-c can fail hard if some of these dependencies are
> missing. I am currently trying this approach, finding some problems in
> working out a good files layout to have two setup.py in the same git
> repository.
> 
> 2) would be nice but I don't see a way to identify the extra requested
> at build time to implement a build_ext command such that if "c" is not
> the extra then don't do anything. it seems that extra are thought for
> a different use case, not for optional build-time parts
> 
> 3) would give me endless headaches to work out why something failed,
> differentiate failures for missing dependencies from real errors, and
> dealing with user reports.
> 
> What would be your advice? Press on with 1 or a different approach?
> Examples are welcome (the only one I have in mind is PyYAML doing 3).
> 
> 
> -- Daniele
> --
> Distutils-SIG mailing list -- distutils-sig@python.org
> To unsubscribe send an email to distutils-sig-le...@python.org
> https://mail.python.org/mailman3/lists/distutils-sig.python.org/
> Message archived at 
> https://mail.python.org/archives/list/distutils-sig@python.org/message/GEPU27VYHQ54BSAYDAK7ZPBFXAMVJIII/
--
Distutils-SIG mailing list -- distutils-sig@python.org
To unsubscribe send an email to distutils-sig-le...@python.org
https://mail.python.org/mailman3/lists/distutils-sig.python.org/
Message archived at 
https://mail.python.org/archives/list/distutils-sig@python.org/message/4YQOQ3EBKZE243ZZYWFGCB3TJCQDQJMX/

Reply via email to