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

Tests currently failing on setuptools>72 #255

Closed
kyluca opened this issue Oct 2, 2024 · 0 comments · Fixed by #256
Closed

Tests currently failing on setuptools>72 #255

kyluca opened this issue Oct 2, 2024 · 0 comments · Fixed by #256

Comments

@kyluca
Copy link
Contributor

kyluca commented Oct 2, 2024

While working on #254, I got an unrelated build failure and noticed the same occuring on main: https://github.com/tldr-pages/tldr-python-client/actions/runs/10634495107/job/29481939309

Run python3 setup.py pytest
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/setuptools/_distutils/dist.py:260: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ptr/__init__.py:81: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
!!

        ********************************************************************************
        Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

        By 2024-Nov-15, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.
        ********************************************************************************

!!
  class PyTest(orig.test):
running pytest
Traceback (most recent call last):
  File "/home/runner/work/tldr-python-client/tldr-python-client/setup.py", line 17, in <module>
    setup(
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
    return run_commands(dist)
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
    dist.run_commands()
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ptr/__init__.py", line 195, in run
    setattr(dist, attr, getattr(self.distribution, attr))
AttributeError: 'Distribution' object has no attribute 'tests_require'
Error: Process completed with exit code 1.

I believe this is due to the line python3 setup.py pytest being used in the test.yml workflow.

Instead what we probably want is to invoke pytest directly, as per their docs.

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

Successfully merging a pull request may close this issue.

1 participant