summaryrefslogtreecommitdiff
path: root/pkgtools/url2pkg/files/python/setuptools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2022-07-16 08:59:38 +0000
committerrillig <rillig@pkgsrc.org>2022-07-16 08:59:38 +0000
commite8b2442e1bacce72d9877eb0163eabe17bcdf2b2 (patch)
tree87f7294952bfc3b207bc03f663a1b52e8ec2e1e5 /pkgtools/url2pkg/files/python/setuptools
parent720319d4f773c613c7dd7825032b31102b472935 (diff)
downloadpkgsrc-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/setuptools')
-rw-r--r--pkgtools/url2pkg/files/python/setuptools/__init__.py33
-rw-r--r--pkgtools/url2pkg/files/python/setuptools/command/__init__.py7
-rw-r--r--pkgtools/url2pkg/files/python/setuptools/command/build_ext.py7
-rw-r--r--pkgtools/url2pkg/files/python/setuptools/command/install.py7
-rw-r--r--pkgtools/url2pkg/files/python/setuptools/command/sdist.py7
-rw-r--r--pkgtools/url2pkg/files/python/setuptools/dist.py7
6 files changed, 68 insertions, 0 deletions
diff --git a/pkgtools/url2pkg/files/python/setuptools/__init__.py b/pkgtools/url2pkg/files/python/setuptools/__init__.py
new file mode 100644
index 00000000000..f4b713bffc8
--- /dev/null
+++ b/pkgtools/url2pkg/files/python/setuptools/__init__.py
@@ -0,0 +1,33 @@
+# $NetBSD: __init__.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# This is a drop-in replacement for the setuptools Python module. Instead
+# of actually searching for the dependencies, it extracts the dependency
+# information and includes it in the generated pkgsrc package Makefile.
+#
+# https://setuptools.pypa.io/en/latest/index.html
+# https://setuptools.pypa.io/en/latest/setuptools.html
+# https://setuptools.pypa.io/en/latest/userguide/index.html
+# https://github.com/pypa/setuptools/tree/main/setuptools
+
+import url2pkg
+# used by pkgsrc package wip/py-torch 1.12.0
+import distutils # only re-export
+from setuptools.dist import Distribution
+
+
+# used by pkgsrc package devel/py-pysha3 1.0.2
+# used by pkgsrc package wip/py-torch 1.12.0
+def setup(**kwargs):
+ url2pkg.setup(**kwargs)
+
+
+# used by pkgsrc package wip/py-torch 1.12.0
+def find_packages(where='.', exclude=(), include=('*',)):
+ return []
+
+
+# used by pkgsrc package devel/py-pysha3 1.0.2
+# used by pkgsrc package wip/py-torch 1.12.0
+class Extension:
+ def __init__(self, name, sources, *args, **kw) -> None:
+ pass
diff --git a/pkgtools/url2pkg/files/python/setuptools/command/__init__.py b/pkgtools/url2pkg/files/python/setuptools/command/__init__.py
new file mode 100644
index 00000000000..1696368c3f9
--- /dev/null
+++ b/pkgtools/url2pkg/files/python/setuptools/command/__init__.py
@@ -0,0 +1,7 @@
+# $NetBSD: __init__.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation of setuptools.command.
+#
+# https://github.com/pypa/setuptools/blob/main/setuptools/command/__init__.py
+
+# This module is empty, it's just a container for submodules.
diff --git a/pkgtools/url2pkg/files/python/setuptools/command/build_ext.py b/pkgtools/url2pkg/files/python/setuptools/command/build_ext.py
new file mode 100644
index 00000000000..d48c6f859f3
--- /dev/null
+++ b/pkgtools/url2pkg/files/python/setuptools/command/build_ext.py
@@ -0,0 +1,7 @@
+# $NetBSD: build_ext.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation of setuptools.command.build_ext.
+#
+# https://github.com/pypa/setuptools/blob/main/setuptools/command/build_ext.py
+
+# used by pkgsrc package wip/pytorch 1.12.0
diff --git a/pkgtools/url2pkg/files/python/setuptools/command/install.py b/pkgtools/url2pkg/files/python/setuptools/command/install.py
new file mode 100644
index 00000000000..a4a7f18dd12
--- /dev/null
+++ b/pkgtools/url2pkg/files/python/setuptools/command/install.py
@@ -0,0 +1,7 @@
+# $NetBSD: install.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation of setuptools.command.install.
+#
+# https://github.com/pypa/setuptools/blob/main/setuptools/command/install.py
+
+# used by pkgsrc package wip/pytorch 1.12.0
diff --git a/pkgtools/url2pkg/files/python/setuptools/command/sdist.py b/pkgtools/url2pkg/files/python/setuptools/command/sdist.py
new file mode 100644
index 00000000000..eeda10630e1
--- /dev/null
+++ b/pkgtools/url2pkg/files/python/setuptools/command/sdist.py
@@ -0,0 +1,7 @@
+# $NetBSD: sdist.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation of setuptools.command.sdist.
+#
+# https://github.com/pypa/setuptools/blob/main/setuptools/command/sdist.py
+
+# used by pkgsrc package wip/pytorch 1.12.0
diff --git a/pkgtools/url2pkg/files/python/setuptools/dist.py b/pkgtools/url2pkg/files/python/setuptools/dist.py
new file mode 100644
index 00000000000..ffcfed9fb13
--- /dev/null
+++ b/pkgtools/url2pkg/files/python/setuptools/dist.py
@@ -0,0 +1,7 @@
+# $NetBSD: dist.py,v 1.1 2022/07/16 08:59:39 rillig Exp $
+#
+# Fake implementation for setuptools.dist.
+
+# used by pkgsrc package wip/py-torch 1.12.0
+class Distribution:
+ pass