Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a local PyPI server #35

Merged
merged 18 commits into from
Dec 18, 2023
Merged

Add a local PyPI server #35

merged 18 commits into from
Dec 18, 2023

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Dec 15, 2023

Following support for other package indices (#34) we add support for serving a local package index powered by devpi!

❯ packse index up --bg
Starting server at http://localhost:3141...
Configuring client...
Creating package index 'packages/all'...
Index available at http://localhost:3141/packages/all
Ready!
Running in background with PID 29226
Stop server with `packse index down`.
http://localhost:3141/packages/all

❯ packse publish dist/example-0611cb74 --index-url http://127.0.0.1:3141/packages/all --anonymous
Publishing 1 target to http://127.0.0.1:3141/packages/all...
Publishing 'example-0611cb74'...
Published 'example_0611cb74-0.0.0.tar.gz'
Published 'example_0611cb74_a-1.0.0-py3-none-any.whl'
Published 'example_0611cb74_a-1.0.0.tar.gz'
Published 'example_0611cb74_b-1.0.0-py3-none-any.whl'
Published 'example_0611cb74_b-1.0.0.tar.gz'
example-0611cb74

❯ pip install --index-url http://127.0.0.1:3141/packages/all example-0611cb74 -q
❯ python -c "import example_0611cb74; print(example_0611cb74.__version__)"
0.0.0

❯ packse index down
Stopping server at PID 29226...
Stopped server!

I plan to add support for passing scenarios directly to a packse serve command which will build and publish them.

The index is backed by PyPI so if you need a package that is not in the scenario it will get downloaded.

The server runs backed by a temporary directory if not in the background, but a background server requires a persistent directory in ~/.packse.

To support true offline indices, we need to mirror hatchling.

@zanieb zanieb force-pushed the zb/serve branch 2 times, most recently from a8952bc to 379a2b7 Compare December 15, 2023 22:56
@zanieb zanieb changed the title Add packse serve Add a local PyPI server Dec 15, 2023
@zanieb zanieb force-pushed the zb/serve branch 3 times, most recently from eee7281 to b59f714 Compare December 16, 2023 00:32
@zanieb zanieb marked this pull request as ready for review December 18, 2023 20:51
@zanieb zanieb merged commit f6cd711 into main Dec 18, 2023
3 checks passed
@zanieb zanieb deleted the zb/serve branch December 18, 2023 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant