realpython / realpython/python-guide

Expand on direnv section

Aberta
#1,027 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Linguagem predominante
Batchfile
Estrelas
29.8k
Forks
5.9k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

The direnv section simply refers the reader to direnv.net for Linux installation instructions (by the the site is not linked on the page). Since there are different ways to get direnv working depending on if you're using pyenv, virtualenv, or virtualenvwrapper, it seems reasonable to direct them to the site. However, after struggling with this myself I found the instructions not straightforward, especially for a new user.
Since the direnv section directly follows the virtualenvwrapper section, I suggest updating with the following instructions to get direnv working with virtualenvwrapper:

  1. Add the following to ~/.config/direnv/direnvrc
layout_virtualenv {
    local venv_path="$1"
    source ${venv_path}/bin/activate
}
layout_virtualenvwrapper {
    local venv_path="${WORKON_HOME}/$1"
    layout_virtualenv $venv_path
}
  1. Add the following to an .envrc file in the root directory of your project
    layout virtualenvwrapper _name_of_virtual_environment_

Now, the virtual environment will activate when you enter the project directory and deactivate when you leave.

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Localize a seção direnv imediatamente após a seção virtualenvwrapper e verifique como a documentação ao redor faz referência às instruções externas de instalação. Adicione o link direnv.net e as etapas de configuração de virtualenvwrapper fornecidas; em seguida, verifique se o guia renderizado explica claramente a ativação ao entrar e sair de um diretório de projeto.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
linux, python, shell
Domínio
documentation
Tipo de issue
Documentação
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
50/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.