QCFractal icon indicating copy to clipboard operation
QCFractal copied to clipboard

Installation of qcfractal conda package registers pytest options for whole environment

Open dotsdl opened this issue 4 years ago • 0 comments

Describe the bug

Installing qcfractal sets testing options --runslow and --runexamples for pytest globally (within the conda env). This can cause hard-to-diagnose problems for testing of other packages, in particular those that use similar flags, e.g. openforcefield.

This effectively means that installation of qcfractal will change the behavior of pytest for other packages in the same environment, even if they don't use qcfractal at all themselves.

To Reproduce

git clone [email protected]:openforcefield/openforcefield.git
cd openforcefield

# create a new conda env that grabs all openforcefield deps, 
# but removes the openforcefield conda package and replaces it with a local development dir
conda create -n off-dev -c conda-forge -c omnia -c openeye openforcefield openeye-toolkits
conda activate off-dev
conda remove --force openforcefield
pip install -e .

# should run without issue
pytest

# now install qcfractal
conda install -c conda-forge qcfractal

# will give a `ValueError: option names {'--runslow'} already added`
pytest

Expected behavior

I expected pytest to run the openforcefield tests in the same way before and after installation of qcfractal.

Additional context

We (@j-wags, @mattwthompson) believe this can be solved by removal of the pytest11 entrypoint without detrimental effects to testing qcfractal. We are not certain if this is exactly the right approach, however. We can work around this issue by using our own distinct slowopenff keyword for marking execution of slow tests, but this issue may end up biting other developers and was hard to identify. The output of pytest --version was the only thing that tipped us off to this issue:

setuptools registered plugins:
  qcfractal-0.13.1 at /home/david/.conda/envs/off-dev/lib/python3.7/site-packages/qcfractal/testing.py

dotsdl avatar Apr 01 '20 20:04 dotsdl