[GH-ISSUE #43] 'python setup.py test' fails #28

Closed
opened 2026-05-05 03:22:32 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @GaetanLepage on GitHub (Oct 19, 2022).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/43

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
Originally created by @GaetanLepage on GitHub (Oct 19, 2022). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/43 #### 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
Author
Owner

@XuehaiPan commented on GitHub (Oct 19, 2022):

@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?

<!-- gh-comment-id:1283661352 --> @XuehaiPan commented on GitHub (Oct 19, 2022): @GaetanLepage Hi, currently, there are no tests provided in the repo, so it always fails. Also, `setuptools` is going to deprecate the `test` command: - pypa/setuptools#1684 - pypa/setuptools#1878 - NixOS/nixpkgs#71897 > The installation process for python applications calls `python setup.py test` by default. Is there a way to bypass this?
Author
Owner

@GaetanLepage commented on GitHub (Oct 19, 2022):

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

<!-- gh-comment-id:1283682337 --> @GaetanLepage commented on GitHub (Oct 19, 2022): Ok ! Thank you for this precision, I found a way to disable this phase of the nix packaging process.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#28
No description provided.