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
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).