Homebrew, git, mercurial, python3

開発環境を入れてみる。 ホストはmacOS Sierra 10.12.3。

パッケージマネジャーはHomebrew。 バージョン管理は都合上2種類、今はgitが主流だね。 言語はPython3、仮想環境はとりあえずいらねえや、後回し。

Homebrew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Xcode。入ってなくても、勝手にダウンロードしてインストールまでしてくれるぜ。

動作確認。

$ brew doctor
Your system is ready to brew.

git

brewでインストールしようと思ったら既に入っていた。

$ git --version
git version 2.11.0 (Apple Git-81)

設定する。

$ git config --global user.name "First-name"
$ git config --global user.email "hoge@hoge.com"

$ git config --global core.editor 'vim -c "set fenc=utf-8"'

$ git config --global color.diff auto
$ git config --global color.status auto
$ git config --global color.branch auto

$ git config --global core.precomposeunicode true
$ git config --local core.precomposeunicode true

$ git config --global core.quotepath false

gitの設定は下記を参考にしました。

mercurial

$ brew install mercurial
$ hg --version
Mercurial Distributed SCM (version 4.2.2)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2017 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

設定をする(かホームフォルダに設定ファイルを作る。$HOME/.hgrc

$ hg config --edit

[ui]
username = hoge<hoge@hoge.com>
editor = vim
ignore = ~/.hgignore

次に無視ファイルも作っておく。$HOME/.hgignore

# ignore file for gcc/c++, macos, use glob syntax.
syntax: glob
*~
*.o
*.out
.DS_Store

python3

$ brew install python3

$ python3 --version
Python 3.6.1

$ pip3 --version
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)

Pythonの仮想環境はそのうちでいいや、とりあえずコード書く方を優先。 でも下記が参考になる。

qiita.com

追。virtualenvというのが良いそうな。入れ方は下記。

qiita.com