Created Setting up a new development environment (markdown)

Rhet Turnbull
2020-07-23 06:54:03 -07:00
parent 0709a5d841
commit d1f7536bec

@@ -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
```