summary refs log tree commit diff
path: root/pkgs/development/python-modules/buildout-nix/nix.patch
blob: 49f3c6d90f0a4ba468b9df949b39871a2b07ee21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- a/src/zc/buildout/buildout.py       2017-08-18 10:06:24.946428977 +0300
+++ b/src/zc/buildout/buildout.py       2017-08-18 10:08:49.115613364 +0300
@@ -382,6 +382,10 @@
                  if k not in versions
                  ))
 
+        # Override versions with available (nix) system packages
+        for dist in pkg_resources.working_set:
+             versions[dist.project_name] = SectionKey(dist.version, dist.location)
+
         # Absolutize some particular directory, handling also the ~/foo form,
         # and considering the location of the configuration file that generated
         # the setting as the base path, falling back to the main configuration
--- a/src/zc/buildout/easy_install.py   2017-08-18 10:06:24.948428980 +0300
+++ b/src/zc/buildout/easy_install.py   2017-08-18 10:07:37.462521740 +0300
@@ -321,6 +321,12 @@
 
     def _satisfied(self, req, source=None):
         dists = [dist for dist in self._env[req.project_name] if dist in req]
+        try:
+            dists = ([dist for dist in dists
+                     if dist.precedence == pkg_resources.DEVELOP_DIST]
+                     + [pkg_resources.get_distribution(req.project_name)])
+        except pkg_resources.DistributionNotFound:
+            pass
         if not dists:
             logger.debug('We have no distributions for %s that satisfies %r.',
                          req.project_name, str(req))