Skip to content

Update contributing guide, fail fast - #4280

Merged
twiecki merged 22 commits into
pymc-devs:masterfrom
MarcoGorelli:update-contributing
Dec 1, 2020
Merged

Update contributing guide, fail fast#4280
twiecki merged 22 commits into
pymc-devs:masterfrom
MarcoGorelli:update-contributing

Conversation

@MarcoGorelli

@MarcoGorelli MarcoGorelli commented Nov 30, 2020

Copy link
Copy Markdown
Contributor
  • update contributing guide to advise using conda
  • use fail_fast in githubactions so that a single failing test doesn't block the other jobs
  • locally install pymc3 during CI
  • remove documentation-related packages from environment-dev.yml, so it only contains development packages

closes #4281

run: |
conda activate testenv
conda remove arviz -y
pip install -e .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's probably good to check this works, in case there are any errors in setup.py - it only takes about 5 seconds during CI anyway

Comment thread CONTRIBUTING.md Outdated

```bash
$ conda env create -f environment-dev.yml
$ conda activate testenv

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use a more explicit name for the virtual env, maybe pymc-dev-env instead of testenv?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just pymc3-dev - sure!

@codecov

codecov Bot commented Nov 30, 2020

Copy link
Copy Markdown

Codecov Report

Merging #4280 (9ada716) into master (162fd92) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4280      +/-   ##
==========================================
- Coverage   87.61%   87.59%   -0.03%     
==========================================
  Files          88       88              
  Lines       14312    14312              
==========================================
- Hits        12539    12536       -3     
- Misses       1773     1776       +3     
Impacted Files Coverage Δ
pymc3/parallel_sampling.py 85.84% <0.00%> (-0.95%) ⬇️

Comment thread CONTRIBUTING.md

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git's new way of switching branches - git checkout still works, but this is meant to be more intuitive to beginners

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this creates a new branch too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, -c for "create"

Comment thread CONTRIBUTING.md

```bash
$ pip install -r requirements.txt
$ pip install -e .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this includes all the requirements.txt already + gives a local editable install

Comment thread environment-dev.yml
Comment on lines -27 to -30
- recommonmark>=0.4
- seaborn>=0.8
- sphinx-autobuild>=0.7
- sphinx>=1.5

@MarcoGorelli MarcoGorelli Nov 30, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to have all these documentation-related dependencies in here or can they be removed? I don't know how the docs are built, but maybe these could live in a separate environment-docs.yml environment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can move these to a separate env file, but shouldn't just drop them here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - ended up putting them back an, as they don't take up much extra time anyway, all I've removed now are some nose/unittest-related ones (which shouldn't be necessary any more, given that pytest is used?), and some (bokeh and seaborn) which are only used in a handful of notebooks

Comment thread .github/workflows/arviz_compat.yml
@MarcoGorelli MarcoGorelli changed the title WIP Update contributing guide Update contributing guide, fail fast Nov 30, 2020
@MarcoGorelli
MarcoGorelli requested a review from twiecki November 30, 2020 17:18
@MarcoGorelli MarcoGorelli removed the WIP label Nov 30, 2020
Comment thread environment-dev.yml
- defaults
dependencies:
- python>=3.6
- python=3.6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you fix this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting conflicts when I removed that, made an environment with Python 3.7, and then updated from the file, see #4281

I think we should maybe make three different environment files: environment-dev-py36.yml, environment-dev-py37.yml, and environment-dev-py38.yml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tried that, and it works fine (no conflicts!), so that's what I've pushed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's necessary. Can't we pin 38 here instead?

@MarcoGorelli MarcoGorelli Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in, pin 3.8 here and then run the tests using that?

could do, but I would've thought it would be better to run the tests on the earliest supported version of Python, else someone could accidentally use something modern (e.g. the walrus operator), tests pass, but then pymc3 breaks when people install it using Python3.6. On the other hand, if the tests pass on Python3.6, it's far less likely that they'll break on Python3.8

Like this, the full test suite can be run with environment-dev-py36.yml, the arviz compatitiblity tests with environment-dev-py38.yml, and hopefully most bases will be covered

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so dev is used to specify the GH action env?

I was thinking this is for people who want to set up a dev environment locally. I suppose it can be both in which case your suggestion of having different envs for different python versions would make sense.

@MarcoGorelli MarcoGorelli Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, that's right - check .github/workflows/pytest.yml

      - uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: pymc3-dev-py36
          channel-priority: strict
          environment-file: conda-envs/environment-dev-py36.yml
          use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

(on master it's currently environment-dev.yml)

@twiecki
twiecki merged commit 7ff2f49 into pymc-devs:master Dec 1, 2020
@twiecki

twiecki commented Dec 1, 2020

Copy link
Copy Markdown
Member

This is great, thanks @MarcoGorelli!

@MarcoGorelli
MarcoGorelli deleted the update-contributing branch December 1, 2020 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUILD specifying Python version to setup_miniconda causes conflicts

3 participants