You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "FrankYang0529 (via GitHub)" <gi...@apache.org> on 2024/11/10 14:59:01 UTC
[PR] KAFKA-17979: Change [pytest] to [tool:pytest] in setup.cfg file [kafka]
FrankYang0529 opened a new pull request, #17740:
URL: https://github.com/apache/kafka/pull/17740
* The `[pytest]` is deprecated in `setup.cfg`. Change it to `[tool:pytest]`.
* The `python3 setup.py develop` is deprecated. Change it to `python -m pip install --editable .`. [0]
* The `setuptools.command.test` is deprecated. Change it to `Command`.
```
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.
********************************************************************************
!!
```
* The `tests_require` option is deprecated. Move `pytest` and `mock` packages to `install_requires`.
```
from setuptools.command.test import test as TestCommand
apache/kafka/tests/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
```
### Test steps to check result:
```
> cd kafka/tests
> virtualenv -p python3 venv
> . ./venv/bin/activate
> python -m pip install --editable .
> python3 setup.py test
running test
[]
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.10.13, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/frankyang/Project/apache/kafka/tests
configfile: setup.cfg
testpaths: unit
plugins: typeguard-4.3.0
collected 6 items
unit/directory_layout/check_project_paths.py ..... [ 83%]
unit/version/check_version.py . [100%]
=================================================================================== warnings summary ====================================================================================
kafkatest/version.py:44: 71 warnings
unit/directory_layout/check_project_paths.py: 1 warning
/home/frankyang/Project/apache/kafka/tests/kafkatest/version.py:44: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
LooseVersion.__init__(self, version_string)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================ 6 passed, 72 warnings in 0.02s =============================================================================
```
[0] https://packaging.python.org/en/latest/discussions/setup-py-deprecated/#is-setup-py-deprecated
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17979: Change [pytest] to [tool:pytest] in setup.cfg file [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #17740:
URL: https://github.com/apache/kafka/pull/17740
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17979: Change [pytest] to [tool:pytest] in setup.cfg file [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17740:
URL: https://github.com/apache/kafka/pull/17740#discussion_r1858850116
##########
tests/setup.py:
##########
@@ -15,27 +15,24 @@
import re
import sys
-from setuptools import find_packages, setup
-from setuptools.command.test import test as TestCommand
+from setuptools import find_packages, setup, Command
Review Comment:
That is incorrect import. Please use `from setuptools import test as TestCommand`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17979: Change [pytest] to [tool:pytest] in setup.cfg file [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17740:
URL: https://github.com/apache/kafka/pull/17740#discussion_r1862580438
##########
tests/setup.py:
##########
@@ -15,27 +15,24 @@
import re
import sys
-from setuptools import find_packages, setup
-from setuptools.command.test import test as TestCommand
+from setuptools import find_packages, setup, Command
Review Comment:
Please ignore my above comment. that is incorrect :(
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org