Giter VIP home page Giter VIP logo

tox-pyenv's People

Contributors

gaborbernat avatar stavxyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tox-pyenv's Issues

Migrate to tox-dev and v4 support

Hello, would you consider moving the project under the tox-dev umbrella? See documentation under https://tox.readthedocs.io/en/rewrite/plugins.html#adoption-of-a-plugin-under-tox-dev-github-organization

Furthermore, tox v4 is getting ready and we'd like to make sure this plugin is supported from day 1, we're collecting feature gaps for this under tox-dev/tox#1974. Would be great if you could join our development chat under https://discord.gg/tox so we can assist with this. If you do so please drop in a line in the #plugin chat with the name of the repository you maintain. Thanks!

Unable to locate pyenv interpreters

Issue

Using pyenv I have multiple interpreters installed

pyenv versions
  system
  3.6.10
  3.7.6
  3.8.0
* 3.8.1 (set by /home/varun/.pyenv/version)

However, when I run tox, I get the output:

tox
GLOB sdist-make: /home/varun/projects/nuke/setup.py
py36 recreate: /home/varun/projects/nuke/.tox/py36
ERROR: InterpreterNotFound: python3.6
py37 recreate: /home/varun/projects/nuke/.tox/py37
ERROR: InterpreterNotFound: python3.7
py38 inst-nodeps: /home/varun/projects/nuke/.tox/.tmp/package/1/nuke-2.4.3.zip
py38 installed: args==0.1.0,attrs==19.3.0,Click==7.0,colorama==0.3.9,crayons==0.3.0,more-itertools==8.4.0,nuke @ file:///home/varun/projects/nuke/.tox/.tmp/package/1/nuke-2.4.3.zip,packaging==20.4,pluggy==0.13.1,py==1.4.34,pypandoc==1.4,pyparsing==2.4.7,pytest==5.4.3,six==1.15.0,wcwidth==0.2.5
py38 run-test-pre: PYTHONHASHSEED='2434039302'
py38 run-test: commands[0] | pytest -s -v

Expected Behavior

tox runs my tests with all the specified interpreters and doesn't complain about missing interpreters.

Configuration

This is my tox.ini file:

[tox]
envlist = py36, py37, py38

[testenv]
commands = pytest -s -v
deps =
    pytest
    -rrequirements.txt

This is the pip package installed

pip show tox-pyenv
Name: tox-pyenv
Version: 1.1.0
Summary: tox plugin that makes tox use `pyenv which` to find python executables
Home-page: https://github.com/samstav/tox-pyenv
Author: Sam Stavinoha
Author-email: [email protected]
License: Apache License, Version 2.0
Location: /home/varun/.pyenv/versions/3.8.1/lib/python3.8/site-packages
Requires: tox
Required-by: 

and I am on Arch Linux.

Am I doing something weird? I followed everything on the README.

allow tox-pyenv to install missing python interpretors

At this moment there are manual steps one should take in order to install all python environments needed for testing using tox-pyenv. The project homepage specifies on how to install these on CircleCI on the home page.

How about if we can automatically install missing python interpreters so a simple execution of tox would install them when they are missing.

This would make testing much easier on various CI systems (Travis, Jenkins) and even development environment.

If there are concerns regarding change of behaviour we could make this optional by adding an option named install_missing_interpreters = true to tox.ini.

`tox_pyenv_fallback` in testenv definition is not honored

Set tox_pyenv_fallback in general testenv definition and test with tox --showconfig.

Setting tox_pyenv_fallback to both true or false results in tox_pyenv_fallback = True output from tox --showconfig.
Providing --tox-pyenv-no-fallback on the command line allows testenv definition tox_pyenv_fallback to take control...

missing pyenv should not break tox

If someone installs tox-pyenv module and pyenv tool is not present you endup with a totally broken tox which would fail to build any tox.ini file.

I think that tox-pyenv should only raise a warning if pyenv is not installed and avoid throwing an exception.

pyenv is used to get additional python interpreters on some platforms but this does not mean that they are really needed. If someone wants to fail on missing pyenv, you could add an enforcing option in the config.

Still, default behaviour should be not to break tox when pyenv is not installed.

[mini] err:   File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
[mini] err:     "__main__", fname, loader, pkg_name)
[mini] err:   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
[mini] err:     exec code in run_globals
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/__main__.py", line 4, in <module>
[mini] err:     main()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 39, in main
[mini] err:     retcode = Session(config).runcommand()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 390, in runcommand
[mini] err:     return self.subcommand_test()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 541, in subcommand_test
[mini] err:     if self.setupenv(venv):
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 449, in setupenv
[mini] err:     status = venv.update(action=action)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 161, in update
[mini] err:     self.hook.tox_testenv_create(action=action, venv=self)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 745, in __call__
[mini] err:     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 339, in _hookexec
[mini] err:     return self._inner_hookexec(hook, methods, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 334, in <lambda>
[mini] err:     _MultiCall(methods, kwargs, hook.spec_opts).execute()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 614, in execute
[mini] err:     res = hook_impl.function(*args)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 398, in tox_testenv_create
[mini] err:     config_interpreter = venv.getsupportedinterpreter()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 199, in getsupportedinterpreter
[mini] err:     return self.envconfig.getsupportedinterpreter()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 623, in getsupportedinterpreter
[mini] err:     info = self.config.interpreters.get_info(envconfig=self)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/interpreters.py", line 28, in get_info
[mini] err:     executable = self.get_executable(envconfig)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/interpreters.py", line 23, in get_executable
[mini] err:     exe = self.hook.tox_get_python_executable(envconfig=envconfig)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 745, in __call__
[mini] err:     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 339, in _hookexec
[mini] err:     return self._inner_hookexec(hook, methods, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 334, in <lambda>
[mini] err:     _MultiCall(methods, kwargs, hook.spec_opts).execute()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 614, in execute
[mini] err:     res = hook_impl.function(*args)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox_pyenv.py", line 83, in tox_get_python_executable
[mini] err:     "pyenv doesn't seem to be installed, you probably "
[mini] err: tox_pyenv.PyenvMissing: pyenv doesn't seem to be installed, you probably don't want this plugin installed either.

CircleCI 2.0 compatible?

Am I correct that the comment on README regarding "the list of python versions that are pre-installed in the CircleCI build environment (as of 09/27/2017)", does not apply in CircleCI 2.0?

Any recommendations on usage for CircleCI 2.0?

Thanks

Improve basic documentation in description

Hello! I found this plugin when looking for doc about Python / tox usage in CircleCI. The current doc doesn’t explain clearly what problem it solves, and my tox config that doesn’t use it seems to work.

tox-pyenv should not throw exception if pyenv is missing

Currently if someone is installing tox-pyenv on a system without pyenv it will break any execution of tox with an exception like:

15:36:20   File "/usr/lib/python2.7/site-packages/pluggy.py", line 596, in execute
15:36:20     res = hook_impl.function(*args)
15:36:20   File "/usr/lib/python2.7/site-packages/tox_pyenv.py", line 83, in tox_get_python_executable
15:36:20     "pyenv doesn't seem to be installed, you probably "
15:36:20 tox_pyenv.PyenvMissing: pyenv doesn't seem to be installed, you probably don't want this plugin installed either.

Giving an warning would be ok but failing execution is clearly a big issue, especially because tox would pass otherwise.

Not compatible with Python 3.7?

I tried to install with with conda, but get this problems:

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:
Specifications:

  • tox-pyenv -> python[version='>=3.6,<3.7.0a0']
    Your python: python=3.7

tox 4.x and tox-pyenv: ImportError: cannot import name 'hookimpl' from 'tox'

Looks like the current release 1.1.0 does NOT play nicely with tox 4.x.

In addition to the bug documented here:
#21

On adding the "py" package, the next error uncovered is:

(tox) root@9cb1a471f174:~# tox --version
ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at /root
Traceback (most recent call last):
File "/root/tox/bin/tox", line 8, in
sys.exit(run())
File "/root/tox/lib/python3.8/site-packages/tox/run.py", line 19, in run
result = main(sys.argv[1:] if args is None else args)
File "/root/tox/lib/python3.8/site-packages/tox/run.py", line 38, in main
state = setup_state(args)
File "/root/tox/lib/python3.8/site-packages/tox/run.py", line 53, in setup_state
options = get_options(*args)
File "/root/tox/lib/python3.8/site-packages/tox/config/cli/parse.py", line 38, in get_options
guess_verbosity, log_handler, source = _get_base(args)
File "/root/tox/lib/python3.8/site-packages/tox/config/cli/parse.py", line 61, in _get_base
MANAGER.load_plugins(source.path)
File "/root/tox/lib/python3.8/site-packages/tox/plugin/manager.py", line 83, in load_plugins
self._register_plugins(inline)
File "/root/tox/lib/python3.8/site-packages/tox/plugin/manager.py", line 37, in _register_plugins
self.manager.load_setuptools_entrypoints(NAME)
File "/root/tox/lib/python3.8/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
plugin = ep.load()
File "/root/.pyenv/versions/3.8.13/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/root/.pyenv/versions/3.8.13/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/tox/lib/python3.8/site-packages/tox_pyenv.py", line 48, in
from tox import hookimpl as tox_hookimpl
ImportError: cannot import name 'hookimpl' from 'tox' (/root/tox/lib/python3.8/site-packages/tox/init.py)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.