From 23df50d0ea0d64c2a4e00f3014dd4590da0a510b Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 17 Mar 2024 13:22:36 +1100 Subject: [PATCH] unix-ffi: Remove "unix_ffi" argument from require(). And describe how to use `add_library()` instead. Signed-off-by: Damien George --- unix-ffi/README.md | 10 +++++++--- unix-ffi/_markupbase/manifest.py | 2 +- unix-ffi/email.charset/manifest.py | 4 ++-- unix-ffi/email.encoders/manifest.py | 2 +- unix-ffi/email.feedparser/manifest.py | 8 ++++---- unix-ffi/email.header/manifest.py | 8 ++++---- unix-ffi/email.internal/manifest.py | 10 +++++----- unix-ffi/email.message/manifest.py | 8 ++++---- unix-ffi/email.parser/manifest.py | 6 +++--- unix-ffi/email.utils/manifest.py | 8 ++++---- unix-ffi/fcntl/manifest.py | 2 +- unix-ffi/getopt/manifest.py | 2 +- unix-ffi/gettext/manifest.py | 2 +- unix-ffi/glob/manifest.py | 4 ++-- unix-ffi/html.parser/manifest.py | 6 +++--- unix-ffi/http.client/manifest.py | 8 ++++---- unix-ffi/machine/manifest.py | 6 +++--- unix-ffi/multiprocessing/manifest.py | 4 ++-- unix-ffi/os/manifest.py | 2 +- unix-ffi/pwd/manifest.py | 2 +- unix-ffi/re/manifest.py | 2 +- unix-ffi/select/manifest.py | 4 ++-- unix-ffi/signal/manifest.py | 2 +- unix-ffi/sqlite3/manifest.py | 2 +- unix-ffi/time/manifest.py | 2 +- unix-ffi/timeit/manifest.py | 4 ++-- unix-ffi/ucurses/manifest.py | 6 +++--- unix-ffi/urllib.parse/manifest.py | 2 +- 28 files changed, 66 insertions(+), 62 deletions(-) diff --git a/unix-ffi/README.md b/unix-ffi/README.md index d6b9417d8..6ea05d65a 100644 --- a/unix-ffi/README.md +++ b/unix-ffi/README.md @@ -19,9 +19,13 @@ replacement for CPython. ### Usage -To use a unix-specific library, pass `unix_ffi=True` to `require()` in your -manifest file. +To use a unix-specific library, a manifest file must add the `unix-ffi` +library to the library search path using `add_library()`: ```py -require("os", unix_ffi=True) # Use the unix-ffi version instead of python-stdlib. +add_library("unix-ffi", "$(MPY_LIB_DIR)/unix-ffi", prepend=True) ``` + +Prepending the `unix-ffi` library to the path will make it so that the +`unix-ffi` version of a package will be preferred if that package appears in +both `unix-ffi` and another library (eg `python-stdlib`). diff --git a/unix-ffi/_markupbase/manifest.py b/unix-ffi/_markupbase/manifest.py index ec576c28f..9cbf52bb0 100644 --- a/unix-ffi/_markupbase/manifest.py +++ b/unix-ffi/_markupbase/manifest.py @@ -1,5 +1,5 @@ metadata(version="3.3.4") -require("re", unix_ffi=True) +require("re") module("_markupbase.py") diff --git a/unix-ffi/email.charset/manifest.py b/unix-ffi/email.charset/manifest.py index 31d70cece..7e6dd7936 100644 --- a/unix-ffi/email.charset/manifest.py +++ b/unix-ffi/email.charset/manifest.py @@ -1,7 +1,7 @@ metadata(version="0.5.1") require("functools") -require("email.encoders", unix_ffi=True) -require("email.errors", unix_ffi=True) +require("email.encoders") +require("email.errors") package("email") diff --git a/unix-ffi/email.encoders/manifest.py b/unix-ffi/email.encoders/manifest.py index e1e2090c9..a3e735d8c 100644 --- a/unix-ffi/email.encoders/manifest.py +++ b/unix-ffi/email.encoders/manifest.py @@ -3,7 +3,7 @@ require("base64") require("binascii") require("quopri") -require("re", unix_ffi=True) +require("re") require("string") package("email") diff --git a/unix-ffi/email.feedparser/manifest.py b/unix-ffi/email.feedparser/manifest.py index 4ea80e302..31c34ba91 100644 --- a/unix-ffi/email.feedparser/manifest.py +++ b/unix-ffi/email.feedparser/manifest.py @@ -1,8 +1,8 @@ metadata(version="0.5.1") -require("re", unix_ffi=True) -require("email.errors", unix_ffi=True) -require("email.message", unix_ffi=True) -require("email.internal", unix_ffi=True) +require("re") +require("email.errors") +require("email.message") +require("email.internal") package("email") diff --git a/unix-ffi/email.header/manifest.py b/unix-ffi/email.header/manifest.py index 65b017b50..0be7e85c2 100644 --- a/unix-ffi/email.header/manifest.py +++ b/unix-ffi/email.header/manifest.py @@ -1,9 +1,9 @@ metadata(version="0.5.2") -require("re", unix_ffi=True) +require("re") require("binascii") -require("email.encoders", unix_ffi=True) -require("email.errors", unix_ffi=True) -require("email.charset", unix_ffi=True) +require("email.encoders") +require("email.errors") +require("email.charset") package("email") diff --git a/unix-ffi/email.internal/manifest.py b/unix-ffi/email.internal/manifest.py index 4aff6d2c5..88acb2c01 100644 --- a/unix-ffi/email.internal/manifest.py +++ b/unix-ffi/email.internal/manifest.py @@ -1,15 +1,15 @@ metadata(version="0.5.1") -require("re", unix_ffi=True) +require("re") require("base64") require("binascii") require("functools") require("string") # require("calendar") TODO require("abc") -require("email.errors", unix_ffi=True) -require("email.header", unix_ffi=True) -require("email.charset", unix_ffi=True) -require("email.utils", unix_ffi=True) +require("email.errors") +require("email.header") +require("email.charset") +require("email.utils") package("email") diff --git a/unix-ffi/email.message/manifest.py b/unix-ffi/email.message/manifest.py index 7b75ee7ac..d1849de35 100644 --- a/unix-ffi/email.message/manifest.py +++ b/unix-ffi/email.message/manifest.py @@ -1,11 +1,11 @@ metadata(version="0.5.3") -require("re", unix_ffi=True) +require("re") require("uu") require("base64") require("binascii") -require("email.utils", unix_ffi=True) -require("email.errors", unix_ffi=True) -require("email.charset", unix_ffi=True) +require("email.utils") +require("email.errors") +require("email.charset") package("email") diff --git a/unix-ffi/email.parser/manifest.py b/unix-ffi/email.parser/manifest.py index ebe662111..dd8aacde8 100644 --- a/unix-ffi/email.parser/manifest.py +++ b/unix-ffi/email.parser/manifest.py @@ -1,8 +1,8 @@ metadata(version="0.5.1") require("warnings") -require("email.feedparser", unix_ffi=True) -require("email.message", unix_ffi=True) -require("email.internal", unix_ffi=True) +require("email.feedparser") +require("email.message") +require("email.internal") package("email") diff --git a/unix-ffi/email.utils/manifest.py b/unix-ffi/email.utils/manifest.py index 20b21b406..a7208536d 100644 --- a/unix-ffi/email.utils/manifest.py +++ b/unix-ffi/email.utils/manifest.py @@ -1,13 +1,13 @@ metadata(version="3.3.4") -require("os", unix_ffi=True) -require("re", unix_ffi=True) +require("os") +require("re") require("base64") require("random") require("datetime") -require("urllib.parse", unix_ffi=True) +require("urllib.parse") require("warnings") require("quopri") -require("email.charset", unix_ffi=True) +require("email.charset") package("email") diff --git a/unix-ffi/fcntl/manifest.py b/unix-ffi/fcntl/manifest.py index a0e9d9592..e572a58e8 100644 --- a/unix-ffi/fcntl/manifest.py +++ b/unix-ffi/fcntl/manifest.py @@ -2,6 +2,6 @@ # Originally written by Paul Sokolovsky. -require("ffilib", unix_ffi=True) +require("ffilib") module("fcntl.py") diff --git a/unix-ffi/getopt/manifest.py b/unix-ffi/getopt/manifest.py index ae28ffd7f..cde6c4c09 100644 --- a/unix-ffi/getopt/manifest.py +++ b/unix-ffi/getopt/manifest.py @@ -1,5 +1,5 @@ metadata(version="3.3.4") -require("os", unix_ffi=True) +require("os") module("getopt.py") diff --git a/unix-ffi/gettext/manifest.py b/unix-ffi/gettext/manifest.py index 94b58b2e4..fe40b01b6 100644 --- a/unix-ffi/gettext/manifest.py +++ b/unix-ffi/gettext/manifest.py @@ -2,6 +2,6 @@ # Originally written by Riccardo Magliocchetti. -require("ffilib", unix_ffi=True) +require("ffilib") module("gettext.py") diff --git a/unix-ffi/glob/manifest.py b/unix-ffi/glob/manifest.py index 622289bca..2d2fab31c 100644 --- a/unix-ffi/glob/manifest.py +++ b/unix-ffi/glob/manifest.py @@ -1,8 +1,8 @@ metadata(version="0.5.2") -require("os", unix_ffi=True) +require("os") require("os-path") -require("re", unix_ffi=True) +require("re") require("fnmatch") module("glob.py") diff --git a/unix-ffi/html.parser/manifest.py b/unix-ffi/html.parser/manifest.py index a0a5bc4f4..3f29bbceb 100644 --- a/unix-ffi/html.parser/manifest.py +++ b/unix-ffi/html.parser/manifest.py @@ -1,8 +1,8 @@ metadata(version="3.3.4") -require("_markupbase", unix_ffi=True) +require("_markupbase") require("warnings") -require("html.entities", unix_ffi=True) -require("re", unix_ffi=True) +require("html.entities") +require("re") package("html") diff --git a/unix-ffi/http.client/manifest.py b/unix-ffi/http.client/manifest.py index be0c9ef36..add274422 100644 --- a/unix-ffi/http.client/manifest.py +++ b/unix-ffi/http.client/manifest.py @@ -1,10 +1,10 @@ metadata(version="0.5.1") -require("email.parser", unix_ffi=True) -require("email.message", unix_ffi=True) -require("socket", unix_ffi=True) +require("email.parser") +require("email.message") +require("socket") require("collections") -require("urllib.parse", unix_ffi=True) +require("urllib.parse") require("warnings") package("http") diff --git a/unix-ffi/machine/manifest.py b/unix-ffi/machine/manifest.py index 9c1f34775..c0e40764d 100644 --- a/unix-ffi/machine/manifest.py +++ b/unix-ffi/machine/manifest.py @@ -2,8 +2,8 @@ # Originally written by Paul Sokolovsky. -require("ffilib", unix_ffi=True) -require("os", unix_ffi=True) -require("signal", unix_ffi=True) +require("ffilib") +require("os") +require("signal") package("machine") diff --git a/unix-ffi/multiprocessing/manifest.py b/unix-ffi/multiprocessing/manifest.py index 68f2bca08..d6b32411d 100644 --- a/unix-ffi/multiprocessing/manifest.py +++ b/unix-ffi/multiprocessing/manifest.py @@ -2,8 +2,8 @@ # Originally written by Paul Sokolovsky. -require("os", unix_ffi=True) -require("select", unix_ffi=True) +require("os") +require("select") require("pickle") module("multiprocessing.py") diff --git a/unix-ffi/os/manifest.py b/unix-ffi/os/manifest.py index 0dce28e0b..e4bc100a2 100644 --- a/unix-ffi/os/manifest.py +++ b/unix-ffi/os/manifest.py @@ -2,7 +2,7 @@ # Originally written by Paul Sokolovsky. -require("ffilib", unix_ffi=True) +require("ffilib") require("errno") require("stat") diff --git a/unix-ffi/pwd/manifest.py b/unix-ffi/pwd/manifest.py index 49bfb403e..fd422aaeb 100644 --- a/unix-ffi/pwd/manifest.py +++ b/unix-ffi/pwd/manifest.py @@ -2,6 +2,6 @@ # Originally written by Riccardo Magliocchetti. -require("ffilib", unix_ffi=True) +require("ffilib") module("pwd.py") diff --git a/unix-ffi/re/manifest.py b/unix-ffi/re/manifest.py index cc52df47a..ca027317d 100644 --- a/unix-ffi/re/manifest.py +++ b/unix-ffi/re/manifest.py @@ -2,6 +2,6 @@ # Originally written by Paul Sokolovsky. -require("ffilib", unix_ffi=True) +require("ffilib") module("re.py") diff --git a/unix-ffi/select/manifest.py b/unix-ffi/select/manifest.py index ef2778ed7..b9576de5e 100644 --- a/unix-ffi/select/manifest.py +++ b/unix-ffi/select/manifest.py @@ -2,7 +2,7 @@ # Originally written by Paul Sokolovsky. -require("os", unix_ffi=True) -require("ffilib", unix_ffi=True) +require("os") +require("ffilib") module("select.py") diff --git a/unix-ffi/signal/manifest.py b/unix-ffi/signal/manifest.py index 913bbdc8c..cb23542cc 100644 --- a/unix-ffi/signal/manifest.py +++ b/unix-ffi/signal/manifest.py @@ -2,6 +2,6 @@ # Originally written by Paul Sokolovsky. -require("ffilib", unix_ffi=True) +require("ffilib") module("signal.py") diff --git a/unix-ffi/sqlite3/manifest.py b/unix-ffi/sqlite3/manifest.py index e941e1ddd..63cdf4b9f 100644 --- a/unix-ffi/sqlite3/manifest.py +++ b/unix-ffi/sqlite3/manifest.py @@ -2,6 +2,6 @@ # Originally written by Paul Sokolovsky. -require("ffilib", unix_ffi=True) +require("ffilib") module("sqlite3.py") diff --git a/unix-ffi/time/manifest.py b/unix-ffi/time/manifest.py index d13942cd6..d1ff709a4 100644 --- a/unix-ffi/time/manifest.py +++ b/unix-ffi/time/manifest.py @@ -1,5 +1,5 @@ metadata(version="0.5.0") -require("ffilib", unix_ffi=True) +require("ffilib") module("time.py") diff --git a/unix-ffi/timeit/manifest.py b/unix-ffi/timeit/manifest.py index 94b6a5fe9..ea13af331 100644 --- a/unix-ffi/timeit/manifest.py +++ b/unix-ffi/timeit/manifest.py @@ -1,9 +1,9 @@ metadata(version="3.3.4") -require("getopt", unix_ffi=True) +require("getopt") require("itertools") # require("linecache") TODO -require("time", unix_ffi=True) +require("time") require("traceback") module("timeit.py") diff --git a/unix-ffi/ucurses/manifest.py b/unix-ffi/ucurses/manifest.py index 50648033e..8ec2675a5 100644 --- a/unix-ffi/ucurses/manifest.py +++ b/unix-ffi/ucurses/manifest.py @@ -2,8 +2,8 @@ # Originally written by Paul Sokolovsky. -require("os", unix_ffi=True) -require("tty", unix_ffi=True) -require("select", unix_ffi=True) +require("os") +require("tty") +require("select") package("ucurses") diff --git a/unix-ffi/urllib.parse/manifest.py b/unix-ffi/urllib.parse/manifest.py index 7023883f4..94109b134 100644 --- a/unix-ffi/urllib.parse/manifest.py +++ b/unix-ffi/urllib.parse/manifest.py @@ -1,6 +1,6 @@ metadata(version="0.5.2") -require("re", unix_ffi=True) +require("re") require("collections") require("collections-defaultdict")