Skip to content

Commit

Permalink
Install package when creating conda env in editable mode
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWilhelm committed Jan 23, 2021
1 parent 1f007c0 commit 244088b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ dependencies:
- pip
- pip:
- pyscaffold
- sphinx_rtd_theme # to build docs locally
- sphinx_rtd_theme # to build docs locally
- -e .[testing] # install git checkout of PyScaffold in editable mode
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ dependencies:
- pytorch
- yellowbrick
- pip:
- -e .[testing] # install git checkout of ${name} in editable mode
# add here only pip-packages that are not available in conda/conda-forge! E.g.:
- optuna

# for development only (could also be kept in a separate environment file)
- jupyterlab
- pytest
Expand Down
20 changes: 10 additions & 10 deletions src/pyscaffoldext/dsproject/templates/readme_md.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ In order to set up the necessary environment:
```
conda activate ${name}
```
3. install `${name}` with:
```
python setup.py install # or `develop`
```

> **_NOTE:_** The conda environment will have ${name} installed in editable mode.
> Some changes, e.g. in `setup.cfg`, might require you to run `pip install -e .` again.


Optional and needed only once after `git clone`:

4. install several [pre-commit] git hooks with:
```
3. install several [pre-commit] git hooks with:
```bash
pre-commit install
# You might also want to run `pre-commit autoupdate`
```
and checkout the configuration under `.pre-commit-config.yaml`.
The `-n, --no-verify` flag of `git commit` can be used to deactivate pre-commit hooks temporarily.

5. install [nbstripout] git hooks to remove the output cells of committed notebooks with:
```
4. install [nbstripout] git hooks to remove the output cells of committed notebooks with:
```bash
nbstripout --install --attributes notebooks/.gitattributes
```
This is useful to avoid large diffs due to plots in your notebooks.
Expand All @@ -49,12 +49,12 @@ Then take a look into the `scripts` and `notebooks` folders.
in `setup.cfg` if you want to ship and install your package via `pip` later on.
2. Create concrete dependencies as `environment.lock.yml` for the exact reproduction of your
environment with:
```
```bash
conda env export -n ${name} -f environment.lock.yml
```
For multi-OS development, consider using `--no-builds` during the export.
3. Update your current environment with respect to a new `environment.lock.yml` using:
```
```bash
conda env update -f environment.lock.yml --prune
```
## Project Organization
Expand Down

0 comments on commit 244088b

Please sign in to comment.