From fceae7634739499d1081ae6cb9df352c12856d4c Mon Sep 17 00:00:00 2001 From: Your NameOshriAsulin Date: Fri, 28 Jul 2023 12:17:18 +0300 Subject: [PATCH 1/3] Added a changes for ignore of .whl --- src/content/registry/python.js | 5 +++++ src/content/registry/python.test.js | 1 + tests/real-examples/real-examples.yaml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/src/content/registry/python.js b/src/content/registry/python.js index f0b7b1e..2224642 100644 --- a/src/content/registry/python.js +++ b/src/content/registry/python.js @@ -90,6 +90,11 @@ const handleArgument = (argument, restCommandWords) => { const baseCommandMatch = (line) => line.match(/pip3? +install/); const packageWordParse = (word) => { + if (word.endsWith('.whl')) { + console.debug('Ignoring package with ".whl":', word); + return null; + } + const match = word.match(packageArea); if (!match) return null; diff --git a/src/content/registry/python.test.js b/src/content/registry/python.test.js index 2aa9168..616708e 100644 --- a/src/content/registry/python.test.js +++ b/src/content/registry/python.test.js @@ -17,6 +17,7 @@ describe(parseCommand.name, () => { 'install numpy‑1.9.2+mkl‑cp34‑none‑win_amd64.whl', 'install MySQL_python==', // Although this is a valid package name, it's not a valid command 'install -r requirements.txt', + 'pip install scipy-0.16.1-cp27-none-win_amd64.whl', ]; const createCommand = (packageManager) => commands.map((command) => `${packageManager} ${command}`); diff --git a/tests/real-examples/real-examples.yaml b/tests/real-examples/real-examples.yaml index 37dcd8d..7d13a3e 100644 --- a/tests/real-examples/real-examples.yaml +++ b/tests/real-examples/real-examples.yaml @@ -126,3 +126,7 @@ links: comment: github subfolder post: answer registry: go + https://stackoverflow.com/a/33984261: + comment: should Ignore this .whl as a package + post: answer + registry: pypi From 7a3ce9d353df996dfd15be4a16f1cf976433b935 Mon Sep 17 00:00:00 2001 From: Baruch Odem Date: Fri, 28 Jul 2023 17:36:55 +0300 Subject: [PATCH 2/3] update real-examples --- .../real-examples/real-examples-results.yaml | 117 +++++++++++++++--- tests/real-examples/real-examples.yaml | 8 +- 2 files changed, 104 insertions(+), 21 deletions(-) diff --git a/tests/real-examples/real-examples-results.yaml b/tests/real-examples/real-examples-results.yaml index 6b7b11f..fb9c7d6 100644 --- a/tests/real-examples/real-examples-results.yaml +++ b/tests/real-examples/real-examples-results.yaml @@ -1983,11 +1983,6 @@ https://stackoverflow.com/questions/26575587: type: pypi name: pip - - range: |- - pip install scipy-0.16.1-cp27-none-win_amd64.whl - - type: pypi - name: scipy-0.16.1-cp27-none-win_amd64.whl - range: |- $ sudo apt-get install libatlas-base-dev gfortran $ sudo pip3 install scipy @@ -2009,28 +2004,116 @@ https://stackoverflow.com/questions/26575587: type: pypi name: scipy - range: |- - pip install FileName.whl + $ sudo pip install scipy + + type: pypi + name: scipy + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + + + type: pypi + name: numpy + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + + + type: pypi + name: scipy + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + + + type: pypi + name: matplotlib + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + + + type: pypi + name: ipython + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + type: pypi - name: FileName.whl - - range: pip install scipy-0.15.1-cp33-none-win_amd64.whl.whl + name: jupyter + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + + + type: pypi + name: pandas + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + + type: pypi - name: scipy-0.15.1-cp33-none-win_amd64.whl.whl + name: sympy + - range: >- + python -m pip install --user numpy scipy matplotlib ipython + jupyter pandas sympy nose + + + type: pypi + name: nose +https://stackoverflow.com/a/33984261: + comment: should Ignore this .whl as a package + post: answer + registry: pypi + results: + - range: >- + https://pypi.python.org/pypi/scipy + type: pypi + name: scipy - range: |- - $ sudo pip install scipy + pip install scipy type: pypi name: scipy - range: |- - - @echo off - C:\Python36\python.exe -m pip -V - C:\Python36\python.exe -m pip install scipy-0.19.1-cp36-cp36m-win32.whl - C:\Python36\python.exe -m pip list - pause + pip install --upgrade pip type: pypi - name: scipy-0.19.1-cp36-cp36m-win32.whl + name: pip + - range: |- + python3 -m pip install --upgrade pip + + type: pypi + name: pip + - range: |- + $ sudo apt-get install libatlas-base-dev gfortran + $ sudo pip3 install scipy + + type: pypi + name: scipy + - range: pip install scipy + type: pypi + name: scipy + - range: |- + brew install gcc + pip install scipy + + type: pypi + name: scipy + - range: |- + pip install scipy + + type: pypi + name: scipy + - range: |- + $ sudo pip install scipy + + type: pypi + name: scipy - range: >- python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose diff --git a/tests/real-examples/real-examples.yaml b/tests/real-examples/real-examples.yaml index 7d13a3e..583af67 100644 --- a/tests/real-examples/real-examples.yaml +++ b/tests/real-examples/real-examples.yaml @@ -97,6 +97,10 @@ links: comment: pip3 install command post: answer registry: pypi + https://stackoverflow.com/a/33984261: + comment: should Ignore this .whl as a package + post: answer + registry: pypi https://stackoverflow.com/a/27709931: comment: go get standard library @@ -126,7 +130,3 @@ links: comment: github subfolder post: answer registry: go - https://stackoverflow.com/a/33984261: - comment: should Ignore this .whl as a package - post: answer - registry: pypi From e09ccfe36b508240ffa0f6d212d5b0a4eb3b3b41 Mon Sep 17 00:00:00 2001 From: OshriAsulin <114335827+OshriAsulin@users.noreply.github.com> Date: Sun, 30 Jul 2023 10:00:59 +0200 Subject: [PATCH 3/3] Update python.test.js Removed pip word from the command in line 20 --- src/content/registry/python.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/registry/python.test.js b/src/content/registry/python.test.js index 616708e..1481130 100644 --- a/src/content/registry/python.test.js +++ b/src/content/registry/python.test.js @@ -17,7 +17,7 @@ describe(parseCommand.name, () => { 'install numpy‑1.9.2+mkl‑cp34‑none‑win_amd64.whl', 'install MySQL_python==', // Although this is a valid package name, it's not a valid command 'install -r requirements.txt', - 'pip install scipy-0.16.1-cp27-none-win_amd64.whl', + 'install scipy-0.16.1-cp27-none-win_amd64.whl', ]; const createCommand = (packageManager) => commands.map((command) => `${packageManager} ${command}`);