GothenburgBitFactory / bugwarrior

Pull github, bitbucket, and trac issues into taskwarrior
http://pypi.python.org/pypi/bugwarrior
GNU General Public License v3.0
732 stars 209 forks source link

Tox not running locally #964

Closed djmitche closed 1 year ago

djmitche commented 1 year ago

Setup:

⸩ tox --version
3.21.4 imported from /usr/lib/python3/dist-packages/tox/__init__.py
djmitche@perlman ~/tmp/bugwarrior
⸩ pyenv local
3.6
3.7
3.9
⸩ git describe HEAD
1.8.0-120-g85414a7

Result:

⸩ tox -e py39-jira200              
GLOB sdist-make: /usr/local/google/home/djmitche/tmp/bugwarrior/setup.py                                                                                                                                                                                                                 
py39-jira200 create: /usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200
py39-jira200 installdeps: pysimplesoap, jira>=2.0.0                                                                                                                                                                                                                                      
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
ERROR: invocation failed (exit code 1), logfile: /usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/log/py39-jira200-1.log                                                                                                                                                 
...
  × Running setup.py install for pysimplesoap did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      running install
      /usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/pysimplesoap
      copying pysimplesoap/wsse.py -> build/lib/pysimplesoap
      copying pysimplesoap/c14n.py -> build/lib/pysimplesoap
      copying pysimplesoap/__init__.py -> build/lib/pysimplesoap
      copying pysimplesoap/xmlsec.py -> build/lib/pysimplesoap
      copying pysimplesoap/simplexml.py -> build/lib/pysimplesoap
      copying pysimplesoap/client.py -> build/lib/pysimplesoap
      copying pysimplesoap/transport.py -> build/lib/pysimplesoap
      copying pysimplesoap/helpers.py -> build/lib/pysimplesoap
      copying pysimplesoap/server.py -> build/lib/pysimplesoap
      running install_lib
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-p3oimepa/pysimplesoap_359c66630aa1476e8cf3f88deacc50ee/setup.py", line 27, in <module>
          setup(
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
          self.run_command(cmd)
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.run()
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/command/install.py", line 68, in run
          return orig.install.run(self)
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/command/install.py", line 709, in run
          self.run_command(cmd_name)
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.ensure_finalized()
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 109, in ensure_finalized
          self.finalize_options()
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 17, in finalize_options
          self.set_undefined_options('install',('install_layout','install_layout'))
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 297, in set_undefined_options
          setattr(self, dst_option, getattr(src_cmd_obj, src_option))
        File "/usr/local/google/home/djmitche/tmp/bugwarrior/.tox/py39-jira200/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 105, in __getattr__
          raise AttributeError(attr)
      AttributeError: install_layout
      [end of output]

This is happening for all envs -- I've only included this one for brevity.

I've been away from Python packaging for a while, so this one has me stumped. Is this maybe a too-new version of setuptools or something like that? Are others seeing this, or is it likely something local to my environment?

djmitche commented 1 year ago

Ah, using a newer tox helps with that error. Now, on both the system where I'm trying to do this work, and on a system where I've hacked on bugwarrior before, I see

py39-jira200: install_package> python -I -m pip install --force-reinstall --no-deps /usr/local/google/home/djmitche/tmp/bugwarrior/.tox/.tmp/package/2/bugwarrior-1.8.0.tar.gz
Processing ./.tox/.tmp/package/2/bugwarrior-1.8.0.tar.gz
  Preparing metadata (setup.py) ... error

  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-neojrg5g/setup.py", line 4, in <module>
          with open('VERSION') as version_file:
      FileNotFoundError: [Errno 2] No such file or directory: 'VERSION'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

I suspect this is because something newer is doing a better job of isolating the build, and VERSION is not being included. Adding VERSION to MANIFEST.in seems to fix that, and the tests run. However, they all fail because none of the test dependencies are installed.

Clearly something in the world has changed since September 2022, when things last landed in this repo -- and certainly since September 2021, when I last contributed. Is there someone with a more recent familiarity with Python who can update things to get them working again?

ryneeverett commented 1 year ago

We have a tox.ini so tox ought to work. But why use tox rather than just pytest? If it's just about testing the matrix, I say let CI catch those rare cases where it makes a difference.

djmitche commented 1 year ago

Hm, that's true.

There are no actual test instructions that I saw, and I started with the old python setup.py test, which suggested tox. I see that the most recent commits include some more info in the contributing/getting-started.rst file, including the all-important pip install -e .[all] which gets all of the optional dependencies. I'll make a PR.

ryneeverett commented 1 year ago

Maybe we should also have a CONTRIBUTING.md pointing to the contributing section of the docs?

djmitche commented 1 year ago

I can add that in the PR..