Skip to content

Commit

Permalink
add docs for developers
Browse files Browse the repository at this point in the history
  • Loading branch information
troyraen committed Jun 9, 2024
1 parent 80a82c6 commit 1e6eee0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/source/for-developers/setup-development-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Setup Development Mode

Check notice on line 1 in docs/source/for-developers/setup-development-mode.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/source/for-developers/setup-development-mode.md#L1

Expected: [None]; Actual: # Setup Development Mode

Instructions for setting up development or "editable" mode are given below. This is a way of pip-installing the package from the source code in your local directory which gives you immediate access to your changes, though you may need to re-import the package or re-load the python environment.

Check notice on line 3 in docs/source/for-developers/setup-development-mode.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/source/for-developers/setup-development-mode.md#L3

Expected: 120; Actual: 294

When you are ready to publicly release a new version of `pittgoogle-client`, publish to PyPI using the release process described in [issues #7](https://github.com/mwvgroup/pittgoogle-client/pull/7).

Check notice on line 5 in docs/source/for-developers/setup-development-mode.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/source/for-developers/setup-development-mode.md#L5

Expected: 120; Actual: 198

See also: [Python Packaging User Guide](https://packaging.python.org/en/latest/).

## Setup

```bash
# clone the repo and cd in
git clone https://github.com/mwvgroup/pittgoogle-client.git
cd pittgoogle-client

# recommended to create a new conda env
# use the latest python version unless you have a specific reason not to
conda create --name pittgoogle python=3.12
conda activate pittgoogle

# install pittgoogle-client in editable mode. use pwd so that the absolute path is registered.
pip install -e $(pwd)
```

## Work in development ("editable") mode:

Check notice on line 25 in docs/source/for-developers/setup-development-mode.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/source/for-developers/setup-development-mode.md#L25

Punctuation: ':'

Now you can work with the code in your local pittgoogle-client repo in python:

```python
import pittgoogle

# make new changes in your local pittgoogle-client repo code
# then use importlib to reload the package with the new changes
import importlib
importlib.reload(pittgoogle)
# if you don't have access to the new changes at this point, try reloading again
# if that doesn't work, restart your python interpreter
```

See also: [Working in “development mode”](https://packaging.python.org/guides/distributing-packages-using-setuptools/#working-in-development-mode).
7 changes: 7 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
tutorials/cloud-storage
tutorials/ztf-figures

.. toctree::
:caption: For Developers
:maxdepth: 3
:hidden:

for-developers/setup-development-mode

.. toctree::
:caption: API Reference
:maxdepth: 3
Expand Down

0 comments on commit 1e6eee0

Please sign in to comment.