Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tox test config. #36

Merged
merged 3 commits into from Dec 14, 2022
Merged

Conversation

asford
Copy link
Contributor

@asford asford commented Nov 29, 2022

Add a basic tox configuration to execute tests against
multiple python versions in a local development environment.

Tox is used to initialize an isolated python environment for tests,
including any required external dependencies.

This config uses tox-conda to support multiple python interpreter
versions.


Possible options:

  • Add tox notes to README.md contributor instructions.

  • Convert actions workflows to use tox for different python versions.

  • Add basic tox config for different python versions

  • Remove py311 from tox env list, currently broken

@jaltmayerpizzorno jaltmayerpizzorno merged commit 45dda2a into plasma-umass:main Dec 14, 2022
@jaltmayerpizzorno
Copy link
Collaborator

jaltmayerpizzorno commented Dec 14, 2022

@asford, does py38 for you? For me, py38 fails (but py311 succeeds).

py38 develop-inst-noop: /home/juan/project/slipcover
py38 installed: absl-py==0.11.0,astunparse==1.6.3,attrs==22.1.0,auditwheel==4.0.0,cachetools==4.1.1,click==8.1.2,cloudpickle==1.6.0,colorama==0.4.3,commonmark==0.9.1,coverage==6.3.2,cupy-cuda111==9.5.0,Cython==0.29.28,execnet==1.9.0,fastrlock==0.6,find-libpython==0.2.0,Flask @ file:///home/juan/tmp/flask,flatbuffers==1.12,fonttools==4.29.0,gast==0.3.3,google-auth==1.18.0,google-auth-oauthlib==0.4.1,google-pasta==0.2.0,GPUtil==1.4.0,grpcio==1.32.0,gviz-api==1.9.0,h5py==2.10.0,hypothesis==6.39.3,importlib-metadata==4.11.3,iniconfig==1.1.1,joblib==1.1.0,Keras==2.4.3,Keras-Preprocessing==1.1.2,kito==1.0.4,matplotlib==3.5.1,memory-profiler==0.57.0,nulltracer @ file:///home/juan/project/nulltracer,numpy==1.19.5,nvidia-ml-py==11.450.51,opt-einsum==3.3.0,packaging==22.0,pluggy==1.0.0,protobuf==3.12.2,py==1.11.0,py-cpuinfo==8.0.0,py-spy==0.3.12,pyasn1==0.4.8,pyasn1-modules==0.2.8,pyelftools==0.27,pyerfa==2.0.0.1,Pygments==2.7.1,pynvml==11.4.1,pyperf==2.3.0,pysqlite3-binary==0.4.3,pystack-debugger==0.9.0,pytest==7.0.1,pytest-arraydiff==0.5.0,pytest-astropy==0.9.0,pytest-astropy-header==0.1.2,pytest-cov==3.0.0,pytest-doctestplus==0.12.0,pytest-filter-subpackage==0.1.1,pytest-forked==1.4.0,pytest-mock==3.7.0,pytest-openfiles==0.5.0,pytest-remotedata==0.3.3,pytest-xdist==2.5.0,requests-oauthlib==1.3.0,rich==9.13.0,rsa==4.6,-e git+ssh://git@github.com/plasma-umass/scalene.git@2026a24f7f16ac20da9d1ad306f6443db06a35b4#egg=scalene,scikit-learn @ file:///home/juan/tmp/scikit-learn,scipy==1.4.1,shyaml==0.6.2,six==1.15.0,-e git+ssh://git@github.com/jaltmayerpizzorno/slipcover.git@45dda2aceedc97e9902f48998276ed352e703da2#egg=slipcover,sortedcontainers==2.4.0,tabulate==0.8.9,tb-nightly==2.4.0a20200916,tensorboard==2.4.0,tensorboard-plugin-profile==2.3.0,tensorboard-plugin-wit==1.7.0,tensorflow-estimator==2.4.0,termcolor==1.1.0,tf-estimator-nightly==2.4.0.dev2020091601,tflite-runtime==2.5.0,threadpoolctl==3.1.0,tomli==2.0.1,torch==1.10.0,torchsummary==1.5.1,typing-extensions==3.10.0.2,Werkzeug==2.1.1,wrapt==1.12.1
py38 run-test-pre: PYTHONHASHSEED='249300130'
py38 run-test: commands[0] | pytest
WARNING: test command found but not installed in testenv
  cmd: /home/juan/anaconda3/bin/pytest
  env: /home/juan/project/slipcover/.tox/py38
Maybe you forgot to specify a dependency? See also the allowlist_externals envconfig setting.

DEPRECATION WARNING: this will be an error in tox 4 and above!
==================================================================== test session starts ====================================================================
platform linux -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0
cachedir: .tox/py38/.pytest_cache
rootdir: /home/juan/project/slipcover
plugins: anyio-3.5.0
collected 0 items / 3 errors                                                                                                                                

========================================================================== ERRORS ===========================================================================
___________________________________________________________ ERROR collecting tests/branch_test.py ___________________________________________________________
ImportError while importing test module '/home/juan/project/slipcover/tests/branch_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/branch_test.py:3: in <module>
    import slipcover.branch as br
E   ModuleNotFoundError: No module named 'slipcover'
__________________________________________________________ ERROR collecting tests/bytecode_test.py __________________________________________________________
ImportError while importing test module '/home/juan/project/slipcover/tests/bytecode_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/bytecode_test.py:2: in <module>
    from slipcover import bytecode as bc
E   ModuleNotFoundError: No module named 'slipcover'
_________________________________________________________ ERROR collecting tests/slipcover_test.py __________________________________________________________
ImportError while importing test module '/home/juan/project/slipcover/tests/slipcover_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/slipcover_test.py:2: in <module>
    from slipcover import slipcover as sc
E   ModuleNotFoundError: No module named 'slipcover'
================================================================== short test summary info ==================================================================
ERROR tests/branch_test.py
ERROR tests/bytecode_test.py
ERROR tests/slipcover_test.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================== 3 errors in 0.09s =====================================================================
ERROR: InvocationError for command /home/juan/anaconda3/bin/pytest (exited with code 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants