mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 14:01:57 -09:00
package/python-pathspec: enable target variant
Also a runtime testcase is added. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> [yann.morin.1998@free.fr: - fix check-package - small codign style in test sample ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
committed by
Yann E. MORIN
parent
0b2967e158
commit
7fa769dae3
@@ -1223,6 +1223,7 @@ menu "External python modules"
|
|||||||
source "package/python-parso/Config.in"
|
source "package/python-parso/Config.in"
|
||||||
source "package/python-passlib/Config.in"
|
source "package/python-passlib/Config.in"
|
||||||
source "package/python-pathpy/Config.in"
|
source "package/python-pathpy/Config.in"
|
||||||
|
source "package/python-pathspec/Config.in"
|
||||||
source "package/python-pathtools/Config.in"
|
source "package/python-pathtools/Config.in"
|
||||||
source "package/python-pathvalidate/Config.in"
|
source "package/python-pathvalidate/Config.in"
|
||||||
source "package/python-periphery/Config.in"
|
source "package/python-periphery/Config.in"
|
||||||
|
|||||||
7
package/python-pathspec/Config.in
Normal file
7
package/python-pathspec/Config.in
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
config BR2_PACKAGE_PYTHON_PATHSPEC
|
||||||
|
bool "python-pathspec"
|
||||||
|
help
|
||||||
|
pathspec is a utility library for pattern matching of file
|
||||||
|
paths.
|
||||||
|
|
||||||
|
https://github.com/cpburnz/python-pathspec
|
||||||
@@ -11,4 +11,5 @@ PYTHON_PATHSPEC_LICENSE = MPL-2.0
|
|||||||
PYTHON_PATHSPEC_LICENSE_FILES = LICENSE
|
PYTHON_PATHSPEC_LICENSE_FILES = LICENSE
|
||||||
PYTHON_PATHSPEC_SETUP_TYPE = flit
|
PYTHON_PATHSPEC_SETUP_TYPE = flit
|
||||||
|
|
||||||
|
$(eval $(python-package))
|
||||||
$(eval $(host-python-package))
|
$(eval $(host-python-package))
|
||||||
|
|||||||
36
support/testing/tests/package/sample_python_pathspec.py
Normal file
36
support/testing/tests/package/sample_python_pathspec.py
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# example from https://pypi.org/project/pathspec/
|
||||||
|
|
||||||
|
import pathspec
|
||||||
|
|
||||||
|
# The gitignore-style patterns for files to select, but we're including
|
||||||
|
# instead of ignoring.
|
||||||
|
spec_text = """
|
||||||
|
|
||||||
|
# This is a comment because the line begins with a hash: "#"
|
||||||
|
|
||||||
|
# Include several project directories (and all descendants) relative to
|
||||||
|
# the current directory. To reference a directory you must end with a
|
||||||
|
# slash: "/"
|
||||||
|
/project-a/
|
||||||
|
/project-b/
|
||||||
|
/project-c/
|
||||||
|
|
||||||
|
# Patterns can be negated by prefixing with exclamation mark: "!"
|
||||||
|
|
||||||
|
# Ignore temporary files beginning or ending with "~" and ending with
|
||||||
|
# ".swp".
|
||||||
|
!~*
|
||||||
|
!*~
|
||||||
|
!*.swp
|
||||||
|
|
||||||
|
# These are python projects so ignore compiled python files from
|
||||||
|
# testing.
|
||||||
|
!*.pyc
|
||||||
|
|
||||||
|
# Ignore the build directories but only directly under the project
|
||||||
|
# directories.
|
||||||
|
!/*/build/
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
spec = pathspec.PathSpec.from_lines('gitwildmatch', spec_text.splitlines())
|
||||||
11
support/testing/tests/package/test_python_pathspec.py
Normal file
11
support/testing/tests/package/test_python_pathspec.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from tests.package.test_python import TestPythonPackageBase
|
||||||
|
|
||||||
|
|
||||||
|
class TestPythonPathSpec(TestPythonPackageBase):
|
||||||
|
__test__ = True
|
||||||
|
config = TestPythonPackageBase.config + \
|
||||||
|
"""
|
||||||
|
BR2_PACKAGE_PYTHON3=y
|
||||||
|
BR2_PACKAGE_PYTHON_PATHSPEC=y
|
||||||
|
"""
|
||||||
|
sample_scripts = ["tests/package/sample_python_pathspec.py"]
|
||||||
Reference in New Issue
Block a user