mongodb-labs / python-bsonjs

A fast BSON to MongoDB Extended JSON converter for Python - This Repository is NOT a supported MongoDB product
Apache License 2.0
40 stars 10 forks source link

Publishing wheel packages to PyPI #51

Closed amotl closed 10 months ago

amotl commented 10 months ago

Dear Shane,

thanks a stack for conceiving and maintaining the excellent python-bsonjs package.

On a CI run of ours ^1, we have been able to spot this error:

ERROR: Could not build wheels for python-bsonjs, which is required to install pyproject.toml-based projects

This is probably to be expected, because ^2 shows there are no wheel packages available for more recent versions of Python, and the environment where python-bsonjs is being installed lacks the gcc compiler package.

Do you see any chance to publish wheel packages to PyPI, to improve this situation?

With kind regards, Andreas.

amotl commented 10 months ago

Interesting. On a Docker test run on my workstation, it easily selects the wheel package and installs it, even on Python 3.11. Do you have any clue why it wouldn't do that on GHA?

$ docker run --rm -it python:3.11-slim-bookworm bash

root@3ae8880c9565:/# python -V
Python 3.11.4

root@3ae8880c9565:/# pip install python-bsonjs
Collecting python-bsonjs
  Downloading python_bsonjs-0.3.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (317 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 317.2/317.2 kB 3.7 MB/s eta 0:00:00
Installing collected packages: python-bsonjs
Successfully installed python-bsonjs-0.3.0
amotl commented 10 months ago

Turns out we used a silly outdated requirements constraint like "python-bsonjs<0.3,>=0.2". When using the most recent python-bsonjs==0.3.0, everything works well. Apologies so much for the noise.

ShaneHarvey commented 10 months ago

Cheers! I'm curious to hear more about this lib's use cases. Can I ask how and why you're using this python-bsonjs?