diff options
| author | rillig <rillig@pkgsrc.org> | 2022-07-16 08:59:38 +0000 |
|---|---|---|
| committer | rillig <rillig@pkgsrc.org> | 2022-07-16 08:59:38 +0000 |
| commit | e8b2442e1bacce72d9877eb0163eabe17bcdf2b2 (patch) | |
| tree | 87f7294952bfc3b207bc03f663a1b52e8ec2e1e5 /pkgtools/url2pkg/files/python/distutils | |
| parent | 720319d4f773c613c7dd7825032b31102b472935 (diff) | |
| download | pkgsrc-e8b2442e1bacce72d9877eb0163eabe17bcdf2b2.tar.gz | |
url2pkg: split support files for Python distutils and setuptools
When url2pkg determines the metadata of a Python module, it had merged
the two implementations for Python's distutils and setuptools, which
made the code hard to understand. Split them again.
Extend the support for setuptools, so that url2pkg correctly handles
wip/pytorch; it still fails because pytorch does some Git stuff from
inside setup.py, but that may be fixed later.
Bump version to 22.2.0.
Diffstat (limited to 'pkgtools/url2pkg/files/python/distutils')
4 files changed, 46 insertions, 0 deletions
diff --git a/pkgtools/url2pkg/files/python/distutils/__init__.py b/pkgtools/url2pkg/files/python/distutils/__init__.py new file mode 100644 index 00000000000..0a3f1933fdf --- /dev/null +++ b/pkgtools/url2pkg/files/python/distutils/__init__.py @@ -0,0 +1,9 @@ +# $NetBSD: __init__.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# This is a drop-in replacement for the distutils Python module. Instead
+# of actually searching for the dependencies, it extracts the dependency
+# information and includes it in the generated pkgsrc package Makefile.
+#
+# https://docs.python.org/3/distutils/
+# As of Python 3.10, distutils is deprecated.
+# The successor is setuptools.
diff --git a/pkgtools/url2pkg/files/python/distutils/core.py b/pkgtools/url2pkg/files/python/distutils/core.py new file mode 100644 index 00000000000..e14b1138b28 --- /dev/null +++ b/pkgtools/url2pkg/files/python/distutils/core.py @@ -0,0 +1,18 @@ +# $NetBSD: core.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation of distutils.core.
+#
+# https://docs.python.org/3/distutils/apiref.html#module-distutils.core
+
+import url2pkg
+
+
+# used by pkgsrc package devel/py-pysha3 1.0.2
+def setup(**kwargs):
+ url2pkg.setup(**kwargs)
+
+
+# Originally from distutils.cmd.
+# used by pkgsrc package devel/py-pysha3 1.0.2
+class Command:
+ pass
diff --git a/pkgtools/url2pkg/files/python/distutils/extension.py b/pkgtools/url2pkg/files/python/distutils/extension.py new file mode 100644 index 00000000000..14418e2bfca --- /dev/null +++ b/pkgtools/url2pkg/files/python/distutils/extension.py @@ -0,0 +1,10 @@ +# $NetBSD: extension.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation of distutils.extension
+#
+# https://docs.python.org/3/distutils/apiref.html#module-distutils.extension
+
+# used by pkgsrc package devel/py-pysha3 1.0.2
+class Extension:
+ def __init__(self, *args, **kwargs):
+ pass
diff --git a/pkgtools/url2pkg/files/python/distutils/version.py b/pkgtools/url2pkg/files/python/distutils/version.py new file mode 100644 index 00000000000..0ffe35a2fd6 --- /dev/null +++ b/pkgtools/url2pkg/files/python/distutils/version.py @@ -0,0 +1,9 @@ +# $NetBSD: version.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation of distutils.version.
+#
+# https://docs.python.org/3/distutils/apiref.html#module-distutils.version
+
+# used by pkgsrc package wip/py-torch 1.12.0
+class LooseVersion:
+ pass
|
