Skip to content

UserWarning: Unknown distribution option: 'tests_require' #59

@Plumezz

Description

@Plumezz
  • ROS Version: Humble

  • OS Version: Ubuntu22.04

  • Python Version: 3.10.12

  • setuptools Version: 75.2.0

Hello, when I build this project from source, some warnings occurred.

Hers is the output of the command colcon build:

Starting >>> splsm_7 
Starting >>> splsm_8
Finished <<< splsm_7 [1.63s]                                     
Starting >>> splsm_7_conversion
Finished <<< splsm_8 [1.67s]
Starting >>> splsm_8_conversion
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
Starting >>> r2r_spl                                             
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
--- stderr: splsm_8_conversion                                   
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
---
Finished <<< splsm_8_conversion [1.68s]
Starting >>> r2r_spl_8
--- stderr: splsm_7_conversion                                   
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
---
Finished <<< splsm_7_conversion [1.81s]
Starting >>> r2r_spl_7
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
--- stderr: r2r_spl                                                      
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
---
Finished <<< r2r_spl [1.76s]
--- stderr: r2r_spl_7                                                  
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
---
Finished <<< r2r_spl_7 [1.63s]
--- stderr: r2r_spl_8
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
---
Finished <<< r2r_spl_8 [1.71s]

These warnings show the tests_require option is expired. But the python is the default package with ubuntu 22.04 and setuptools is installed by pip.

And then I use colcon test to test this project, there were also some warnings.

Here is the output about the command colcon test:

Starting >>> splsm_7 
Starting >>> splsm_8
Starting >>> r2r_spl_test_interfaces
Finished <<< r2r_spl_test_interfaces [1.04s]                           
Finished <<< splsm_8 [1.06s]
Starting >>> splsm_8_conversion
Starting >>> r2r_spl
Finished <<< splsm_7 [1.09s]
Starting >>> splsm_7_conversion
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
--- stderr: splsm_8_conversion                                   

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
---
Finished <<< splsm_8_conversion [0.73s]
Starting >>> r2r_spl_8
--- stderr: r2r_spl                                   

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
---
Finished <<< r2r_spl [0.74s]
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
--- stderr: splsm_7_conversion                                   

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
---
Finished <<< splsm_7_conversion [0.98s]
Starting >>> r2r_spl_7
/home/qiguanxiao/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
--- stderr: r2r_spl_8                                                  

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
---
Finished <<< r2r_spl_8 [0.52s]
--- stderr: r2r_spl_7

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
---
Finished <<< r2r_spl_7 [0.33s]


It seems like that there were no python testing programs to run and no result file pytest.xml was generated in build directory.

Then I tried to modify the setup.py file in package r2r_spl r2r_spl_7 r2r_spl_8 splsm_7_conversion splsm_8_conversion and replaced the option tests_require with extras_require.

Finally it can be built and test correctly.

Here is the modified content in setpu.py file:

tests_require=['pytest'],  # remove
extras_require={
        'test': ['pytest'],
 },  # add

Now the python and setuptools version are updated very quickly, could you tell me if it is necessary to replace the tests_require option to adapt to the current environment.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions