From d1f7536beceb6186338204059315d03130eac967 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Thu, 23 Jul 2020 06:54:03 -0700 Subject: [PATCH] Created Setting up a new development environment (markdown) --- Setting-up-a-new-development-environment.md | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Setting-up-a-new-development-environment.md diff --git a/Setting-up-a-new-development-environment.md b/Setting-up-a-new-development-environment.md new file mode 100644 index 0000000..f464717 --- /dev/null +++ b/Setting-up-a-new-development-environment.md @@ -0,0 +1,55 @@ +# Setting up a development environment on your Mac + +* Download and install Python if you haven't already. You'll need python3 and you'll want want a separate python than what is installed by default on MacOS. Options include: + * [Anaconda](https://docs.anaconda.com/anaconda/install/mac-os/) + * [python.org](https://www.python.org/downloads/mac-osx/) + +If you want to build a stand-alone executable of `osxphotos` I recommend Anaconda as the python.org version of python doesn't currently work to build the executable with [`pyinstaller`](https://www.pyinstaller.org/). + +* Run the following commands in your terminal. + +```sh +$ git clone https://github.com/RhetTbull/osxphotos.git +$ cd osxphotos +``` + + * Setup a [virtual environment](https://docs.python.org/3/tutorial/venv.html) so you aren't developing in your system-wide python. + +```sh +$ python3 -m venv .venv +# activate the new environment +$ source .venv/bin/activate +``` + + * Confirm you're now using the python in in the virtual environment. + +```sh +$ which python3 +/Users/rhet/Dropbox/Code/working/osxphotos/.venv/bin/python3 +``` + + + * Install additional packages required for testing. + +```sh +$ python3 -m pip install pytest +$ python3 -m pip install pytest-mock +``` + + * Run setup.py develop which installs osxphotos such that it's linked to your dev environment so that any edits have immediate effect + +```sh +$ python3 setup.py develop +``` + + * Run `osxphotos` -- this will run the version you just installed in the local environment + +```sh +$ python3 -m osxphotos +``` + + * Run the tests + +```sh +$ python3 -m pytest +```