Kludex / python-multipart

A streaming multipart parser for Python.

Home Page:https://kludex.github.io/python-multipart/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upload wheels to PyPI

johnthagen opened this issue Β· comments

Wheels (.whl) for this package are currently missing from PyPI. Could wheels be uploaded for the current and future releases?

Read more about the advantages of wheels to understand why generating wheel distributions are important.

To create a wheel along with source distribution:

(venv) $ pip install --upgrade pip setuptools wheel
(venv) $ python setup.py sdist bdist_wheel

# See dist/*.whl

To upload wheels:

(venv) $ pip install twine
(venv) $ twine upload dist/*

Hi there,

I have an issue with python-multipart in poetry. When I add python-multipart in poetry dependencies, it breaks dependency calculation.

I'm guessing that missing .whl can be related to this issue.

I'm going to try to publish wheel file on our private registry and will keep you posted if it helps solving my probelm.

nevermind, it's absolutely not related. My problem was due to a conflict with six version.

Installing python-multipart to pyodide fails due missing wheel distribution. It would be nice to get that fixed.

I'm getting following error

  File "/lib/python3.9/site-packages/micropip/micropip.py", line 242, in add_requirement
    await self.add_wheel(req.name, wheel, ver, req.extras, ctx, transaction)
  File "/lib/python3.9/site-packages/micropip/micropip.py", line 253, in add_wheel
    await self.add_requirement(recurs_req, ctx, transaction)
  File "/lib/python3.9/site-packages/micropip/micropip.py", line 241, in add_requirement
    wheel, ver = self.find_wheel(metadata, req)
  File "/lib/python3.9/site-packages/micropip/micropip.py", line 269, in find_wheel
    raise ValueError(f"Couldn't find a pure Python 3 wheel for '{req}'")
ValueError: Couldn't find a pure Python 3 wheel for 'python-multipart<0.0.6,>=0.0.5'

Would you be interested in help by creating a PR that included support for uploading wheels of this package?

@Ambro17 : are we sure this repo is maintained and PR will be merged ?

If so, I can do it

No, i'm not sure but it's a dependency on the third most used web framework in python so i think it's worth the try

Conditions look favorable.

Hi @tomchristie, I'm having a look at the CI part of this repo and can't find anything related to package build.

Do you know how build is currently done ?

Hrmm, it's been a while... https://pypi.org/project/python-multipart/#history

I assume we've always released manually in the past.

The instructions at the top of this thread look useful. #37 (comment)

This section of the tutorial might be relevant too. Packaging in python has improved a lot lately so one can not depend on setuptools if one doesn't want to. python -m build can build both source and wheel distributions. More details on the link
https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives

Yep, this is the way :)

What i can do in the PR is add an action when a tag is pushed to the repo that will build & publish package to PyPi.

What do you think about that?

This section of the tutorial might be relevant too. Packaging in python has improved a lot lately so one can not depend on setuptools if one doesn't want to. python -m build can build both source and wheel distributions. More details on the link https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives

I just saw that this issue got opened today : #50

Could be a good idea as you suggested to also move setup.py to pyproject.toml

First PR opened : #52

Review appreciated :)

Prompted by #40 (comment)

Supposing we wanted pushed a new release now...

  • Which currently outstanding issues would that close?
  • What would the release notes be?

@tomchristie latest relase (0.0.5) is based on py==1.10 which has a reported, unclosed CVE.

While this might be a really weird issue (if you read into the whole drama regarding py module, pytest and the recent CVE publication) it is a pain when you have to explain this to every single security guy in your organization...
https://nvd.nist.gov/vuln/detail/CVE-2020-29651
pytest-dev/pytest#10392
pytest-dev/py#287

Any progress on this?

give me 10 min, hold on

EDIT: ok, give me a bit more... I'll make a release in some hours.

Automated? I'm using pants on an M1 and it requires wheels, at the moment I'm just vendoring it myself so no rush :)

I was going to make a manual release, since we can't use this flow: #57

If you have a suggestion about a flow that could work, and want to push a PR, I'd check it... πŸ‘€

On tag?

The issue is that you can't make releases on @andrew-d 's repo?

On tag?

That would work, yep.

The issue is that you can't make releases on @andrew-d 's repo?

Yep. I can't make GH releases.

Did you want a PR raised to change this to be release on tag?

Did you want a PR raised to change this to be release on tag?

Thanks, but @Ambro17 implemented it on #57 πŸ™

@ghandic sorry for the delay... Hard time on personal life...

Good to have you back around those packages :)

I'm making the release now.

There they are! πŸš€

Thanks @Kludex ❀️

I just did poetry add python-multipart@latest and got

poetry add python-multipart@latest
Using version ^0.0.9 for python-multipart

Updating dependencies
Resolving dependencies... (6.5s)

Writing lock file

Package operations: 1 install, 0 updates, 0 removals

  β€’ Installing python-multipart (0.0.9)

But my pyproject.toml looks like

python-multipart = "^1.0.9"

is it 1.0.9 or 0.0.9

I tried 0.0.9 manually before but got an error on poetry install

SolverProblemError

  Because project depends on python-multipart (^0.0.9) which doesn't match any versions, version solving failed.

  at /usr/lib/python3/dist-packages/poetry/puzzle/solver.py:241 in _solve
      237β”‚             packages = result.packages
      238β”‚         except OverrideNeeded as e:
      239β”‚             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240β”‚         except SolveFailure as e:
    β†’ 241β”‚             raise SolverProblemError(e)
      242β”‚
      243β”‚         results = dict(
      244β”‚             depth_first_search(
      245β”‚                 PackageNode(self._package, packages), aggregate_package_nodes