pyinvoke / invocations

Reusable Invoke tasks
http://invocations.readthedocs.io
BSD 2-Clause "Simplified" License
165 stars 28 forks source link

Failing tests in 2.0.0 release? #25

Closed kwshi closed 3 years ago

kwshi commented 3 years ago

I may be misunderstanding how the project is setup, but when I download & extract the 2.0.0 release (from PyPI) and try to run tests, things fail:

> curl -fsSL 'https://files.pythonhosted.org/packages/source/i/invocations/invocations-2.0.0.tar.gz' | tar -xz'
> cd invocations-2.0.0
> python3 setup.py test
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 invocations.egg-info/PKG-INFO
writing dependency_links to invocations.egg-info/dependency_links.txt
writing requirements to invocations.egg-info/requires.txt
writing top-level names to invocations.egg-info/top_level.txt
reading manifest file 'invocations.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no files found matching 'tasks-requirements.txt'
warning: no previously-included files matching '*.pyc' found under directory '*'
warning: no previously-included files matching '*.pyo' found under directory '*'
warning: no previously-included files matching '*' found under directory '**/__pycache__'
adding license file 'LICENSE'
writing manifest file 'invocations.egg-info/SOURCES.txt'
running build_ext
/home/kshi/invocations-2.0.0/.eggs/semantic_version-2.6.0-py3.9.egg/semantic_version/base.py:94: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.prerelease and self.minor is 0 and self.patch is 0:
/home/kshi/invocations-2.0.0/.eggs/semantic_version-2.6.0-py3.9.egg/semantic_version/base.py:94: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.prerelease and self.minor is 0 and self.patch is 0:
/home/kshi/invocations-2.0.0/.eggs/semantic_version-2.6.0-py3.9.egg/semantic_version/base.py:100: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.prerelease and self.patch is 0:
/home/kshi/invocations-2.0.0/invocations/pytest.py:141: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if report is "html":
Traceback (most recent call last):
  File "/home/kshi/invocations-2.0.0/setup.py", line 28, in <module>
    setup(
  File "/home/kshi/.venv/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/kshi/.venv/lib/python3.9/site-packages/setuptools/command/test.py", line 232, in run
    self.run_tests()
  File "/home/kshi/.venv/lib/python3.9/site-packages/setuptools/command/test.py", line 250, in run_tests
    test = unittest.main(
  File "/usr/lib/python3.9/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python3.9/unittest/main.py", line 124, in parseArgs
    self._do_discovery(argv[2:])
  File "/usr/lib/python3.9/unittest/main.py", line 244, in _do_discovery
    self.createTests(from_discovery=True, Loader=Loader)
  File "/usr/lib/python3.9/unittest/main.py", line 154, in createTests
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/usr/lib/python3.9/unittest/loader.py", line 349, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib/python3.9/unittest/loader.py", line 405, in _find_tests
    tests, should_recurse = self._find_test_path(
  File "/usr/lib/python3.9/unittest/loader.py", line 483, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/home/kshi/.venv/lib/python3.9/site-packages/setuptools/command/test.py", line 50, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib/python3.9/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/home/kshi/.venv/lib/python3.9/site-packages/setuptools/command/test.py", line 50, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib/python3.9/unittest/loader.py", line 205, in loadTestsFromName
    test = obj()
  File "/home/kshi/.venv/lib/python3.9/site-packages/invoke/tasks.py", line 123, in __call__
    if not isinstance(args[0], Context):
IndexError: tuple index out of range

I ask because I'm trying to get invocations to be successfully packaged for my OS, and being able to run tests for packages is an important criteria for verifying quality/functionality of packages.

bitprophet commented 3 years ago

It has effectively the same development methodology as the "parent" project, Invoke - so https://www.pyinvoke.org/development.html should apply.

bitprophet commented 3 years ago

Just dropped a note to that effect into my current branch (moving CI to circleci).