Skip to content

Commit

Permalink
feat: implemented basic 'install' and 'uninstall' commands
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvandernoord committed Feb 29, 2024
1 parent f5cbaf8 commit d82261a
Show file tree
Hide file tree
Showing 5 changed files with 362 additions and 7 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,20 @@
Inspired by:
- [pipx](https://github.com/pypa/pipx)
- [uv](https://github.com/astral-sh/uv)

## Installation

```bash
# one of these ways:
pip install uvx
uv install uvx
pipx install uvx
```

## License

`usvx` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

## Changelog

See `CHANGELOG.md` [on GitHub](https://github.com/robinvandernoord/uvx/blob/master/CHANGELOG.md)
20 changes: 13 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ description = 'uvx: pipx for uv'
readme = "README.md"
requires-python = ">=3.8"
license = "MIT"
keywords = []
keywords = ["uv", "pipx", "cli", "typer", "venv"]
authors = [
{ name = "Robin van der Noord", email = "robinvandernoord@gmail.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"uv"
"uv",
"typer",
"plumbum",
"threadful>=0.2",
]

[project.optional-dependencies]
Expand All @@ -36,11 +37,13 @@ dev = [
"su6[all]",
]

[project.scripts]
uvx = "uvx.cli:app"

[project.urls]
Documentation = "https://github.com/unknown/uvx#readme"
Issues = "https://github.com/unknown/uvx/issues"
Source = "https://github.com/unknown/uvx"
Documentation = "https://github.com/robinvandernoord/uvx#readme"
Issues = "https://github.com/robinvandernoord/uvx/issues"
Source = "https://github.com/robinvandernoord/uvx"

[tool.hatch.version]
path = "src/uvx/__about__.py"
Expand All @@ -53,6 +56,9 @@ stop-after-first-failure = false
coverage = 100
badge = true

[tool.setuptools.package-data]
"uvx" = ["py.typed"]

[tool.coverage.run]
source_pkgs = ["uvx", "tests"]
branch = true
Expand Down
32 changes: 32 additions & 0 deletions src/uvx/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""This file builds the Typer cli."""

import typer

from .core import create_venv, install_package, uninstall_package

app = typer.Typer()


@app.command()
def install(package_name: str, force: bool = False):
"""Install a package (by pip name)."""
venv = create_venv(package_name)
install_package(package_name, venv, force=force)


@app.command(name="remove")
@app.command(name="uninstall")
def uninstall(package_name: str, force: bool = False):
"""Uninstall a package (by pip name)."""
uninstall_package(package_name, force=force)


# list

# run

# upgrade

# self-upgrade (uv and uvx)

# ...
Loading

0 comments on commit d82261a

Please sign in to comment.