From c512d8237dd445d1fbee0f31dfc5445a3aa6e09a Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Tue, 21 Aug 2018 18:10:31 +0300 Subject: [PATCH] Package setuptools --- packages/pytest/meta.yaml | 1 + packages/setuptools/meta.yaml | 20 ++++++++++ .../setuptools/patches/remove-ctypes.patch | 37 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 packages/setuptools/meta.yaml create mode 100644 packages/setuptools/patches/remove-ctypes.patch diff --git a/packages/pytest/meta.yaml b/packages/pytest/meta.yaml index 955c6975d..5fd3916ff 100644 --- a/packages/pytest/meta.yaml +++ b/packages/pytest/meta.yaml @@ -13,6 +13,7 @@ requirements: - more-itertools - pluggy - py + - setuptools test: imports: diff --git a/packages/setuptools/meta.yaml b/packages/setuptools/meta.yaml new file mode 100644 index 000000000..4113aac0b --- /dev/null +++ b/packages/setuptools/meta.yaml @@ -0,0 +1,20 @@ +package: + name: setuptools + version: 40.0.0 + +source: + url: https://pypi.io/packages/source/s/setuptools/setuptools-40.0.0.zip + sha256: 012adb8e25fbfd64c652e99e7bab58799a3aaf05d39ab38561f69190a909015f + + patches: + - patches/remove-ctypes.patch + +requirements: + run: + - pyparsing + +test: + imports: + - setuptools + - easy_install + - pkg_resources diff --git a/packages/setuptools/patches/remove-ctypes.patch b/packages/setuptools/patches/remove-ctypes.patch new file mode 100644 index 000000000..f009a7d91 --- /dev/null +++ b/packages/setuptools/patches/remove-ctypes.patch @@ -0,0 +1,37 @@ +diff --git a/setuptools/glibc.py b/setuptools/glibc.py +index a134591c..c31fc78a 100644 +--- a/setuptools/glibc.py ++++ b/setuptools/glibc.py +@@ -2,13 +2,13 @@ + # https://github.com/pypa/pip/blob/8f4f15a5a95d7d5b511ceaee9ed261176c181970/src/pip/_internal/utils/glibc.py + from __future__ import absolute_import + +-import ctypes + import re + import warnings + + + def glibc_version_string(): + "Returns glibc version string, or None if not using glibc." ++ import ctypes + + # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen + # manpage says, "If filename is NULL, then the returned handle is for the +diff --git a/setuptools/windows_support.py b/setuptools/windows_support.py +index cb977cff..1ca64fbb 100644 +--- a/setuptools/windows_support.py ++++ b/setuptools/windows_support.py +@@ -1,5 +1,4 @@ + import platform +-import ctypes + + + def windows_only(func): +@@ -17,6 +16,7 @@ def hide_file(path): + + `path` must be text. + """ ++ import ctypes + __import__('ctypes.wintypes') + SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW + SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD