Part 1
요약·해설
Linux·Windows·macOS의 pip3 설치 명령, 설치 위치 확인, launcher와 Python package의 관계, bash·zsh·fish 자동완성 설정을 정리합니다.
Python 3 · PyPI · pip3
west · west.exe · PATH
bash · zsh · fish
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
C14AAE13BD5307A1A80D904A7BD6D4A990F5DEC5F50D662248E53961E44BF939
.. _west-install:
Installing west
###############
West is written in Python 3 and distributed through `PyPI`_.
Use :file:`pip3` to install or upgrade west:
On Linux::
pip3 install --user -U west
On Windows and macOS::
pip3 install -U west
.. note::
See :ref:`python-pip` for additional clarification on using the
``--user`` switch.
Afterwards, you can run ``pip3 show -f west`` for information on where the west
binary and related files were installed.
Once west is installed, you can use it to :ref:`clone the Zephyr repositories
<clone-zephyr>`.
.. _west-struct:
Structure
*********
West's code is distributed via PyPI in a Python package named ``west``.
This distribution includes a launcher executable, which is also named
``west`` (or ``west.exe`` on Windows).
When west is installed, the launcher is placed by :file:`pip3` somewhere in
the user's filesystem (exactly where depends on the operating system, but
should be on the ``PATH`` :ref:`environment variable <env_vars>`). This
launcher is the command-line entry point to running both built-in commands
like ``west init``, ``west update``, along with any extensions discovered
in the workspace.
In addition to its command-line interface, you can also use west's Python
APIs directly. See :ref:`west-apis` for details.
.. _west-shell-completion:
Enabling shell completion
*************************
West currently supports shell completion in the following shells:
* bash
* zsh
* fish
In order to enable shell completion, you will need to obtain the corresponding
completion script and have it sourced.
Using the completion scripts:
.. tabs::
.. group-tab:: bash
*One-time setup*:
.. code-block:: bash
source <(west completion bash)
*Permanent setup*:
.. code-block:: bash
west completion bash > ~/west-completion.bash; echo "source ~/west-completion.bash" >> ~/.bashrc
.. group-tab:: zsh
*One-time setup*:
.. code-block:: zsh
source <(west completion zsh)
*Permanent setup*:
.. code-block:: zsh
west completion zsh > "${fpath[1]}/_west"
.. group-tab:: fish
*One-time setup*:
.. code-block:: fish
west completion fish | source
*Permanent setup*:
.. code-block:: fish
west completion fish > $HOME/.config/fish/completions/west.fish
.. _PyPI:
https://pypi.org/project/west/
Part 3
한국어 전문 번역
west 설치
West는 Python 3로 작성됐고 PyPI를 통해 배포됩니다. pip3로 설치하거나 새 version으로 올립니다.
Linux
pip3 install --user -U westWindows와 macOS
pip3 install -U west설치 후 pip3 show -f west를 실행하면 west 실행 파일과 관련 파일이 설치된 위치를 확인할 수 있습니다.
West 설치가 끝나면 이를 이용해 Zephyr 저장소를 복제할 수 있습니다.
구조
West code는 west라는 Python package로 PyPI에서 배포됩니다. 이 배포판에는 west라는 launcher 실행 파일이 함께 들어가며 Windows에서는 west.exe입니다.
pip3는 설치 과정에서 launcher를 사용자 파일 시스템의 특정 위치에 둡니다. 정확한 위치는 운영체제에 따라 다르지만 PATH 환경 변수에 포함돼 있어야 합니다.
이 launcher는 west init과 west update 같은 내장 명령뿐 아니라 현재 workspace에서 발견한 extension을 실행하는 command-line 진입점입니다.
Command-line interface 외에도 west의 Python API를 직접 사용할 수 있습니다. 자세한 내용은 West API 문서를 참고합니다.
셸 자동완성 활성화
West는 현재 다음 shell의 자동완성을 지원합니다.
bashzshfish
자동완성을 켜려면 해당 shell용 completion script를 얻은 뒤 shell이 그 script를 읽어 실행하도록 source해야 합니다.
bash
현재 shell에서 한 번만 활성화하려면:
source <(west completion bash)로그인할 때마다 영구적으로 활성화하려면:
west completion bash > ~/west-completion.bash; echo "source ~/west-completion.bash" >> ~/.bashrczsh
현재 shell에서 한 번만 활성화하려면:
source <(west completion zsh)영구적으로 활성화하려면:
west completion zsh > "${fpath[1]}/_west"fish
현재 shell에서 한 번만 활성화하려면:
west completion fish | source영구적으로 활성화하려면:
west completion fish > $HOME/.config/fish/completions/west.fish
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.