* [Buildroot] [PATCH] package/python-pathspec: enable target variant
@ 2024-04-12 5:44 Heiko Thiery
2024-04-12 15:48 ` Yann E. MORIN
0 siblings, 1 reply; 2+ messages in thread
From: Heiko Thiery @ 2024-04-12 5:44 UTC (permalink / raw)
To: buildroot
Cc: Asaf Kahlon, James Hilliard, Thomas Petazzoni, Heiko Thiery,
Romain Naour
Also a runtime testcase is added.
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
package/Config.in | 1 +
package/python-pathspec/Config.in | 6 ++++
package/python-pathspec/python-pathspec.mk | 1 +
.../tests/package/sample_python_pathspec.py | 35 +++++++++++++++++++
.../tests/package/test_python_pathspec.py | 11 ++++++
5 files changed, 54 insertions(+)
create mode 100644 package/python-pathspec/Config.in
create mode 100644 support/testing/tests/package/sample_python_pathspec.py
create mode 100644 support/testing/tests/package/test_python_pathspec.py
diff --git a/package/Config.in b/package/Config.in
index 0d31faf354..d9bbf64c95 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1223,6 +1223,7 @@ menu "External python modules"
source "package/python-parso/Config.in"
source "package/python-passlib/Config.in"
source "package/python-pathpy/Config.in"
+ source "package/python-pathspec/Config.in"
source "package/python-pathtools/Config.in"
source "package/python-pathvalidate/Config.in"
source "package/python-periphery/Config.in"
diff --git a/package/python-pathspec/Config.in b/package/python-pathspec/Config.in
new file mode 100644
index 0000000000..4ecf76d456
--- /dev/null
+++ b/package/python-pathspec/Config.in
@@ -0,0 +1,6 @@
+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
diff --git a/package/python-pathspec/python-pathspec.mk b/package/python-pathspec/python-pathspec.mk
index c4cb34b4c3..b46dbef7ea 100644
--- a/package/python-pathspec/python-pathspec.mk
+++ b/package/python-pathspec/python-pathspec.mk
@@ -11,4 +11,5 @@ PYTHON_PATHSPEC_LICENSE = MPL-2.0
PYTHON_PATHSPEC_LICENSE_FILES = LICENSE
PYTHON_PATHSPEC_SETUP_TYPE = flit
+$(eval $(python-package))
$(eval $(host-python-package))
diff --git a/support/testing/tests/package/sample_python_pathspec.py b/support/testing/tests/package/sample_python_pathspec.py
new file mode 100644
index 0000000000..6205126e21
--- /dev/null
+++ b/support/testing/tests/package/sample_python_pathspec.py
@@ -0,0 +1,35 @@
+# 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())
diff --git a/support/testing/tests/package/test_python_pathspec.py b/support/testing/tests/package/test_python_pathspec.py
new file mode 100644
index 0000000000..4e4a992bb3
--- /dev/null
+++ b/support/testing/tests/package/test_python_pathspec.py
@@ -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"]
--
2.39.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] package/python-pathspec: enable target variant
2024-04-12 5:44 [Buildroot] [PATCH] package/python-pathspec: enable target variant Heiko Thiery
@ 2024-04-12 15:48 ` Yann E. MORIN
0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2024-04-12 15:48 UTC (permalink / raw)
To: Heiko Thiery
Cc: James Hilliard, Romain Naour, Thomas Petazzoni, Asaf Kahlon,
buildroot
Heiko, All,
On 2024-04-12 07:44 +0200, Heiko Thiery spake thusly:
> Also a runtime testcase is added.
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
[--SNIP--]
> diff --git a/package/python-pathspec/Config.in b/package/python-pathspec/Config.in
> new file mode 100644
> index 0000000000..4ecf76d456
> --- /dev/null
> +++ b/package/python-pathspec/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PYTHON_PATHSPEC
> + bool "python-pathspec"
> + help
> + pathspec is a utility library for pattern matching of file paths.
$ ./utils/docker-run make check-package
package/python-pathspec/Config.in:4: help text: <tab><2 spaces><62 chars> (https://nightly.buildroot.org/#writing-rules-config-in)
[--SNIP--]
> diff --git a/support/testing/tests/package/sample_python_pathspec.py b/support/testing/tests/package/sample_python_pathspec.py
> new file mode 100644
> index 0000000000..6205126e21
> --- /dev/null
> +++ b/support/testing/tests/package/sample_python_pathspec.py
> @@ -0,0 +1,35 @@
> +# example from https://pypi.org/project/pathspec/
> +
> +import pathspec
I've added an empty line after the import, it's... cleaner. I guess?
Applied to master, with the above two fixed, thanks.
Regards,
Yann E. MORIN.
> +# 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())
> diff --git a/support/testing/tests/package/test_python_pathspec.py b/support/testing/tests/package/test_python_pathspec.py
> new file mode 100644
> index 0000000000..4e4a992bb3
> --- /dev/null
> +++ b/support/testing/tests/package/test_python_pathspec.py
> @@ -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"]
> --
> 2.39.2
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-12 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12 5:44 [Buildroot] [PATCH] package/python-pathspec: enable target variant Heiko Thiery
2024-04-12 15:48 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox