-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make the "mock" dependency optional (only used in Python 2.7). #2518
Conversation
I think I can merge this, thanks for the update. Can you show me what commands you are using to package that break on the current master? Our intent was to make testing dependencies / requirements-dev optional and wouldn't expect them to be included generally. The are not included in wheels uploaded to pypi, for example. |
Actually we have upgraded python-kafka in Fedora + EPEL 10 this week-end, including the diff of the closed pull request #2516: https://src.fedoraproject.org/rpms/python-kafka/pull-request/4#request_diff They way most fedora python packages are built are via some |
pyproject.toml
Outdated
@@ -37,7 +37,7 @@ crc32c = ["crc32c"] | |||
lz4 = ["lz4"] | |||
snappy = ["python-snappy"] | |||
zstd = ["zstandard"] | |||
testing = ["pytest", "mock", "pytest-mock"] | |||
testing = ["pytest", "mock; python_version < '2.7'", "pytest-mock"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this < '3.3'
?
requirements-dev.txt
Outdated
@@ -3,7 +3,7 @@ crc32c | |||
docker-py | |||
flake8 | |||
lz4 | |||
mock | |||
mock; python_version < '2.7' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same -- prefer to cover all python before unittest.mock added in 3.3
28b7e6c
to
553f302
Compare
I have update the version constraint to |
sorry, i also removed |
"mock" is included inside the standard "unittest" package in Python >= 3.3
553f302
to
fa0a6b7
Compare
Thanks! |
"mock" is included inside the standard "unittest" package in Python >= 3.3.
(This is an alternatve version of what was proposed (and declined) earlier in #2516. The idea is to allow distributions to package kafka-python without having to patch it explicitly to remove the "mock" dependency).