feat: Add PyPI support#116
Conversation
|
All right.... Can I upgrade rustc version? |
yes, sure! |
104b4b6 to
545e1ea
Compare
| # torch has local version, which is percent encoded on url, it should be decode. | ||
| # torch-2.6.0%2Bcpu + torch-2.6.0+cpu | ||
| torch = { version = ">=2.2", index = "https://download.pytorch.org/whl/cpu" } |
There was a problem hiding this comment.
I only know that this package has a local version, but it is big (170MB). If there is a smaller package. We can change it.
There was a problem hiding this comment.
for the general unit tests, i would prefer a very small pypi package like ordered-enum which is a wheel with zero dependencies that is only 3KB large.
how about you verify the behavior with URL encoding in a unit test in pack.rs test_url_encoding where you just call download_pypi_package with the specific pytorch url?
this way pytorch will only get downloaded a single time in that test and all other integration tests just use a very small pixi environment which should make the tests quicker
.github/workflows/ci.yml
Outdated
| key: tests | ||
| - name: Run test | ||
| run: pixi run test --color always${{ startsWith(matrix.os, 'ubuntu') && ' --no-default-features --features rustls-tls' || '' }} | ||
| run: pixi run test --color always${{ startsWith(matrix.os, 'ubuntu') && ' --no-default-features --features rustls-tls' || '' }} -- --test-threads=4 |
There was a problem hiding this comment.
I edited CI script to reduce parallel test, or it would make too many requests to download packages at the same time.
|
Pavel Zwerschke (@pavelzw) asked me for a quick eyes on this. I think it is already looking pretty good , two questions.
|
…io-tar by astral-tokio-tar to prevent long filename truncate bug
flat index is better, I didn't think of it before, I update to use flat index.
Currently it only show the first source distribution it found, and exit program immediately, should I list all the source distribution in lock file? |
|
Did I break something? Why do Windows and MacOS builds sometimes fail.... |
maybe this is because |
Wow, it works! |
|
Thanks for your contribution Jeff Zhang (@e8035669), we'll take a look at this early next week! |
Pavel Zwerschke (pavelzw)
left a comment
There was a problem hiding this comment.
looks very good already, thanks Jeff Zhang (@e8035669)! i have a couple of comments and after those are addressed, we can merge :)
Currently it only show the first source distribution it found, and exit program immediately, should I list all the source distribution in lock file?
i think it is fine as you implemented it now
| # torch has local version, which is percent encoded on url, it should be decode. | ||
| # torch-2.6.0%2Bcpu + torch-2.6.0+cpu | ||
| torch = { version = ">=2.2", index = "https://download.pytorch.org/whl/cpu" } |
There was a problem hiding this comment.
for the general unit tests, i would prefer a very small pypi package like ordered-enum which is a wheel with zero dependencies that is only 3KB large.
how about you verify the behavior with URL encoding in a unit test in pack.rs test_url_encoding where you just call download_pypi_package with the specific pytorch url?
this way pytorch will only get downloaded a single time in that test and all other integration tests just use a very small pixi environment which should make the tests quicker
…d serial_test and mark conda tests are serial
Pavel Zwerschke (pavelzw)
left a comment
There was a problem hiding this comment.
thanks! some minor last comments
|
Thanks for the code review, I learned a lot |
21f8630
into
Quantco:main
Motivation
closes #38
pixi-pack is a great work to deploy packages to anywhere, but I hope to support pypi packages as well. So I am trying to make support for pypi packages.
But I am not familar with how
pixioruvworks. So it roughly imitates the way pixi works.Changes
Use
pixi-pack pack --experimental-pypi-supportto package a project which has pypi dependencies.It will do these things internally:
pixi.lock, It accept wheel files currently. source distribution would rejectsimplerepositorysimpledirectoryindex.htmlmake it becomes PyPI-compatible package repositorypipsection when creatingenvironment.yml, make it compatible to conda/micromambaUse
pixi-pack unpackto unpack. Whensimpledirectory is exist, it will continue install wheel files after conda prefix is installed.It will do these things internally:
pythonfrom this prefix.whlfilesIf updating documentation: