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

Compatibility with Windows / testing Windows in CI #1204

Closed
alexander-held opened this issue Dec 3, 2020 · 4 comments
Closed

Compatibility with Windows / testing Windows in CI #1204

alexander-held opened this issue Dec 3, 2020 · 4 comments
Labels
CI CI systems, GitHub Actions user request Request coming form a pyhf user wontfix This will not be worked on

Comments

@alexander-held
Copy link
Member

alexander-held commented Dec 3, 2020

Question

Currently pyhf runs tests in the CI on Ubuntu and Mac OS. What do you think about adding Windows as well? An example is here. I have not tried running pyhf under Windows, and am not aware whether any code changes would be required for that.

Relevant Issues and Pull Requests

none

@matthewfeickert matthewfeickert added the wontfix This will not be worked on label Dec 3, 2020
@matthewfeickert
Copy link
Member

matthewfeickert commented Dec 3, 2020

Thanks for the Issue @alexander-held. This is very reasonable, and something that I've tried to add in the past. However, as PyTorch doesn't support Windows on PyPI at the moment I don't think this is going to happen in the foreseeable future.

@matthewfeickert
Copy link
Member

matthewfeickert commented Dec 3, 2020

Okay, I'll amend that to mention that the PyTorch webpage mentions:

Installing on Windows
PyTorch can be installed and used on various Windows distributions. Depending on your system and compute requirements, your experience with PyTorch on Windows may vary in terms of processing time.

and to try using

python -m pip install torch==1.7.0+cpu --find-links https://download.pytorch.org/whl/torch_stable.html

but that means that there is no PyPI support. I'll be happy to be proven wrong on this and that it is really easy to do, but I think that unless someone contributes a PR that doesn't make the CI YAML super awful to look at I'll leave this closed.

@mickypaganini please feel free to correct me here if torch on Windows is actually trivial and I'm missing something. :)

@matthewfeickert matthewfeickert added CI CI systems, GitHub Actions user request Request coming form a pyhf user labels Dec 3, 2020
@matthewfeickert
Copy link
Member

Having given this a go with

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 315997a8..1fccd990 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,13 +14,17 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        os: [ubuntu-latest, macos-latest]
+        os: [ubuntu-latest, macos-latest, windows-latest]
         python-version: [3.6, 3.7, 3.8]
         exclude:
           - os: macos-latest
             python-version: 3.6
           - os: macos-latest
             python-version: 3.7
+          - os: windows-latest
+            python-version: 3.6
+          - os: windows-latest
+            python-version: 3.7
 
     steps:
     - uses: actions/checkout@v2
@@ -29,10 +33,17 @@ jobs:
       with:
         python-version: ${{ matrix.python-version }}
     - name: Install dependencies
+      if: matrix.os != 'windows-latest'
       run: |
         python -m pip install --upgrade pip setuptools wheel
         python -m pip install --ignore-installed -U -q --no-cache-dir -e .[test]
         python -m pip list
+    - name: Install dependencies Windows
+      if: matrix.os == 'windows-latest'
+      run: |
+        python -m pip install --upgrade pip setuptools wheel
+        python -m pip install --ignore-installed -U -q --no-cache-dir  --find-links https://download.pytorch.org/whl/torch_stable.html -e .[test]
+        python -m pip list
     - name: Test with pytest
       run: |
         python -m pytest -r sx --ignore tests/benchmarks/ --ignore tests/contrib --ignore tests/test_notebooks.p

It seems that things are still going to be complicated given that pip gives

ERROR: Could not find a version that satisfies the requirement jaxlib~=0.1.56; extra == "test" (from pyhf[test])
ERROR: No matching distribution found for jaxlib~=0.1.56; extra == "test"

which makes sense given the following comment

JAX doesn’t support Windows right now, though it may be that the only thing standing in our way is getting the build to work. If Tensorflow can be built with XLA on Windows, then it should be possible to build JAX too, with some revisions to our own build scripts to fix issues like this.

Getting JAX on Windows is out of scope for us for now, just because we need to prioritize other kinds of progress. But contributions are welcome!

Though later on it is seen that this is being worked on by contributors.

I think I'll leave this closed but mark it as help-wanted as a contributor PR for the future.

@matthewfeickert matthewfeickert added the help wanted Extra attention is needed / contributions welcome label Dec 3, 2020
@matthewfeickert matthewfeickert removed the help wanted Extra attention is needed / contributions welcome label Oct 25, 2023
@matthewfeickert
Copy link
Member

This is effectivley fixed now that all the backends support Windows for Python 3.9+ and with PR #2357 and PR #2363.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI systems, GitHub Actions user request Request coming form a pyhf user wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants