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

Fix NoxColoredFormatter.format #374

Merged
merged 3 commits into from
Dec 31, 2020
Merged

Fix NoxColoredFormatter.format #374

merged 3 commits into from
Dec 31, 2020

Conversation

stsewd
Copy link
Collaborator

@stsewd stsewd commented Dec 29, 2020

This errors when running nox -v.
That method is making use of _simple_fmt,
but isn't defined in the class.
I used the same value as NoxFormatter

stsewd and others added 2 commits December 28, 2020 20:55
That method is making use of `_simple_fmt`,
but isn't defined in the class.
I used the same value as `NoxFormatter`
@crwilcox
Copy link
Collaborator

@stsewd I ran nox -v with HEAD and with this branch, but I am not sure I am seeing what isn't working that is now?

pip install -e .
nox -v -s tests-3.9

@stsewd
Copy link
Collaborator Author

stsewd commented Dec 31, 2020

@crwilcox with the current version you'll get an exception

$ nox -v -s tests-3.9
nox > Running session tests-3.9
nox > Creating virtual environment (virtualenv) using python3.9 in .nox/tests-3-9
--- Logging error ---
Traceback (most recent call last):
  File "/home/stsewd/.pyenv/versions/3.9.1/lib/python3.9/logging/__init__.py", line 1079, in emit
    msg = self.format(record)
  File "/home/stsewd/.pyenv/versions/3.9.1/lib/python3.9/logging/__init__.py", line 923, in format
    return fmt.format(record)
  File "/home/stsewd/github/nox/nox/logger.py", line 69, in format
    return self._simple_fmt.format(record)
AttributeError: 'NoxColoredFormatter' object has no attribute '_simple_fmt'
Call stack:
  File "/home/stsewd/.pyenv/versions/nox/bin/nox", line 33, in <module>
    sys.exit(load_entry_point('nox', 'console_scripts', 'nox')())
  File "/home/stsewd/github/nox/nox/__main__.py", line 49, in main
    exit_code = workflow.execute(
  File "/home/stsewd/github/nox/nox/workflow.py", line 49, in execute
    return_value = function_(*args, global_config=global_config)
  File "/home/stsewd/github/nox/nox/tasks.py", line 244, in run_manifest
    result = session.execute()
  File "/home/stsewd/github/nox/nox/sessions.py", line 547, in execute
    self._create_venv()
  File "/home/stsewd/github/nox/nox/sessions.py", line 534, in _create_venv
    self.venv.create()
  File "/home/stsewd/github/nox/nox/virtualenv.py", line 404, in create
    nox.command.run(cmd, silent=True, log=False)
  File "/home/stsewd/github/nox/nox/command.py", line 128, in run
    logger.output(output)
  File "/home/stsewd/github/nox/nox/logger.py", line 87, in output
    self._log(OUTPUT, msg, args, **kwargs)
Message: 'created virtual environment CPython3.9.1.final.0-64 in 85ms\n  creator CPython3Posix(dest=/home/stsewd/github/nox/.nox/tests-3-9, clear=False, no_vcs_ignore=False, global=False)\n  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/stsewd/.local/share/virtualenv)\n    added seed packages: pip==20.3.1, setuptools==51.0.0, wheel==0.36.1\n  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator\n'
Arguments: ()
nox > python -m pip install -r requirements-test.txt

If you can't replicate that, not sure, maybe another nox is in the path? python nox/__main__.py -v

@crwilcox
Copy link
Collaborator

@stsewd sure enough, the pyenv shim of nox was winning out :)

created virtual environment CPython3.9.0.final.0-64 in 396ms
  creator CPython3Posix(dest=/home/crwilcox/workspace/nox/.nox/tests-3-9, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/crwilcox/.local/share/virtualenv)
    added seed packages: pip==20.2.4, setuptools==50.3.2, wheel==0.35.1
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

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

Successfully merging this pull request may close these issues.

None yet

2 participants