mirror of
https://github.com/microsoft/markitdown.git
synced 2026-09-28 13:12:58 +08:00
Quote install commands so they work in zsh; MarkItdown->MarkItDown
In zsh (default macOS shell since 2019, default on many Linux distros),
`[` and `]` are pathname-expansion metacharacters, so `pip install
markitdown[all]` fails with:
zsh: no matches found: markitdown[all]
The top-level README.md already uses the quoted form
(`pip install 'markitdown[all]'`) throughout. This commit brings the
package README and two user-facing dependency-missing error messages
into alignment with that convention, so users copy-pasting from PyPI
or from a raised MissingDependencyException get a command that works
in every mainstream shell.
- packages/markitdown/README.md: quote the PyPI install and the
editable-install-from-source example.
- _exceptions.py: quote the three `pip install` examples inside
MISSING_DEPENDENCY_MESSAGE (shown to end users when an optional
converter dep is missing).
- _transcribe_audio.py: quote the two `pip install` examples in
the raised MissingDependencyException text, and fix a lowercase
'MarkItdown' -> 'MarkItDown' product-name typo in the same string.
Bash/sh/dash treat quoted and unquoted forms identically, so this is
a strict improvement.
Independently proposed by community PRs #1172, #1577, #1602, and #2062
(all still open); fixes referenced issue #1574. Consolidating here to
resolve them in one place alongside the wider prose cleanup.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
From PyPI:
|
||||
|
||||
```bash
|
||||
pip install markitdown[all]
|
||||
pip install 'markitdown[all]'
|
||||
```
|
||||
|
||||
From source:
|
||||
@@ -21,7 +21,7 @@ From source:
|
||||
```bash
|
||||
git clone git@github.com:microsoft/markitdown.git
|
||||
cd markitdown
|
||||
pip install -e packages/markitdown[all]
|
||||
pip install -e 'packages/markitdown[all]'
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import Optional, List, Any
|
||||
|
||||
MISSING_DEPENDENCY_MESSAGE = """{converter} recognized the input as a potential {extension} file, but the dependencies needed to read {extension} files have not been installed. To resolve this error, include the optional dependency [{feature}] or [all] when installing MarkItDown. For example:
|
||||
|
||||
* pip install markitdown[{feature}]
|
||||
* pip install markitdown[all]
|
||||
* pip install markitdown[{feature}, ...]
|
||||
* pip install 'markitdown[{feature}]'
|
||||
* pip install 'markitdown[all]'
|
||||
* pip install 'markitdown[{feature}, ...]'
|
||||
* etc."""
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,10 @@ def transcribe_audio(file_stream: BinaryIO, *, audio_format: str = "wav") -> str
|
||||
# Check for installed dependencies
|
||||
if _dependency_exc_info is not None:
|
||||
raise MissingDependencyException(
|
||||
"Speech transcription requires installing MarkItdown with the [audio-transcription] optional dependencies. E.g., `pip install markitdown[audio-transcription]` or `pip install markitdown[all]`"
|
||||
"Speech transcription requires installing MarkItDown with the "
|
||||
"[audio-transcription] optional dependencies. E.g., "
|
||||
"`pip install 'markitdown[audio-transcription]'` or "
|
||||
"`pip install 'markitdown[all]'`"
|
||||
) from _dependency_exc_info[
|
||||
1
|
||||
].with_traceback( # type: ignore[union-attr]
|
||||
|
||||
Reference in New Issue
Block a user