Skip to content

Commit

Permalink
Update overloaded patch_recipe for SpyderCondaPkg to reflect the new …
Browse files Browse the repository at this point in the history
…multipackage output of the feedstock.

Note that the outputs section contains a list of mappings, therefore cannot be clobbered surgically like other header sections. Rather, the entire list of mappings must be reproduced except with the new run requirements.
  • Loading branch information
mrclary committed Dec 14, 2024
1 parent 03153d1 commit d0bca23
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions installers-conda/build_conda_pkgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,27 +271,55 @@ def _patch_source(self):

def patch_recipe(self):
# Get current Spyder requirements
current_requirements = ['python']
current_requirements += yaml.load(
spyder_base_reqs = ['python']
spyder_base_reqs += yaml.load(
REQ_MAIN.read_text())['dependencies']
if os.name == 'nt':
win_requirements = yaml.load(
REQ_WINDOWS.read_text())['dependencies']
current_requirements += win_requirements
current_requirements.append('ptyprocess >=0.5')
spyder_base_reqs += win_requirements
spyder_base_reqs.append('ptyprocess >=0.5')
elif sys.platform == 'darwin':
mac_requirements = yaml.load(
REQ_MAC.read_text())['dependencies']
if 'python.app' in mac_requirements:
mac_requirements.remove('python.app')
current_requirements += mac_requirements
spyder_base_reqs += mac_requirements
else:
linux_requirements = yaml.load(
REQ_LINUX.read_text())['dependencies']
current_requirements += linux_requirements
spyder_base_reqs += linux_requirements

spyder_reqs = [f"spyder-base =={self.version}"]
for req in spyder_base_reqs.copy():
if req.startswith(('pyqt ', 'pyqtwebengine ', 'qtconsole ')):
spyder_reqs.append(req)
spyder_base_reqs.remove(req)

if req.startswith('qtconsole '):
spyder_base_reqs.append(
req.replace('qtconsole', 'qtconsole-base')
)

self.recipe_clobber.update({
"requirements": {"run": current_requirements}
"requirements": {"run": spyder_base_reqs},
# Since outputs is a list, the entire list must be reproduced with
# the current run requirements
"outputs": [
{
"name": "spyder-base"
},
{
"name": "spyder",
"build": {"noarch": "python"},
"requirements": {"run": spyder_reqs},
"test": {
"requires": ["pip"],
"commands": ["spyder -h", "python -m pip check"],
"imports": ["spyder"]
}
}
]
})

super().patch_recipe()
Expand Down

0 comments on commit d0bca23

Please sign in to comment.