diff --git a/.github/workflows/ci_PR.yml b/.github/workflows/ci_PR.yml index be0d67de..ba5b6296 100644 --- a/.github/workflows/ci_PR.yml +++ b/.github/workflows/ci_PR.yml @@ -12,19 +12,25 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.9] - steps: - - uses: actions/checkout@v2 + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'false' run: | python -m pip install --upgrade pip - python setup.py install - + pip install . + + - name: Windows MKL linking + if: matrix.os == 'windows-latest' + run: | + python upgrade_mkl.py + - name: Test with pytest - run: pytest + run: | + pytest diff --git a/upgrade_mkl.py b/upgrade_mkl.py index 082c66a0..16baae84 100644 --- a/upgrade_mkl.py +++ b/upgrade_mkl.py @@ -1,9 +1,6 @@ from sys import executable import platform import subprocess -import os - -MKL_LINKED = os.environ.get('MKL_LINKED', False) # Custom OS-specific installation script def install_MKL_dependencies(): @@ -12,18 +9,17 @@ def install_MKL_dependencies(): if platform.system() != 'Windows': raise SystemError('MKL dependencies are only available on Windows systems.') + subprocess.run([executable,'-m','pip','uninstall','numpy','-y'],check=False) + subprocess.run([executable,'-m','pip','uninstall','scipy','-y'],check=False) + subprocess.run([executable,'-m','pip','uninstall','cvxopt','-y'],check=False) + # At the moment the dependencies must be handled manually this way subprocess.run([executable,'-m','pip','install','git+https://github.com/luisfabib/pipwin'],check=False) - try: - # Install Numpy,SciPy, CVXopt linked to MKL from Gohlken's repository - subprocess.run([executable,'-m','pipwin','install','numpy','--filter=mkl'],check=False) - subprocess.run([executable,'-m','pipwin','install','scipy'],check=False) - subprocess.run([executable,'-m','pipwin','install','cvxopt'],check=False) - except: - subprocess.run([executable,'-m','pipwin','install','numpy','--filter=mkl','--user'],check=False) - subprocess.run([executable,'-m','pipwin','install','scipy','--user'],check=False) - subprocess.run([executable,'-m','pipwin','install','cvxopt','--user'],check=False) + # Install Numpy,SciPy, CVXopt linked to MKL from Gohlken's repository + subprocess.run([executable,'-m','pipwin','install','numpy','--filter=mkl','--user'],check=False) + subprocess.run([executable,'-m','pipwin','install','scipy','--user'],check=False) + subprocess.run([executable,'-m','pipwin','install','cvxopt','--user'],check=False) #-----------------------------------------------------------------------