summary refs log tree commit diff
path: root/pkgs/development/python-modules/astropy-extension-helpers
diff options
context:
space:
mode:
authorRobert T. McGibbon <rmcgibbo@gmail.com>2020-12-27 19:15:59 -0500
committerRobert T. McGibbon <rmcgibbo@gmail.com>2020-12-28 15:16:20 -0500
commit7ef5a93fe1a3e69307b316484641fee7caed0ed4 (patch)
tree525548d1ddc9e8b87f5e202dcdc295cf05dd101f /pkgs/development/python-modules/astropy-extension-helpers
parent182945f2851d570f868125bbf17a3acc5dcfd84f (diff)
downloadnixpkgs-7ef5a93fe1a3e69307b316484641fee7caed0ed4.tar
nixpkgs-7ef5a93fe1a3e69307b316484641fee7caed0ed4.tar.gz
nixpkgs-7ef5a93fe1a3e69307b316484641fee7caed0ed4.tar.bz2
nixpkgs-7ef5a93fe1a3e69307b316484641fee7caed0ed4.tar.lz
nixpkgs-7ef5a93fe1a3e69307b316484641fee7caed0ed4.tar.xz
nixpkgs-7ef5a93fe1a3e69307b316484641fee7caed0ed4.tar.zst
nixpkgs-7ef5a93fe1a3e69307b316484641fee7caed0ed4.zip
python3Packages.astropy-extension-helpers: init at 0.1
Diffstat (limited to 'pkgs/development/python-modules/astropy-extension-helpers')
-rw-r--r--pkgs/development/python-modules/astropy-extension-helpers/default.nix31
-rw-r--r--pkgs/development/python-modules/astropy-extension-helpers/permissions.patch20
2 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/astropy-extension-helpers/default.nix b/pkgs/development/python-modules/astropy-extension-helpers/default.nix
new file mode 100644
index 00000000000..bd9dca338fc
--- /dev/null
+++ b/pkgs/development/python-modules/astropy-extension-helpers/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "extension-helpers";
+  version = "0.1";
+  format = "pyproject";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "10iqjzmya2h4sk765dlm1pbqypwlqyh8rw59a5m9i63d3klnz2mc";
+  };
+
+  patches = [ ./permissions.patch ];
+
+  checkInputs = [ pytestCheckHook ];
+
+  pythonImportsCheck = [
+    "extension_helpers"
+  ];
+
+  meta = with lib; {
+    description = "Utilities for building and installing packages in the Astropy ecosystem";
+    homepage = "https://github.com/astropy/extension-helpers";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.rmcgibbo ];
+  };
+}
diff --git a/pkgs/development/python-modules/astropy-extension-helpers/permissions.patch b/pkgs/development/python-modules/astropy-extension-helpers/permissions.patch
new file mode 100644
index 00000000000..cef74b33603
--- /dev/null
+++ b/pkgs/development/python-modules/astropy-extension-helpers/permissions.patch
@@ -0,0 +1,20 @@
+diff --git a/extension_helpers/_setup_helpers.py b/extension_helpers/_setup_helpers.py
+index ec3e547..e2419f7 100644
+--- a/extension_helpers/_setup_helpers.py
++++ b/extension_helpers/_setup_helpers.py
+@@ -79,8 +79,13 @@ def get_extensions(srcdir='.'):
+     if len(ext_modules) > 0:
+         main_package_dir = min(packages, key=len)
+         src_path = os.path.join(os.path.dirname(__file__), 'src')
+-        shutil.copy(os.path.join(src_path, 'compiler.c'),
+-                    os.path.join(srcdir, main_package_dir, '_compiler.c'))
++        a = os.path.join(src_path, 'compiler.c')
++        b = os.path.join(srcdir, main_package_dir, '_compiler.c')
++        try:
++            os.unlink(b)
++        except OSError:
++            pass
++        shutil.copy(a, b)
+         ext = Extension(main_package_dir + '.compiler_version',
+                         [os.path.join(main_package_dir, '_compiler.c')])
+         ext_modules.append(ext)