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

git as hard requirement and 3.1.0 #82

Closed
hredestig opened this issue Jul 25, 2017 · 6 comments
Closed

git as hard requirement and 3.1.0 #82

hredestig opened this issue Jul 25, 2017 · 6 comments

Comments

@hredestig
Copy link

With pytest-benchmark I could on a system without git use the --benchmark-skip option to run my tests. With 3.1.0 I get traceback below. Is it intentional that git must be available even if user just wants to run the regular tests?

Traceback (most recent call last):
  File "/venv/bin/pytest", line 11, in <module>
    sys.exit(main())
  File "/venv/lib/python3.5/site-packages/_pytest/config.py", line 49, in main
    config = _prepareconfig(args, plugins)
  File "/venv/lib/python3.5/site-packages/_pytest/config.py", line 164, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 613, in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 250, in _wrapped_call
    wrap_controller.send(call_outcome)
  File "/venv/lib/python3.5/site-packages/_pytest/helpconfig.py", line 67, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 265, in __init__
    self.result = func()
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File "/venv/lib/python3.5/site-packages/_pytest/config.py", line 934, in pytest_cmdline_parse
    self.parse(args)
  File "/venv/lib/python3.5/site-packages/_pytest/config.py", line 1106, in parse
    self._preparse(args, addopts=addopts)
  File "/venv/lib/python3.5/site-packages/_pytest/config.py", line 1068, in _preparse
    self.pluginmanager.load_setuptools_entrypoints('pytest11')
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 516, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/venv/lib/python3.5/site-packages/_pytest/config.py", line 258, in register
    ret = super(PytestPluginManager, self).register(plugin, name)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 371, in register
    hook._maybe_apply_history(hookimpl)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 768, in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "/venv/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File "/venv/lib/python3.5/site-packages/pytest_benchmark/plugin.py", line 198, in pytest_addoption
    tag = get_tag()
  File "/venv/lib/python3.5/site-packages/pytest_benchmark/utils.py", line 87, in get_tag
    info = get_commit_info(project_name)
  File "/venv/lib/python3.5/site-packages/pytest_benchmark/utils.py", line 182, in get_commit_info
    branch = get_branch_info()
  File "/venv/lib/python3.5/site-packages/pytest_benchmark/utils.py", line 164, in get_branch_info
    branch = cmd('git rev-parse --abbrev-ref HEAD').strip()
  File "/venv/lib/python3.5/site-packages/pytest_benchmark/utils.py", line 160, in cmd
    return check_output(args, stderr=subprocess.STDOUT, universal_newlines=True)
  File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 383, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'git'
hredestig added a commit to opencobra/cobrapy that referenced this issue Jul 25, 2017
3.1.0 apparently has git has hard requirement which is problematic in
the multibuild setup, downgrade until resolved

issue opened at ionelmc/pytest-benchmark#82
@ionelmc
Copy link
Owner

ionelmc commented Jul 25, 2017

What I had in mind when it was implemented is that users wouldn't want to silently treat missing or broken commit info extraction when they have a .git/.hg directory around. Why is this different in your case?

@ionelmc
Copy link
Owner

ionelmc commented Jul 25, 2017

Also, you seem to run tests on travis, shouldn't git bin be available there?

hredestig added a commit to opencobra/cobrapy that referenced this issue Jul 25, 2017
3.1.0 apparently has git has hard requirement which is problematic in
the multibuild setup, downgrade until resolved

issue opened at ionelmc/pytest-benchmark#82
@hredestig
Copy link
Author

hredestig commented Jul 25, 2017

That makes sense just wasn't sure if git really was mandatory or not, seems it wasn't in 3.0.0. I do run on travis, but using multibuild to build package for linux and it appears that in that docker image I don't have git available. Installing git was also not as obvious as one would expect..

@ionelmc
Copy link
Owner

ionelmc commented Jul 25, 2017

Hmmm ... actually you're right (it allows failures if bin exists but fails). I'll fix this.

hredestig added a commit to opencobra/cobrapy that referenced this issue Jul 25, 2017
3.1.0 apparently has git has hard requirement which is problematic in
the multibuild setup, downgrade until resolved

issue opened at ionelmc/pytest-benchmark#82
@ionelmc
Copy link
Owner

ionelmc commented Jul 26, 2017

Released 3.1.1.

hredestig added a commit to opencobra/cobrapy that referenced this issue Jul 26, 2017
@hredestig
Copy link
Author

Awesome, thanks, works great

hredestig added a commit to opencobra/cobrapy that referenced this issue Jul 26, 2017
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

No branches or pull requests

2 participants