Skip to content

Commit eb4be99

Browse files
Only pin theano-pymc in requirements.txt (#4322)
* 🔨 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 <[email protected]>
1 parent b953c40 commit eb4be99

11 files changed

+280
-102
lines changed

.github/workflows/arviz_compat.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ jobs:
3333
path: ~/conda_pkgs_dir
3434
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
3535
hashFiles('conda-envs/environment-dev-py38.yml') }}
36+
- name: Cache multiple paths
37+
uses: actions/cache@v2
38+
env:
39+
# Increase this value to reset cache if requirements.txt has not changed
40+
CACHE_NUMBER: 0
41+
with:
42+
path: |
43+
~/.cache/pip
44+
$RUNNER_TOOL_CACHE/Python/*
45+
~\AppData\Local\pip\Cache
46+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
47+
hashFiles('requirements.txt') }}
3648
- uses: conda-incubator/setup-miniconda@v2
3749
with:
3850
activate-environment: pymc3-dev-py38
@@ -47,7 +59,7 @@ jobs:
4759
- name: Install latest arviz
4860
run: |
4961
conda activate pymc3-dev-py38
50-
conda remove arviz -y
62+
pip uninstall arviz -y
5163
pip install git+git://github.com/arviz-devs/arviz.git
5264
- name: Run tests
5365
run: |

.github/workflows/pytest.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
--ignore=pymc3/tests/test_examples.py
2222
--ignore=pymc3/tests/test_gp.py
2323
--ignore=pymc3/tests/test_mixture.py
24+
--ignore=pymc3/tests/test_ode.py
2425
--ignore=pymc3/tests/test_parallel_sampling.py
2526
--ignore=pymc3/tests/test_posteriors.py
2627
--ignore=pymc3/tests/test_quadpotential.py
@@ -43,6 +44,7 @@ jobs:
4344
- |
4445
pymc3/tests/test_examples.py
4546
pymc3/tests/test_mixture.py
47+
pymc3/tests/test_ode.py
4648
pymc3/tests/test_posteriors.py
4749
pymc3/tests/test_quadpotential.py
4850
- |
@@ -74,6 +76,18 @@ jobs:
7476
path: ~/conda_pkgs_dir
7577
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
7678
hashFiles('conda-envs/environment-dev-py36.yml') }}
79+
- name: Cache multiple paths
80+
uses: actions/cache@v2
81+
env:
82+
# Increase this value to reset cache if requirements.txt has not changed
83+
CACHE_NUMBER: 0
84+
with:
85+
path: |
86+
~/.cache/pip
87+
$RUNNER_TOOL_CACHE/Python/*
88+
~\AppData\Local\pip\Cache
89+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
90+
hashFiles('requirements.txt') }}
7791
- uses: conda-incubator/setup-miniconda@v2
7892
with:
7993
activate-environment: pymc3-dev-py36

.github/workflows/windows.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,29 @@ jobs:
3232
path: ~/conda_pkgs_dir
3333
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
3434
hashFiles('conda-envs/environment-dev-py37.yml') }}
35+
- name: Cache multiple paths
36+
uses: actions/cache@v2
37+
env:
38+
# Increase this value to reset cache if requirements.txt has not changed
39+
CACHE_NUMBER: 0
40+
with:
41+
path: |
42+
~/.cache/pip
43+
$RUNNER_TOOL_CACHE/Python/*
44+
~\AppData\Local\pip\Cache
45+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
46+
hashFiles('requirements.txt') }}
3547
- uses: conda-incubator/setup-miniconda@v2
3648
with:
3749
activate-environment: pymc3-dev-py37
3850
channel-priority: strict
3951
environment-file: conda-envs/environment-dev-py37.yml
4052
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
53+
- name: Install-pymc3
54+
run: |
55+
conda activate pymc3-dev-py37
56+
pip install -e .
57+
python --version
4158
- run: |
4259
conda activate pymc3-dev-py37
4360
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ repos:
1111
- id: no-commit-to-branch
1212
args: [--branch, master]
1313
- id: requirements-txt-fixer
14+
exclude: ^requirements-dev\.txt$
1415
- id: trailing-whitespace
1516
- repo: https://github.com/nbQA-dev/nbQA
1617
rev: 0.5.4
@@ -61,6 +62,19 @@ repos:
6162
language: python
6263
name: Check no tests are ignored
6364
pass_filenames: false
65+
- id: conda-env-sort
66+
additional_dependencies: [pyyaml]
67+
entry: python scripts/sort_conda_envs.py
68+
files: ^conda-envs/
69+
language: python
70+
name: Sort dependencies in conda envs
71+
types: [yaml]
72+
- id: pip-from-conda
73+
additional_dependencies: [pyyaml]
74+
entry: python scripts/generate_pip_deps_from_conda.py
75+
files: ^conda-envs/
76+
language: python
77+
name: Generate pip dependency from conda
6478
- id: no-relative-imports
6579
name: No relative imports
6680
entry: from \.[\.\w]* import

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ We appreciate being notified of problems with the existing PyMC code. We prefer
1515

1616
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.
1717

18+
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.
19+
1820
# Contributing code via pull requests
1921

2022
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.
@@ -38,7 +40,7 @@ The preferred workflow for contributing to PyMC3 is to fork the [GitHub reposito
3840
3. Create a ``feature`` branch to hold your development changes:
3941

4042
```bash
41-
$ git switch -c my-feature
43+
$ git checkout -b my-feature
4244
```
4345

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

148150
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.
149151

152+
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.
153+
150154
#### This guide was derived from the [scikit-learn guide to contributing](https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md)

conda-envs/environment-dev-py36.yml

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
11
name: pymc3-dev-py36
22
channels:
3-
- conda-forge
4-
- defaults
3+
- conda-forge
4+
- defaults
55
dependencies:
6-
- python=3.6
7-
- arviz>=0.9
8-
- theano-pymc==1.0.12
9-
- numpy>=1.13
10-
- scipy>=0.18
11-
- pandas>=0.18
12-
- patsy>=0.5
13-
- fastprogress>=0.2
14-
- h5py>=2.7
15-
- typing-extensions>=3.7
16-
- python-graphviz
17-
- ipython>=7.16
18-
- nbsphinx>=0.4
19-
- numpydoc>=0.9
20-
- pre-commit>=2.8.0
21-
- pytest-cov>=2.5
22-
- pytest>=3.0
23-
- recommonmark>=0.4
24-
- sphinx-autobuild>=0.7
25-
- sphinx>=1.5
26-
- watermark
27-
- dataclasses # python_version < 3.7
28-
- contextvars # python_version < 3.7
29-
- mkl-service
30-
- dill
31-
- libblas=*=*mkl
6+
- contextvars
7+
- dataclasses
8+
- h5py>=2.7
9+
- ipython>=7.16
10+
- libblas=*=*mkl
11+
- mkl-service
12+
- nbsphinx>=0.4
13+
- numpydoc>=0.9
14+
- pre-commit>=2.8.0
15+
- pytest-cov>=2.5
16+
- pytest>=3.0
17+
- python-graphviz
18+
- python=3.6
19+
- recommonmark>=0.4
20+
- sphinx-autobuild>=0.7
21+
- sphinx>=1.5
22+
- watermark

conda-envs/environment-dev-py37.yml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
name: pymc3-dev-py37
22
channels:
3-
- conda-forge
4-
- defaults
3+
- conda-forge
4+
- defaults
55
dependencies:
6-
- python=3.7
7-
- arviz>=0.9
8-
- theano-pymc==1.0.12
9-
- numpy>=1.13
10-
- scipy>=0.18
11-
- pandas>=0.18
12-
- patsy>=0.5
13-
- fastprogress>=0.2
14-
- h5py>=2.7
15-
- typing-extensions>=3.7
16-
- python-graphviz
17-
- ipython>=7.16
18-
- nbsphinx>=0.4
19-
- numpydoc>=0.9
20-
- pre-commit>=2.8.0
21-
- pytest-cov>=2.5
22-
- pytest>=3.0
23-
- recommonmark>=0.4
24-
- sphinx-autobuild>=0.7
25-
- sphinx>=1.5
26-
- watermark
27-
- mkl-service
28-
- dill
29-
- libblas=*=*mkl
6+
- h5py>=2.7
7+
- ipython>=7.16
8+
- libblas=*=*mkl
9+
- mkl-service
10+
- nbsphinx>=0.4
11+
- numpydoc>=0.9
12+
- pre-commit>=2.8.0
13+
- pytest-cov>=2.5
14+
- pytest>=3.0
15+
- python-graphviz
16+
- python=3.7
17+
- recommonmark>=0.4
18+
- sphinx-autobuild>=0.7
19+
- sphinx>=1.5
20+
- watermark

conda-envs/environment-dev-py38.yml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
name: pymc3-dev-py38
22
channels:
3-
- conda-forge
4-
- defaults
3+
- conda-forge
4+
- defaults
55
dependencies:
6-
- python=3.8
7-
- arviz>=0.9
8-
- theano-pymc==1.0.12
9-
- numpy>=1.13
10-
- scipy>=0.18
11-
- pandas>=0.18
12-
- patsy>=0.5
13-
- fastprogress>=0.2
14-
- h5py>=2.7
15-
- typing-extensions>=3.7
16-
- python-graphviz
17-
- ipython>=7.16
18-
- nbsphinx>=0.4
19-
- numpydoc>=0.9
20-
- pre-commit>=2.8.0
21-
- pytest-cov>=2.5
22-
- pytest>=3.0
23-
- recommonmark>=0.4
24-
- sphinx-autobuild>=0.7
25-
- sphinx>=1.5
26-
- watermark
27-
- mkl-service
28-
- dill
29-
- libblas=*=*mkl
6+
- h5py>=2.7
7+
- ipython>=7.16
8+
- libblas=*=*mkl
9+
- mkl-service
10+
- nbsphinx>=0.4
11+
- numpydoc>=0.9
12+
- pre-commit>=2.8.0
13+
- pytest-cov>=2.5
14+
- pytest>=3.0
15+
- python-graphviz
16+
- python=3.8
17+
- recommonmark>=0.4
18+
- sphinx-autobuild>=0.7
19+
- sphinx>=1.5
20+
- watermark

requirements-dev.txt

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
bokeh>=0.12.13
2-
coverage>=5.1
3-
dill
4-
graphviz>=0.8.3
5-
ipython
6-
nbsphinx>=0.4.2
7-
nose>=1.3.7
8-
nose-parameterized==0.6.0
9-
numpydoc>=0.9.1
10-
parameterized
1+
# This file is auto-generated from by scripts/generate_pip_deps_from_conda.py, do not modify.
2+
# See that file for comments about the need/usage of each dependency.
3+
4+
h5py>=2.7
5+
ipython>=7.16
6+
nbsphinx>=0.4
7+
numpydoc>=0.9
118
pre-commit>=2.8.0
12-
pycodestyle>=2.3.1
13-
pyflakes>=1.5.0
14-
pylint>=1.7.4
15-
pytest>=3.0.7
16-
pytest-cov>=2.5.1
17-
pytest-xdist
18-
recommonmark>=0.4.0
19-
seaborn>=0.8.1
20-
sphinx>=1.5.5
21-
sphinx-autobuild==0.7.1
9+
pytest-cov>=2.5
10+
pytest>=3.0
11+
recommonmark>=0.4
12+
sphinx-autobuild>=0.7
13+
sphinx>=1.5
2214
watermark

0 commit comments

Comments
 (0)