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

'python setup.py test' fails #43

Closed
GaetanLepage opened this issue Oct 19, 2022 · 2 comments
Closed

'python setup.py test' fails #43

GaetanLepage opened this issue Oct 19, 2022 · 2 comments

Comments

@GaetanLepage
Copy link

Runtime Environment

  • Operating system and version: [e.g. Ubuntu 20.04 LTS / Windows 10 Build 19043.1110]
  • Terminal emulator and version: kitty terminal
  • Python version: 3.10.7
  • nvitop version or commit: 0.10.0
  • python-ml-py version: 11.515.75
  • Locale: en_US.UTF-8

Current Behavior

The python setup.py test command fails.

nvitop on  main  3.10.7 (venv) took 16s 
❯ python setup.py test   
/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py:104: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
  warnings.warn(msg, _BetaConfiguration)
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing nvitop.egg-info/PKG-INFO
writing dependency_links to nvitop.egg-info/dependency_links.txt
writing entry points to nvitop.egg-info/entry_points.txt
writing requirements to nvitop.egg-info/requires.txt
writing top-level names to nvitop.egg-info/top_level.txt
reading manifest file 'nvitop.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'nvitop.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "/home/gaetan/downloads/nvitop/setup.py", line 44, in <module>
    setup(
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 177, in setup
    return run_commands(dist)
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 193, in run_commands
    dist.run_commands()
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.run()
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/command/test.py", line 224, in run
    self.run_tests()
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/command/test.py", line 227, in run_tests
    test = unittest.main(
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/main.py", line 124, in parseArgs
    self._do_discovery(argv[2:])
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/main.py", line 244, in _do_discovery
    self.createTests(from_discovery=True, Loader=Loader)
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/main.py", line 154, in createTests
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/loader.py", line 349, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/loader.py", line 405, in _find_tests
    tests, should_recurse = self._find_test_path(
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/loader.py", line 483, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/command/test.py", line 57, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/command/test.py", line 57, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/home/gaetan/downloads/nvitop/venv/lib/python3.10/site-packages/setuptools/command/test.py", line 57, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/lib/python3.10/unittest/loader.py", line 211, in loadTestsFromName
    raise TypeError("calling %s returned %s, not a test" %
TypeError: calling <function libcurses at 0x7f9252eb5750> returned <contextlib._GeneratorContextManager object at 0x7f9252ef06a0>, not a test

Expected Behavior

The test command succeeds.

Context

I was trying to package nvitop for NixOS.
The installation process for python applications calls python setup.py test by default.

Steps to Reproduce

  1. python setup.py test
@XuehaiPan
Copy link
Owner

@GaetanLepage Hi, currently, there are no tests provided in the repo, so it always fails. Also, setuptools is going to deprecate the test command:

The installation process for python applications calls python setup.py test by default.

Is there a way to bypass this?

@GaetanLepage
Copy link
Author

Ok ! Thank you for this precision, I found a way to disable this phase of the nix packaging process.

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