Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Update Spyder conda builds for PRs to accommodate split packaging #23239

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/build-subrepos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
id: cache
uses: actions/cache@v4
with:
path: installers-conda/build/conda-bld/**/*.tar.bz2
path: installers-conda/build/conda-bld/**/*.conda
key: ${{ matrix.pkg }}_${{ matrix.cache-arch }}_${{ matrix.python-version }}_${{ hashFiles(format('external-deps/{0}/.gitrepo', env.pkg)) }}
lookup-only: true
enableCrossOsArchive: true
Expand All @@ -67,6 +67,10 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
uses: mamba-org/setup-micromamba@v1
with:
condarc: |
conda_build:
pkg_format: '2'
zstd_compression_level: '19'
environment-file: installers-conda/build-environment.yml
environment-name: spy-inst
create-args: >-
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/installers-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
if: env.USE_SUBREPOS == 'true'
uses: actions/cache/restore@v4
with:
path: installers-conda/build/conda-bld/**/*.tar.bz2
path: installers-conda/build/conda-bld/**/*.conda
key: python-lsp-server_noarch_${{ matrix.python-version }}_${{ hashFiles('external-deps/python-lsp-server/.gitrepo') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
Expand All @@ -174,7 +174,7 @@ jobs:
if: env.USE_SUBREPOS == 'true'
uses: actions/cache/restore@v4
with:
path: installers-conda/build/conda-bld/**/*.tar.bz2
path: installers-conda/build/conda-bld/**/*.conda
key: qtconsole_noarch_${{ matrix.python-version }}_${{ hashFiles('external-deps/qtconsole/.gitrepo') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
Expand All @@ -183,7 +183,7 @@ jobs:
if: env.USE_SUBREPOS == 'true'
uses: actions/cache/restore@v4
with:
path: installers-conda/build/conda-bld/**/*.tar.bz2
path: installers-conda/build/conda-bld/**/*.conda
key: spyder-kernels_${{ matrix.spyk-arch }}_${{ matrix.python-version }}_${{ hashFiles('external-deps/spyder-kernels/.gitrepo') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
Expand Down Expand Up @@ -254,6 +254,8 @@ jobs:
# built in workspace
[[ -d build/conda-bld ]] && cp -Rv build/conda-bld $CONDA_BLD_PATH

export CONDA_SHORTCUTS=false # Don't create shortcuts while building

python build_conda_pkgs.py --build spyder

- name: Create Local Conda Channel
Expand Down Expand Up @@ -289,6 +291,8 @@ jobs:

- name: Build Package Installer
run: |
export CONDA_SHORTCUTS=false # Don't create shortcuts while building

[[ -n $CNAME ]] && args=("--cert-id" "$CNAME") || args=()
python build_installers.py ${args[@]}

Expand Down
58 changes: 44 additions & 14 deletions installers-conda/build_conda_pkgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ def _patch_source(self):

def _patch_conda_build_config(self):
file = self._fdstk_path / "recipe" / "conda_build_config.yaml"
if file.exists():
contents = yaml.load(file.read_text())
file.rename(file.parent / ("_" + file.name)) # copy of original
else:
contents = {}
if not file.exists():
return

contents = yaml.load(file.read_text())
file.rename(file.parent / ("_" + file.name)) # copy of original

pyver = sys.version_info
contents['python'] = [f"{pyver.major}.{pyver.minor}.* *_cpython"]
Expand Down Expand Up @@ -247,8 +247,8 @@ class SpyderCondaPkg(BuildCondaPkg):
name = "spyder"
norm = False
source = os.environ.get('SPYDER_SOURCE', HERE.parent)
feedstock = "https://github.com/conda-forge/spyder-feedstock"
feedstock_branch = "dev"
feedstock = "https://github.com/mrclary/spyder-feedstock"
feedstock_branch = "spyder-base"
shallow_ver = "v5.3.2"

def _patch_source(self):
Expand All @@ -273,27 +273,57 @@ 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
spyder_base_reqs.append('__osx')
else:
linux_requirements = yaml.load(
REQ_LINUX.read_text())['dependencies']
current_requirements += linux_requirements
spyder_base_reqs += linux_requirements
spyder_base_reqs.append('__linux')

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
Loading