Skip to content

Instantly share code, notes, and snippets.

@ramondelemos
Last active February 21, 2024 15:32
Show Gist options
  • Select an option

  • Save ramondelemos/1d8af7bffc96241c5c48d42685eeb71b to your computer and use it in GitHub Desktop.

Select an option

Save ramondelemos/1d8af7bffc96241c5c48d42685eeb71b to your computer and use it in GitHub Desktop.

asdf(extendable version manager)

Instalação:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.5.1

Bash on Ubuntu (and other Linux distros):

echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc

Zsh:

echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc

Elixir

asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git

After install erlang go to asdf-erlang

asdf install erlang 21.0.8
asdf global erlang 21.0.8
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.7.4-otp-21
asdf global elixir 1.7.4-otp-21

Python

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev
asdf plugin-add python https://github.com/tuvistavie/asdf-python.git
asdf install python 3.6.6
asdf global python 3.6.6

Ferramentas para python

pip install pipenv black isort pylint ipython mypy

Se o pipenv não rodar

asdf reshim python

Inicia o virtualenv do projeto

pipenv shell

Remove o virtualenv do projeto

pipenv --rm

Recria o virtualenv do projeto

pipenv check

Formata os arquivos de código do diretório corrente

yapf -i . -r

Roda a ferramenta pylint de lint do python

pylint banking_payment_integrations/

Comando de debug no python

import pdb; pdb.set_trace()

configs de python para vscode

{
	"python.formatting.provider": "yapf",
	"python.formatting.yapfPath": "~/.asdf/shims/yapf",
	"python.linting.enabled": true,
	"python.linting.flake8Path": "~/.asdf/shims/flake8",
	"python.linting.mypyEnabled": true,
	"python.linting.mypyPath": "~/.asdf/shims/mypy",
	"python.linting.pep8Path": "~/.asdf/shims/pep8",
	"python.linting.pylintEnabled": true,
	"python.linting.pylintPath": "~/.asdf/shims/pylint",
	"python.unitTest.nosetestsEnabled": false,
	"python.unitTest.pyTestEnabled": true,
	"python.unitTest.unittestEnabled": true
}

Referências

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment