Skip to content

Commit

Permalink
Only pin theano-pymc in requirements.txt (#4322)
Browse files Browse the repository at this point in the history
* 🔨 add scripts to check theano-pymc pins, to generate requirements-dev from conda, to sort conda deps

* 🔧 update conda envs and requirements-dev.txt

* 📝 fix typo

* 📝 add docstrings

* 📝 update pip-to-conda docstring

* noop

* 🔥 remove pin theano checks, just use requirements.txt

* local install in arviz compat

* 📝 switch -> checkout, note beginner friendly label

* 📝 link to beginner friendly issues

* run generate pip deps from conda on all conda env files

* 🔧 make sure all conda-envs files generate requirements-dev

* 🔀 reorder some tests

* 🎨 remove trailing comma

* Update scripts/generate_pip_deps_from_conda.py

Co-authored-by: Thomas Wiecki <thomas.wiecki@gmail.com>
  • Loading branch information
MarcoGorelli and twiecki authored Dec 11, 2020
1 parent b953c40 commit eb4be99
Show file tree
Hide file tree
Showing 11 changed files with 280 additions and 102 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/arviz_compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ jobs:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py38.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py38
Expand All @@ -47,7 +59,7 @@ jobs:
- name: Install latest arviz
run: |
conda activate pymc3-dev-py38
conda remove arviz -y
pip uninstall arviz -y
pip install git+git://github.com/arviz-devs/arviz.git
- name: Run tests
run: |
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
--ignore=pymc3/tests/test_examples.py
--ignore=pymc3/tests/test_gp.py
--ignore=pymc3/tests/test_mixture.py
--ignore=pymc3/tests/test_ode.py
--ignore=pymc3/tests/test_parallel_sampling.py
--ignore=pymc3/tests/test_posteriors.py
--ignore=pymc3/tests/test_quadpotential.py
Expand All @@ -43,6 +44,7 @@ jobs:
- |
pymc3/tests/test_examples.py
pymc3/tests/test_mixture.py
pymc3/tests/test_ode.py
pymc3/tests/test_posteriors.py
pymc3/tests/test_quadpotential.py
- |
Expand Down Expand Up @@ -74,6 +76,18 @@ jobs:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py36.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py36
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,29 @@ jobs:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py37.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py37
channel-priority: strict
environment-file: conda-envs/environment-dev-py37.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc3
run: |
conda activate pymc3-dev-py37
pip install -e .
python --version
- run: |
conda activate pymc3-dev-py37
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repos:
- id: no-commit-to-branch
args: [--branch, master]
- id: requirements-txt-fixer
exclude: ^requirements-dev\.txt$
- id: trailing-whitespace
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.5.4
Expand Down Expand Up @@ -61,6 +62,19 @@ repos:
language: python
name: Check no tests are ignored
pass_filenames: false
- id: conda-env-sort
additional_dependencies: [pyyaml]
entry: python scripts/sort_conda_envs.py
files: ^conda-envs/
language: python
name: Sort dependencies in conda envs
types: [yaml]
- id: pip-from-conda
additional_dependencies: [pyyaml]
entry: python scripts/generate_pip_deps_from_conda.py
files: ^conda-envs/
language: python
name: Generate pip dependency from conda
- id: no-relative-imports
name: No relative imports
entry: from \.[\.\w]* import
Expand Down
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ We appreciate being notified of problems with the existing PyMC code. We prefer

Please verify that your issue is not being currently addressed by other issues or pull requests by using the GitHub search tool to look for key words in the project issue tracker.

Filter on the ["beginner friendly"](https://github.com/pymc-devs/pymc3/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22) label for issues which are good for new contributors.

# Contributing code via pull requests

While issue reporting is valuable, we strongly encourage users who are inclined to do so to submit patches for new or existing issues via pull requests. This is particularly the case for simple fixes, such as typos or tweaks to documentation, which do not require a heavy investment of time and attention.
Expand All @@ -38,7 +40,7 @@ The preferred workflow for contributing to PyMC3 is to fork the [GitHub reposito
3. Create a ``feature`` branch to hold your development changes:

```bash
$ git switch -c my-feature
$ git checkout -b my-feature
```

Always use a ``feature`` branch. It's good practice to never routinely work on the ``master`` branch of any repository.
Expand Down Expand Up @@ -147,4 +149,6 @@ Follow [TensorFlow's style guide](https://www.tensorflow.org/community/contribut

For documentation strings, we *prefer* [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html) to comply with the style that predominates in our upstream dependencies.

Finally, see the [PyMC3 Python Code Style](https://github.com/pymc-devs/pymc3/wiki/PyMC3-Python-Code-Style) and the [PyMC's Jupyter Notebook Style](https://github.com/pymc-devs/pymc3/wiki/PyMC's-Jupyter-Notebook-Style) guides.

#### This guide was derived from the [scikit-learn guide to contributing](https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md)
47 changes: 19 additions & 28 deletions conda-envs/environment-dev-py36.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
name: pymc3-dev-py36
channels:
- conda-forge
- defaults
- conda-forge
- defaults
dependencies:
- python=3.6
- arviz>=0.9
- theano-pymc==1.0.12
- numpy>=1.13
- scipy>=0.18
- pandas>=0.18
- patsy>=0.5
- fastprogress>=0.2
- h5py>=2.7
- typing-extensions>=3.7
- python-graphviz
- ipython>=7.16
- nbsphinx>=0.4
- numpydoc>=0.9
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
- recommonmark>=0.4
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
- dataclasses # python_version < 3.7
- contextvars # python_version < 3.7
- mkl-service
- dill
- libblas=*=*mkl
- contextvars
- dataclasses
- h5py>=2.7
- ipython>=7.16
- libblas=*=*mkl
- mkl-service
- nbsphinx>=0.4
- numpydoc>=0.9
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.6
- recommonmark>=0.4
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
43 changes: 17 additions & 26 deletions conda-envs/environment-dev-py37.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
name: pymc3-dev-py37
channels:
- conda-forge
- defaults
- conda-forge
- defaults
dependencies:
- python=3.7
- arviz>=0.9
- theano-pymc==1.0.12
- numpy>=1.13
- scipy>=0.18
- pandas>=0.18
- patsy>=0.5
- fastprogress>=0.2
- h5py>=2.7
- typing-extensions>=3.7
- python-graphviz
- ipython>=7.16
- nbsphinx>=0.4
- numpydoc>=0.9
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
- recommonmark>=0.4
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
- mkl-service
- dill
- libblas=*=*mkl
- h5py>=2.7
- ipython>=7.16
- libblas=*=*mkl
- mkl-service
- nbsphinx>=0.4
- numpydoc>=0.9
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.7
- recommonmark>=0.4
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
43 changes: 17 additions & 26 deletions conda-envs/environment-dev-py38.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
name: pymc3-dev-py38
channels:
- conda-forge
- defaults
- conda-forge
- defaults
dependencies:
- python=3.8
- arviz>=0.9
- theano-pymc==1.0.12
- numpy>=1.13
- scipy>=0.18
- pandas>=0.18
- patsy>=0.5
- fastprogress>=0.2
- h5py>=2.7
- typing-extensions>=3.7
- python-graphviz
- ipython>=7.16
- nbsphinx>=0.4
- numpydoc>=0.9
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
- recommonmark>=0.4
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
- mkl-service
- dill
- libblas=*=*mkl
- h5py>=2.7
- ipython>=7.16
- libblas=*=*mkl
- mkl-service
- nbsphinx>=0.4
- numpydoc>=0.9
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.8
- recommonmark>=0.4
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
32 changes: 12 additions & 20 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
bokeh>=0.12.13
coverage>=5.1
dill
graphviz>=0.8.3
ipython
nbsphinx>=0.4.2
nose>=1.3.7
nose-parameterized==0.6.0
numpydoc>=0.9.1
parameterized
# This file is auto-generated from by scripts/generate_pip_deps_from_conda.py, do not modify.
# See that file for comments about the need/usage of each dependency.

h5py>=2.7
ipython>=7.16
nbsphinx>=0.4
numpydoc>=0.9
pre-commit>=2.8.0
pycodestyle>=2.3.1
pyflakes>=1.5.0
pylint>=1.7.4
pytest>=3.0.7
pytest-cov>=2.5.1
pytest-xdist
recommonmark>=0.4.0
seaborn>=0.8.1
sphinx>=1.5.5
sphinx-autobuild==0.7.1
pytest-cov>=2.5
pytest>=3.0
recommonmark>=0.4
sphinx-autobuild>=0.7
sphinx>=1.5
watermark
Loading

0 comments on commit eb4be99

Please sign in to comment.