Skip to content

Commit

Permalink
Add pip install -e to conda env descriptions
Browse files Browse the repository at this point in the history
This automatically installs the package as part of environment creation.

Thanks to Michael Dunphy for the tip that this is possible.
  • Loading branch information
douglatornell committed Oct 11, 2022
1 parent 149a1b1 commit eef82d3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 25 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up conda environment
- name: Set up conda environment and install salishsea-site package
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge-pypy3
Expand All @@ -32,11 +32,6 @@ jobs:
environment-file: envs/environment-test.yaml
activate-environment: salishsea-site-test

- name: Install package
shell: bash -l {0}
run: |
python3 -m pip install --editable $GITHUB_WORKSPACE
- name: pytest package
shell: bash -l {0}
run: |
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/docs-linkcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up conda environment
- name: Set up conda environment and install salishsea-site package
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge-pypy3
Expand All @@ -34,11 +34,6 @@ jobs:
environment-file: envs/environment-test.yaml
activate-environment: salishsea-site-test

- name: Install package
shell: bash -l {0}
run: |
python3 -m pip install --editable $GITHUB_WORKSPACE
- name: linkcheck docs
shell: bash -l {0}
run: |
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/pytest-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up conda environment
- name: Set up conda environment and install salishsea-site package
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge-pypy3
Expand All @@ -30,11 +30,6 @@ jobs:
python-version: ${{ matrix.python-version }}
activate-environment: salishsea-site-test

- name: Install package
shell: bash -l {0}
run: |
python3 -m pip install --editable $GITHUB_WORKSPACE
- name: pytest package with coverage
shell: bash -l {0}
run: |
Expand Down
9 changes: 6 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,13 @@ and building the documentation with the commands:
$ cd salishsea-site
$ conda env create -f env/environment-dev.yaml
$ conda activate salishsea-site
(salishsea-site)$ python3 -m pip install --editable .
The :kbd:`--editable` option in the :command:`pip install` commands above installs the :kbd:`salishsea-site` package via a symlink so that it is automatically updated as the repo evolves.
The :kbd:`salishsea-site` package is installed in `editable install mode`_
as part of the conda environment creation process.
That means that the package is installed from the cloned repo via symlinks so that
it will be automatically updated as the repo evolves.

.. _editable install mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs

To deactivate the environment use:

Expand Down
5 changes: 3 additions & 2 deletions envs/environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#
# $ cd salishsea_site
# $ conda env create -f envs/environment-dev.yaml
# $ source activate salishsea-site
# (salishsea-site)$ python3 -m pip install --editable .

name: salishsea-site

Expand Down Expand Up @@ -42,3 +40,6 @@ dependencies:
- sentry-sdk
- supervisor
- waitress

# editable install of salishsea-site package
- --editable ../
5 changes: 3 additions & 2 deletions envs/environment-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#
# $ cd salishsea_site
# $ conda env create -f envs/environment-prod.yaml
# $ source activate salishsea-site
# (salishsea-site)$ python3 -m pip install --editable .

name: salishsea-site-env

Expand All @@ -28,3 +26,6 @@ dependencies:
- sentry-sdk
- supervisor
- waitress

# editable install of salishsea-site package
- --editable ../
3 changes: 3 additions & 0 deletions envs/environment-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ dependencies:
- sentry-sdk
- supervisor
- waitress

# editable install of salishsea-site package
- --editable ../

0 comments on commit eef82d3

Please sign in to comment.