Skip to content

Commit

Permalink
build: make project installable using hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabak committed Mar 17, 2024
1 parent b0f7ebf commit 207675a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

whispersubs/_version.py
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ Prerequisites:

For faster results, it is recommended to use a GPU with CUDA support.

Install the latest version from the repository:
```shell
# Clone the repo and cd into it
git clone https://github.com/andreabak/whispersubs.git
cd whispersubs

# Install the dependencies
pip install -r requirements.txt
pip install git+https://github.com/andreabak/whispersubs.git
# or with CUDA libraries for GPU acceleration
pip install git+https://github.com/andreabak/whispersubs.git[cuda]
```

## Usage
Expand Down
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ Documentation = "https://github.com/andreabak/whispersubs#readme"
Issues = "https://github.com/andreabak/whispersubs/issues"
Source = "https://github.com/andreabak/whispersubs"

[project.scripts]
whispersubs = "whispersubs.__main__:main"

[build-system]
requires = ["hatchling", "hatch-requirements-txt"]
requires = ["hatchling", "hatch-requirements-txt", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.metadata.hooks.requirements_txt]
Expand All @@ -38,6 +41,17 @@ files = ["requirements.txt"]
cuda = ["requirements-cuda.txt"]
dev = ["requirements-dev.txt"]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "whispersubs/_version.py"

[tool.hatch.build.targets.sdist]
include = [
"whispersubs",
]

[tool.ruff]
fix = true
show-fixes = true
Expand Down

0 comments on commit 207675a

Please sign in to comment.