mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-25 09:51:19 +08:00
38 lines
538 B
Markdown
38 lines
538 B
Markdown
![]() |
### Packaging for PyPI
|
||
|
|
||
|
Install `build` and `twine`:
|
||
|
|
||
|
```
|
||
|
pip install --user --upgrade build
|
||
|
pip install --user --upgrade twine
|
||
|
```
|
||
|
|
||
|
Generate the source distribution and wheel:
|
||
|
|
||
|
```
|
||
|
python -m build
|
||
|
```
|
||
|
|
||
|
> [!warning]
|
||
|
> Use a test server first
|
||
|
|
||
|
#### Test Upload
|
||
|
|
||
|
Upload to test server:
|
||
|
|
||
|
```
|
||
|
python -m twine upload --repository testpypi dist/*
|
||
|
```
|
||
|
|
||
|
Install from test server and check that it works:
|
||
|
|
||
|
```
|
||
|
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps mlx-lm
|
||
|
```
|
||
|
|
||
|
#### Upload
|
||
|
|
||
|
```
|
||
|
python -m twine upload dist/*
|
||
|
```
|