Skip to content

Commit

Permalink
Use new click version
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Bechberger committed Jul 7, 2021
1 parent 292476a commit 584fbd1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Using pip requiring at least Python 3.6:

.. code:: sh
pip3 install git+https://github.com/parttimenerd/temci.git
sudo pip3 install temci
For more information see the Installation_ page.

Expand Down
6 changes: 1 addition & 5 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ with pkgs.python37Packages;
let
python = import ./requirements.nix { inherit pkgs; };
pypi = python.packages;
click_git = click.overrideAttrs (attrs: {
postPatch = "";
src = builtins.fetchGit { url = https://github.com/pallets/click.git; rev = "f537a208591088499b388b06b2aca4efd5445119"; };
});
in buildPythonApplication rec {
name = "temci-${version}";
version = "local";
inherit src;
checkInputs = [ pytest pytestrunner ];
propagatedBuildInputs = [
click_git
click
humanfriendly
fn
pytimeparse
Expand Down
7 changes: 7 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

0.8.3
-----
- add `--watch`: prints console report continuously
- improve progressbar
- `perf` runner works on NixOS
- use new click version (temci is installable via pip click again)

0.8.2
-----
- improve HTML2 reporter
Expand Down
8 changes: 5 additions & 3 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ The Linux packages can be installed by calling the ``install_packages.sh`` scrip
After installing these packages, temci can be installed by calling:

.. code:: sh
# From GitHub
pip3 install git+https://github.com/parttimenerd/temci.git
A package called temci exists on pypi, but temci depends on an unpublished version of the ``click`` library that is only available on
github. This should change in the near future when the version 8.0 of ``click`` is published.
# From PyPi
pip3 install temci
To use temci plugins that need super user privileges, e.g. cpu sets, install temci globally.

If there a problems with ``click`` (if you get an exception like ``ImportError: cannot import name 'ParameterSource'``), try installing
it directly from github:
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from os import path
import os

from setuptools import setup, find_packages

Expand All @@ -21,7 +20,7 @@
packages=find_packages(),
include_package_data=True,
install_requires=[
'click @ https://github.com/pallets/click/archive/f537a208591088499b388b06b2aca4efd5445119.zip',
'click',
'humanfriendly', 'pytimeparse',
'fn',
'cpuset-py3',
Expand Down
2 changes: 1 addition & 1 deletion temci/run/cpuset.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _cset(self, argument: str):
:raises EnvironmentError: if something goes wrong
"""
# cmd = ["/bin/sh", "-c", "sudo cset {}".format(argument)]
cmd = ["/bin/sh", "-c", "python3 -c 'import cpuset.main; print(cpuset.main.main())' " + argument]
cmd = ["/bin/sh", "-c", "python3 -ct 'import cpuset.main; print(cpuset.main.main())' " + argument]
proc = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Expand Down
2 changes: 1 addition & 1 deletion temci/run/run_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def bench(run: int) -> bool:
import click
with click.progressbar(range(0, self.max_runs + self.discarded_runs),
label=label_format.format(start_label),
file=None if self.pool.run_driver.runs_benchmarks else "-") as runs:
file=None if self.pool.run_driver.runs_benchmarks else open(os.devnull, 'w')) as runs:
discard_label = "Discarded benchmark {{}} out of {}".format(self.discarded_runs)
if self.fixed_runs:
label = "Benchmark {{}} out of {}".format(self.max_runs)
Expand Down
3 changes: 2 additions & 1 deletion temci/utils/click_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import warnings

import click
from click import Context, ParameterSource
from click import Context
from click.core import ParameterSource

from temci.utils.typecheck import *
from temci.utils.settings import Settings, SettingsError
Expand Down

0 comments on commit 584fbd1

Please sign in to comment.