-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Publishing a package | ||
|
||
uv does not yet have dedicated commands for building and publishing a package. Instead, you can use | ||
the PyPA tools [`build`](https://github.com/pypa/build) and | ||
[`twine`](https://github.com/pypa/twine). | ||
|
||
## Building your package | ||
|
||
Build your package with official `build` frontend: | ||
|
||
```console | ||
$ uvx --from build pyproject-build | ||
``` | ||
|
||
The build artifacts will be placed in `dist/`. | ||
|
||
## Publishing your package | ||
|
||
Publish your package with `twine`: | ||
|
||
```console | ||
$ uvx twine upload dist/* | ||
``` | ||
|
||
!!! tip | ||
|
||
To provide credentials, use the `TWINE_USERNAME` and `TWINE_PASSWORD` environment variables. | ||
|
||
## Installing your package | ||
|
||
Test that the package can be installed and imported with `uv run`: | ||
|
||
```console | ||
$ uv run --with <PACKAGE> --no-project -- python -c "import <PACKAGE>" | ||
``` | ||
|
||
The `--no-project` flag is used to avoid installing the package from your local project directory. | ||
|
||
!!! tip | ||
|
||
If you have recently installed the package, you may need to include the | ||
`--refresh-package <PACKAGE>` option to avoid using a cached version of the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters