mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
docs: update homebrew-pypi-poet instructions
This commit is contained in:
parent
4e79550b03
commit
d06fc3be63
@ -31,20 +31,20 @@ You can use `brew update-python-resources` to help you write resource stanzas. T
|
||||
If using `brew update-python-resources` doesn't work, you can use [homebrew-pypi-poet](https://pypi.python.org/pypi/homebrew-pypi-poet) to help you write resource stanzas. To use it, set up a virtualenv and install your package and all its dependencies. Then, `pip install homebrew-pypi-poet` into the same virtualenv. Running `poet some_package` will generate the necessary resource stanzas. You can do this like:
|
||||
|
||||
```sh
|
||||
# Install virtualenvwrapper
|
||||
brew install python
|
||||
python3 -m pip install virtualenvwrapper
|
||||
source $(brew --prefix)/bin/virtualenvwrapper.sh
|
||||
# Use a temporary directory for the virtual environment
|
||||
cd "$(mktemp -d)"
|
||||
|
||||
# Set up a temporary virtual environment
|
||||
mktmpenv
|
||||
# Create and source a new virtual environment in the venv/ directory
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
# Install the package of interest as well as homebrew-pypi-poet
|
||||
pip3 install some_package homebrew-pypi-poet
|
||||
pip install some_package homebrew-pypi-poet
|
||||
poet some_package
|
||||
|
||||
# Destroy the temporary virtualenv you just created
|
||||
# Destroy the virtual environment
|
||||
deactivate
|
||||
rm -rf venv
|
||||
```
|
||||
|
||||
Homebrew provides helper methods for instantiating and populating virtualenvs. You can use them by putting `include Language::Python::Virtualenv` at the top of the `Formula` class definition.
|
||||
|
Loading…
x
Reference in New Issue
Block a user