Skip to content

Commit

Permalink
Get rid of python-version specific conda dev environments
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Jun 20, 2022
1 parent a383526 commit f3aa561
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:
- id: pip-from-conda
additional_dependencies: [pyyaml]
entry: python scripts/generate_pip_deps_from_conda.py
files: ^conda-envs/environment-dev-py.+.yml$
files: ^conda-envs/environment-dev.yml$
language: python
name: Generate pip dependency from conda
- id: no-relative-imports
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python:
path: .

conda:
environment: "conda-envs/environment-dev-py38.yml"
environment: "conda-envs/environment-dev.yml"

build:
os: "ubuntu-20.04"
Expand Down
41 changes: 0 additions & 41 deletions conda-envs/environment-dev-py38.yml

This file was deleted.

41 changes: 0 additions & 41 deletions conda-envs/environment-dev-py39.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# "dev" conda envs are to be used by devs in setting their local environments
name: pymc-dev-py37
name: pymc-dev
channels:
- conda-forge
- defaults
Expand Down Expand Up @@ -30,6 +30,8 @@ dependencies:
- pydata-sphinx-theme
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- scipy>=1.4.1
- sphinx-copybutton
- sphinx-notfound-page
- sphinx>=1.5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# "dev" conda envs are to be used by devs in setting their local environments
name: pymc-dev-py38
name: pymc-dev
channels:
- conda-forge
- defaults
Expand All @@ -17,7 +17,6 @@ dependencies:
- numpy>=1.15.0
- pandas>=0.24.0
- pip
- python=3.8
- python-graphviz
- scipy>=1.4.1
- typing-extensions>=3.7.4
Expand Down
6 changes: 3 additions & 3 deletions docs/source/contributing/pr_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ The preferred workflow for contributing to PyMC is to fork the [GitHub repositor
:::{tab-item} Linux/MacOS

```bash
conda env create -f conda-envs/environment-dev-py39.yml # or py3x
conda env create -f conda-envs/environment-dev.yml
```
:::
:::{tab-item} Windows
```bash
conda env create -f .\conda-envs\windows-environment-dev-py39.yml
conda env create -f .\conda-envs\windows-environment-dev.yml
```
:::
::::

```bash
conda activate pymc-dev-py39
conda activate pymc-dev
pip install -e .
```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/python_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ __Pre-commit repeatedly complains about the same formatting changes__

Check the unstaged changes (see previous point).

__Whitespace changes in the `environment-dev-*.yml` files__
__Whitespace changes in the `environment-dev.yml` files__

On Windows, there are some bugs in pre-commit hooks that can lead to changes in some environment YAML files.
Until this is fixed upstream, you should __ignore these changes__.
Expand Down
8 changes: 4 additions & 4 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
# Switch to jovyan to avoid container runs as root
USER $NB_UID

COPY /conda-envs/environment-dev-py39.yml .
RUN mamba env create -f environment-dev-py39.yml && \
/bin/bash -c ". activate pymc-dev-py39 && \
COPY /conda-envs/environment-dev.yml .
RUN mamba env create -f environment-dev.yml && \
/bin/bash -c ". activate pymc-dev && \
mamba install -c conda-forge -y pymc" && \
conda clean --all -f -y

Expand All @@ -22,7 +22,7 @@ WORKDIR /home/jovyan/work

# For running from bash
SHELL ["/bin/bash","-c"]
RUN echo "conda activate pymc-dev-py39" >> ~/.bashrc && \
RUN echo "conda activate pymc-dev" >> ~/.bashrc && \
source ~/.bashrc

# For running from jupyter notebook
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_pip_deps_from_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""
Check requirements-dev.txt has been generated from conda-envs/environment-dev-py3*.yml
Check requirements-dev.txt has been generated from conda-envs/environment-dev.yml
This is intended to be used as a pre-commit hook, see `.pre-commit-config.yaml`.
You can run it manually with `pre-commit run pip-from-conda --all`.
Expand Down

0 comments on commit f3aa561

Please sign in to comment.