Skip to content

Commit

Permalink
Merge pull request #1102 from sanchitram1/main
Browse files Browse the repository at this point in the history
docs for python scripting update
  • Loading branch information
mxcl authored Jan 29, 2025
2 parents d47d9e0 + ae6454a commit a6cde02
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Using `env` to invoke `pkgx` is typical for tools that have no POSIX location.
The `-S` parameter is required to pass multiple arguments.
{% endhint %}


## Including Additional pkgs

Scripts are the glue that allows open source to be composed into powerful new
Expand All @@ -47,22 +46,14 @@ source <(pkgx dev --shellcode)

{% endhint %}


## Scripting for Various Languages & Their Dependencies

### Python

Use `uv` to import PyPi dependencies:

```python
#!/usr/bin/env -S pkgx [email protected] uv run --script

# /// script
# dependencies = [
# "requests<3",
# "rich",
# ]
# ///
#!/usr/bin/env -S pkgx [email protected] uv run --with requests<=3 --with rich

import requests
from rich.pretty import pprint
Expand Down Expand Up @@ -107,19 +98,16 @@ Use [Scriptisto]:
# snip… type `pkgx scriptisto new cargo` for the rest.
```


## Mash

We think `pkgx` scripting is so powerful that we made a whole package
manager to show it off.

> [https://github.com/pkgxdev/mash](https://github.com/pkgxdev/mash)

## Other Examples

We make use of `pkgx` scripting all over our repositories. Check them out!


[shebang]: https://en.wikipedia.org/wiki/Shebang_(Unix)
[Scriptisto]: https://github.com/igor-petruk/scriptisto

0 comments on commit a6cde02

Please sign in to comment.