Another port to remove the unneeded mock dependency.
I've sent the patches upstream.
https://gitlab.com/pycqa/flake8/merge_requests/356
OK to commit?
--Kurt
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/flake8/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- Makefile 13 Aug 2019 23:25:24 -0000 1.18
+++ Makefile 13 Sep 2019 20:38:51 -0000
@@ -20,8 +20,6 @@ MODPY_VERSION = ${MODPY_DEFAULT_VERSION
MODPY_PYTEST = Yes
MODPY_PYTEST_ARGS = tests
-TEST_DEPENDS = devel/py-mock${MODPY_FLAVOR}
-
RUN_DEPENDS = devel/py-codestyle${MODPY_FLAVOR}>=2.5.0 \
devel/py-entrypoints${MODPY_FLAVOR}>=0.3 \
devel/py-mccabe${MODPY_FLAVOR} \
Index: patches/patch-tests_integration_test_checker_py
===================================================================
RCS file: patches/patch-tests_integration_test_checker_py
diff -N patches/patch-tests_integration_test_checker_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_integration_test_checker_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Allow use of built-in mock
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/integration/test_checker.py
+--- tests/integration/test_checker.py.orig
++++ tests/integration/test_checker.py
+@@ -1,5 +1,8 @@
+ """Integration tests for the checker submodule."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import checker
Index: patches/patch-tests_integration_test_main_py
===================================================================
RCS file: patches/patch-tests_integration_test_main_py
diff -N patches/patch-tests_integration_test_main_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_integration_test_main_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Allow use of built-in mock
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/integration/test_main.py
+--- tests/integration/test_main.py.orig
++++ tests/integration/test_main.py
+@@ -1,5 +1,8 @@
+ """Integration tests for the main entrypoint of flake8."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+
+ from flake8 import utils
+ from flake8.main import application
Index: patches/patch-tests_unit_test_application_py
===================================================================
RCS file: patches/patch-tests_unit_test_application_py
diff -N patches/patch-tests_unit_test_application_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_application_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_application.py
+--- tests/unit/test_application.py.orig
++++ tests/unit/test_application.py
+@@ -1,7 +1,10 @@
+ """Tests for the Application class."""
+ import optparse
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8.main import application as app
Index: patches/patch-tests_unit_test_base_formatter_py
===================================================================
RCS file: patches/patch-tests_unit_test_base_formatter_py
diff -N patches/patch-tests_unit_test_base_formatter_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_base_formatter_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_base_formatter.py
+--- tests/unit/test_base_formatter.py.orig
++++ tests/unit/test_base_formatter.py
+@@ -1,7 +1,10 @@
+ """Tests for the BaseFormatter object."""
+ import optparse
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import style_guide
Index: patches/patch-tests_unit_test_checker_manager_py
===================================================================
RCS file: patches/patch-tests_unit_test_checker_manager_py
diff -N patches/patch-tests_unit_test_checker_manager_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_checker_manager_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_checker_manager.py
+--- tests/unit/test_checker_manager.py.orig
++++ tests/unit/test_checker_manager.py
+@@ -1,7 +1,10 @@
+ """Tests for the Manager object for FileCheckers."""
+ import errno
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import checker
Index: patches/patch-tests_unit_test_config_file_finder_py
===================================================================
RCS file: patches/patch-tests_unit_test_config_file_finder_py
diff -N patches/patch-tests_unit_test_config_file_finder_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_config_file_finder_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_config_file_finder.py
+--- tests/unit/test_config_file_finder.py.orig
++++ tests/unit/test_config_file_finder.py
+@@ -4,7 +4,10 @@ import configparser
+ import os
+ import sys
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8.options import config
Index: patches/patch-tests_unit_test_debug_py
===================================================================
RCS file: patches/patch-tests_unit_test_debug_py
diff -N patches/patch-tests_unit_test_debug_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_debug_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_debug.py
+--- tests/unit/test_debug.py.orig
++++ tests/unit/test_debug.py
+@@ -1,6 +1,9 @@
+ """Tests for our debugging module."""
+ import entrypoints
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8.main import debug
Index: patches/patch-tests_unit_test_file_checker_py
===================================================================
RCS file: patches/patch-tests_unit_test_file_checker_py
diff -N patches/patch-tests_unit_test_file_checker_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_file_checker_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_file_checker.py
+--- tests/unit/test_file_checker.py.orig
++++ tests/unit/test_file_checker.py
+@@ -1,5 +1,8 @@
+ """Unit tests for the FileChecker class."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ import flake8
Index: patches/patch-tests_unit_test_file_processor_py
===================================================================
RCS file: patches/patch-tests_unit_test_file_processor_py
diff -N patches/patch-tests_unit_test_file_processor_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_file_processor_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_file_processor.py
+--- tests/unit/test_file_processor.py.orig
++++ tests/unit/test_file_processor.py
+@@ -2,7 +2,10 @@
+ import ast
+ import tokenize
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import processor
Index: patches/patch-tests_unit_test_get_local_plugins_py
===================================================================
RCS file: patches/patch-tests_unit_test_get_local_plugins_py
diff -N patches/patch-tests_unit_test_get_local_plugins_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_get_local_plugins_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_get_local_plugins.py
+--- tests/unit/test_get_local_plugins.py.orig
++++ tests/unit/test_get_local_plugins.py
+@@ -1,5 +1,8 @@
+ """Tests for get_local_plugins."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+
+ from flake8.options import config
+
Index: patches/patch-tests_unit_test_git_py
===================================================================
RCS file: patches/patch-tests_unit_test_git_py
diff -N patches/patch-tests_unit_test_git_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_git_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_git.py
+--- tests/unit/test_git.py.orig
++++ tests/unit/test_git.py
+@@ -1,5 +1,8 @@
+ """Tests around functionality in the git integration."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8.main import git
Index: patches/patch-tests_unit_test_legacy_api_py
===================================================================
RCS file: patches/patch-tests_unit_test_legacy_api_py
diff -N patches/patch-tests_unit_test_legacy_api_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_legacy_api_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_legacy_api.py
+--- tests/unit/test_legacy_api.py.orig
++++ tests/unit/test_legacy_api.py
+@@ -1,5 +1,8 @@
+ """Tests for Flake8's legacy API."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8.api import legacy as api
Index: patches/patch-tests_unit_test_merged_config_parser_py
===================================================================
RCS file: patches/patch-tests_unit_test_merged_config_parser_py
diff -N patches/patch-tests_unit_test_merged_config_parser_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_merged_config_parser_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_merged_config_parser.py
+--- tests/unit/test_merged_config_parser.py.orig
++++ tests/unit/test_merged_config_parser.py
+@@ -1,7 +1,10 @@
+ """Unit tests for flake8.options.config.MergedConfigParser."""
+ import os
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8.options import config
Index: patches/patch-tests_unit_test_option_manager_py
===================================================================
RCS file: patches/patch-tests_unit_test_option_manager_py
diff -N patches/patch-tests_unit_test_option_manager_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_option_manager_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_option_manager.py
+--- tests/unit/test_option_manager.py.orig
++++ tests/unit/test_option_manager.py
+@@ -2,7 +2,10 @@
+ import optparse
+ import os
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import utils
Index: patches/patch-tests_unit_test_option_py
===================================================================
RCS file: patches/patch-tests_unit_test_option_py
diff -N patches/patch-tests_unit_test_option_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_option_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_option.py
+--- tests/unit/test_option.py.orig
++++ tests/unit/test_option.py
+@@ -1,5 +1,8 @@
+ """Unit tests for flake8.options.manager.Option."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8.options import manager
Index: patches/patch-tests_unit_test_plugin_manager_py
===================================================================
RCS file: patches/patch-tests_unit_test_plugin_manager_py
diff -N patches/patch-tests_unit_test_plugin_manager_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_plugin_manager_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_plugin_manager.py
+--- tests/unit/test_plugin_manager.py.orig
++++ tests/unit/test_plugin_manager.py
+@@ -1,5 +1,8 @@
+ """Tests for flake8.plugins.manager.PluginManager."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+
+ from flake8.plugins import manager
+
Index: patches/patch-tests_unit_test_plugin_py
===================================================================
RCS file: patches/patch-tests_unit_test_plugin_py
diff -N patches/patch-tests_unit_test_plugin_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_plugin_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_plugin.py
+--- tests/unit/test_plugin.py.orig
++++ tests/unit/test_plugin.py
+@@ -1,7 +1,10 @@
+ """Tests for flake8.plugins.manager.Plugin."""
+ import optparse
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import exceptions
Index: patches/patch-tests_unit_test_plugin_type_manager_py
===================================================================
RCS file: patches/patch-tests_unit_test_plugin_type_manager_py
diff -N patches/patch-tests_unit_test_plugin_type_manager_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_plugin_type_manager_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_plugin_type_manager.py
+--- tests/unit/test_plugin_type_manager.py.orig
++++ tests/unit/test_plugin_type_manager.py
+@@ -1,7 +1,10 @@
+ """Tests for flake8.plugins.manager.PluginTypeManager."""
+ import sys
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import exceptions
Index: patches/patch-tests_unit_test_style_guide_py
===================================================================
RCS file: patches/patch-tests_unit_test_style_guide_py
diff -N patches/patch-tests_unit_test_style_guide_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_style_guide_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_style_guide.py
+--- tests/unit/test_style_guide.py.orig
++++ tests/unit/test_style_guide.py
+@@ -1,7 +1,10 @@
+ """Tests for the flake8.style_guide.StyleGuide class."""
+ import optparse
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import statistics
Index: patches/patch-tests_unit_test_utils_py
===================================================================
RCS file: patches/patch-tests_unit_test_utils_py
diff -N patches/patch-tests_unit_test_utils_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_utils_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_utils.py
+--- tests/unit/test_utils.py.orig
++++ tests/unit/test_utils.py
+@@ -1,7 +1,10 @@
+ """Tests for flake8's utils module."""
+ import os
+
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import exceptions
Index: patches/patch-tests_unit_test_violation_py
===================================================================
RCS file: patches/patch-tests_unit_test_violation_py
diff -N patches/patch-tests_unit_test_violation_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_unit_test_violation_py 13 Sep 2019 20:38:51 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Use built-in mock if available
+
+Submitted upstream:
+https://gitlab.com/pycqa/flake8/merge_requests/356
+
+Index: tests/unit/test_violation.py
+--- tests/unit/test_violation.py.orig
++++ tests/unit/test_violation.py
+@@ -1,5 +1,8 @@
+ """Tests for the flake8.style_guide.Violation class."""
+-import mock
++try:
++ from unittest import mock
++except (ImportError, AttributeError):
++ import mock
+ import pytest
+
+ from flake8 import style_guide
No comments:
Post a Comment