Skip to content

Commit

Permalink
move cli to separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
NextFire committed Oct 15, 2024
1 parent 1f9b5a9 commit 0fc87bb
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The full pipeline will be completed in less than a minute in their environment.
- [FFmpeg](https://ffmpeg.org): optional, for better codecs support on macOS/Linux (only versions [>=4.4,<7 are supported by torchaudio](https://pytorch.org/audio/main/installation.html#optional-dependencies))

```sh
uvx --from git+https://github.com/Japan7/yohane.git --python 3.11 yohane --help
uvx --from git+https://github.com/Japan7/yohane.git[cli] --python 3.11 yohane --help
```

## Caveats
Expand Down
19 changes: 13 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,34 @@ version = "2024.10.7-dev"
description = "Forced alignment for karaokes"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.10,<4"
authors = [
{ name = "NextFire", email = "[email protected]" },
{ name = "Voltini", email = "[email protected]" },
]
requires-python = ">=3.10"
dependencies = [
"torch>=2.1,<3",
"torchaudio>=2.1,<3",
"vocal-remover",
"pysubs2==1.7.3",
"regex==2024.9.11",
"typer-slim[standard]==0.12.5",
]

[project.optional-dependencies]
cli = ["yohane-cli"]

[tool.uv]
dev-dependencies = ["pyright==1.1.384", "ruff==0.6.9"]

[tool.uv.sources]
yohane-cli = { workspace = true }
vocal-remover = { git = "https://github.com/Japan7/vocal-remover.git", branch = "6.0.0b4" }

[project.urls]
homepage = "https://github.com/Japan7/yohane"
[tool.uv.workspace]
members = ["yohane-cli"]

[project.scripts]
yohane = "yohane:app"
[project.urls]
Homepage = "https://github.com/Japan7/yohane"

[build-system]
requires = ["hatchling"]
Expand Down
45 changes: 35 additions & 10 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions yohane-cli/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
16 changes: 16 additions & 0 deletions yohane-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "yohane-cli"
version = "0.1.0"
authors = [{ name = "NextFire", email = "[email protected]" }]
requires-python = ">=3.10"
dependencies = ["yohane", "typer-slim[standard]==0.12.5"]

[tool.uv.sources]
yohane = { workspace = true }

[project.scripts]
yohane = "yohane_cli:app"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
5 changes: 5 additions & 0 deletions yohane-cli/yohane_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from yohane_cli.app import app

__all__ = [
"app",
]
2 changes: 1 addition & 1 deletion yohane/__main__.py → yohane-cli/yohane_cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from yohane.app import app
from yohane_cli.app import app

if __name__ == "__main__":
app()
File renamed without changes.
2 changes: 0 additions & 2 deletions yohane/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from yohane.app import app
from yohane.pipeline import Yohane

__all__ = [
"app",
"Yohane",
]
2 changes: 1 addition & 1 deletion yohane/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def get_identifier():
pkg_meta = metadata(__package__)
identifier = f"{pkg_meta['Name']} {pkg_meta['Version']}"
if urls := pkg_meta["Project-URL"]:
if parsed := re.search(r"homepage, (\S+)\b", urls):
if parsed := re.search(r"Homepage, (\S+)\b", urls):
identifier += f" ({parsed.group(1)})"
return identifier

0 comments on commit 0fc87bb

Please sign in to comment.