pgsql-io / multicorn2

http://multicorn2.org
Other
73 stars 16 forks source link

Cannot install wheel using pip3 #9

Closed ShaheedHaque closed 2 years ago

ShaheedHaque commented 2 years ago

If I try to install using pip3 like this:

sudo -H pip3 install https://github.com/pgsql-io/multicorn2/archive/refs/heads/main.zip

I get the following output:

$ sudo -H pip3 install https://github.com/pgsql-io/multicorn2/archive/refs/heads/main.zip
Collecting https://github.com/pgsql-io/multicorn2/archive/refs/heads/main.zip
  Using cached https://github.com/pgsql-io/multicorn2/archive/refs/heads/main.zip
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: multicorn
  Building wheel for multicorn (setup.py) ... done
  Created wheel for multicorn: filename=multicorn-_VERSION_-cp310-cp310-linux_x86_64.whl size=56930 sha256=cbd0f43a5e49549daa894ce760e882db87b7ba55cbef8ec6128ed0edcd991f3f
  Stored in directory: /tmp/pip-ephem-wheel-cache-h8shfyj5/wheels/41/71/78/a662473feed8fa50cd3e50cb521dd2a03c4e4882a89bf26b41
  WARNING: Built wheel for multicorn is invalid: Metadata 1.2 mandates PEP 440 version, but '-VERSION-' is not
Failed to build multicorn
Installing collected packages: multicorn
  Running setup.py install for multicorn ... done
  DEPRECATION: multicorn was installed using the legacy 'setup.py install' method, because a wheel could not be built for it. A possible replacement is to fix the wheel build issue reported above. Discussion can be found at https://github.com/pypa/pip/issues/8368
Successfully installed multicorn--VERSION-

I assume this is related to this line: https://github.com/pgsql-io/multicorn2/blob/fac34799aa5529f84de0dc4d14e3dae8e1e51d47/setup.py#L28 But I'm not sure I understand how the string constant is supposed to be set up. AFAICS, the result is not correctly installed in the sense that /usr/share/postgresql/13/extension/multicorn.control is missing, and the extension cannot be used.

This is on Ubuntu 22.04 using postgres-13 installed from the Postgres-project install (not the default Ubuntu 22.04 install).

luss commented 2 years ago

kewl, I'll take a look this afternoon.

luss commented 2 years ago

I had another thought... Does the original Multicorn work the way you are asking? Because multicorn2 itself is a postgresql extension, I'm not so sure it makes sense to install via pip. FDW's that use multicorn2 are (usually) pure python and therefore are installable (usually) via PIP.

ShaheedHaque commented 2 years ago

On Ubuntu (and I suppose on other Debians), it isn't terribly clear because apt is used to install standard packages as well as python packages (even pure Python). I presume this is because dependency handling uses just one model, and indeed a model which is historically more complete than say pip.

Using pip on top of apt-installed packages is a bit odd, but the real kicker is that many of the apt python packages are FAR older that what pypi.org has.

So, while I take your point, I would say that pip is used for many Python packages which wrap C libraries, and using pip for them is fine too. Finally, I would say that the very presence of a setup.py suggests treating it as such was the intent.

luss commented 2 years ago

I kinda agree. A couple extra thoughts:

1) I personally only use packaged python stuff, for a specific distro (debian or el based), for stuff python extension that are not pure python.

2.) If a package is pure python, Pypi is the way to install it and get all the latest features and security updates.

3.) If multicorn2 was a regular pypi extension with some pieces in C, then we would definitely want to make it be installable via pypi in both source and/or binary form.

4.) Because Multiucorn2 is actually a postgres extension, in order to compile it you first need a configured Postgres development environment for each version of Postgres that you want to support. I am working to make multicorn2 installation easier, but, I'm not entirely convinced (yet) that Pypi is the way to do it.

--Denis

On Mon, May 16, 2022 at 5:17 PM ShaheedHaque @.***> wrote:

On Ubuntu (and I suppose on other Debians), it isn't terribly clear because apt is used to install standard packages as well as python packages (even pure Python). I presume this is because dependency handling uses just one model, and indeed a model which is historically more complete than say pip.

Using pip on top of apt-installed packages is a bit odd, but the real kicker is that many of the apt python packages are FAR older that what pypi.org has.

So, while I take your point, I would say that pip is used for many Python packages which wrap C libraries, and using pip for them is fine too. Finally, I would say that the very presence of a setup.py suggests treating it as such was the intent.

— Reply to this email directly, view it on GitHub https://github.com/pgsql-io/multicorn2/issues/9#issuecomment-1128146294, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMWOHSIJJ35VFURKQ2FO7DVKK3PTANCNFSM5WA4ROYQ . You are receiving this because you commented.Message ID: @.***>

ShaheedHaque commented 2 years ago

I'm not sure I see a real difference between your 3) and your 4). Firstly, any C based Python package will need the compile step to be supported by the corresponding headers and libs. Second, the only alternative is to have support for the native package format for say .rpm,.deb, Windows and Mac.

For all its flaws, a modern pip installable is actually a reasonable, portable answer! This true both for the user and the maintainer, even with the need to ensure that the necessary headers and library devel support is present.

ShaheedHaque commented 2 years ago

One last thought. This fix does not require that multicorn2 be published via PyPi: all it does it to allow the user to build and install it with current pip tooling. For that reason if no other, please consider merging.

luss commented 2 years ago

Excellent point!! I will merge.

On Wed, May 18, 2022 at 4:46 AM ShaheedHaque @.***> wrote:

One last thought. This fix does not require that multicorn2 be published via PyPi: all it does it to allow the user to build and install it with current pip tooling. For that reason if no other, please consider merging.

— Reply to this email directly, view it on GitHub https://github.com/pgsql-io/multicorn2/issues/9#issuecomment-1129740837, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMWOHTULRYYK333IKQII3LVKSU7NANCNFSM5WA4ROYQ . You are receiving this because you commented.Message ID: @.***>

ShaheedHaque commented 2 years ago

@luss I don't mean to be pushy, but a merge sooner rather than later would be great. OTOH, if you are not going to get to it for a while, it'd be good to know that and I can plan my migration to pg14 accordingly.

luss commented 2 years ago

Hi Shaheed. I like your persistence AND I trust your judgement. Would you like to become a committer on this project and you can tag this next release with your fix in it.

On Mon, May 30, 2022 at 7:15 PM ShaheedHaque @.***> wrote:

@luss https://github.com/luss I don't mean to be pushy, but a merge sooner rather than later would be great. OTOH, if you are not going to get to it for a while, it'd be good to know that and I can plan my migration to pg14 accordingly.

— Reply to this email directly, view it on GitHub https://github.com/pgsql-io/multicorn2/issues/9#issuecomment-1141532188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMWOHS77OINKV3RRRQ5EEDVMVDXTANCNFSM5WA4ROYQ . You are receiving this because you were mentioned.Message ID: @.***>

ShaheedHaque commented 2 years ago

Gulp, not sure what I'm signing myself up for, but OK!

luss commented 2 years ago

:-)

On Tue, May 31, 2022 at 10:09 AM ShaheedHaque @.***> wrote:

Gulp, not sure what I'm signing myself up for, but OK!

— Reply to this email directly, view it on GitHub https://github.com/pgsql-io/multicorn2/issues/9#issuecomment-1142186429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMWOHT4SC62L4WA7ZOV54DVMYMPXANCNFSM5WA4ROYQ . You are receiving this because you were mentioned.Message ID: @.***>

luss commented 2 years ago

I have invited you to the team with Write priv's. Now we can chat offlist, and you are free to commit things we discuss to the project. And so it begins. :-)