Skip to content

Commit

Permalink
fix setuptools being removed due to conda run_constrains (conda#9014)
Browse files Browse the repository at this point in the history
fix setuptools being removed due to conda run_constrains
  • Loading branch information
msarahan authored Jul 30, 2019
2 parents dc6c664 + 72e3d0f commit 553637b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions conda/core/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ def _collect_all_metadata(self, ssc):
# add in historically-requested specs
ssc.specs_map.update(ssc.specs_from_history_map)

for pkg_name in ('anaconda', 'conda', 'conda-build',
# these are things that we want to keep even if they're not explicitly specified. This
# is to compensate for older installers not recording these appropriately for them
# to be preserved.
for pkg_name in ('anaconda', 'conda', 'conda-build', 'python.app',
'console_shortcut', 'powershell_shortcut'):
if pkg_name not in ssc.specs_map and ssc.prefix_data.get(pkg_name, None):
ssc.specs_map[pkg_name] = MatchSpec(pkg_name)
Expand Down Expand Up @@ -582,7 +585,7 @@ def _add_specs(self, ssc):
if target_prec.is_unmanageable:
ssc.specs_map[pkg_name] = target_prec.to_match_spec()
elif MatchSpec(pkg_name) in context.aggressive_update_packages:
ssc.specs_map[pkg_name] = pkg_name
ssc.specs_map[pkg_name] = MatchSpec(pkg_name)
elif self._should_freeze(ssc, target_prec, conflict_specs, explicit_pool,
installed_pool):
ssc.specs_map[pkg_name] = target_prec.to_match_spec()
Expand Down Expand Up @@ -657,6 +660,7 @@ def _add_specs(self, ssc):
or spec.name in ssc.specs_from_history_map):
# skip this spec, because it is constrained by pins
continue
ssc.specs_map[spec.name] = spec
# the index is sorted, so the first record here gives us what we want.
latest_pkg = ssc.r.find_matches(spec)[0]
for ms in list(ssc.specs_map.values()):
Expand Down
6 changes: 3 additions & 3 deletions conda/models/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ def is_unmanageable(self):
def combined_depends(self):
from .match_spec import MatchSpec
result = {ms.name: ms for ms in MatchSpec.merge(self.depends)}
result.update({ms.name: ms for ms in MatchSpec.merge(
MatchSpec(spec, optional=True) for spec in self.constrains or ()
)})
for spec in (self.constrains or ()):
ms = MatchSpec(spec)
result[ms.name] = MatchSpec(ms, optional=(ms.name not in result))
return tuple(itervalues(result))

# the canonical code abbreviation for PackageRecord is `prec`, not to be confused with
Expand Down

0 comments on commit 553637b

Please sign in to comment.