Skip to content

Commit

Permalink
Merge pull request #266 from jpmorganchase/dependabot/npm_and_yarn/js…
Browse files Browse the repository at this point in the history
…/tar-6.2.1

Bump tar from 6.1.11 to 6.2.1 in /js
  • Loading branch information
timkpaine authored May 31, 2024
2 parents 39cb25d + 1eee9ac commit 95b2d97
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 35 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@ on:
push:
branches:
- main
tags:
- v*
paths-ignore:
- docs/
- CONTRIBUTING.md
- LICENSE
- README.md
pull_request:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
checks: write
pull-requests: write

jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -21,19 +30,19 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9]
node-version: [12.x]
node-version: [16.x]
event-name: [push]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -53,18 +62,18 @@ jobs:
- name: Test
run: |
make tests
if: ${{ github.event_name == matrix.event-name || matrix.os == 'ubuntu-latest' }}
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Twine check
run: |
make dist
- name: Upload test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: python_junit.xml
if: ${{ always() }}

- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
13 changes: 9 additions & 4 deletions js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5499,6 +5499,11 @@ minipass@^3.0.0, minipass@^3.1.1:
dependencies:
yallist "^4.0.0"

minipass@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d"
integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==

minizlib@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
Expand Down Expand Up @@ -7227,13 +7232,13 @@ tapable@^2.1.1, tapable@^2.2.0:
integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==

tar@^6.0.2:
version "6.1.11"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
version "6.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
minipass "^3.0.0"
minipass "^5.0.0"
minizlib "^2.1.1"
mkdirp "^1.0.3"
yallist "^4.0.0"
Expand Down
4 changes: 1 addition & 3 deletions nbcelltests/define.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ def __repr__(self):
ret = (
"PASSED: "
if self.passed > 0
else "FAILED: "
if self.passed < 0
else "NOT RUN: "
else "FAILED: " if self.passed < 0 else "NOT RUN: "
)
ret += self.message
ret += " (Cell %d)" % self.cell if self.cell > 0 else ""
Expand Down
8 changes: 4 additions & 4 deletions nbcelltests/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import tornado.web
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor
from notebook.base.handlers import IPythonHandler
from notebook.utils import url_path_join
from jupyter_server.base.handlers import JupyterHandler
from jupyter_server.utils import url_path_join

try:
from tempfile import TemporaryDirectory
Expand All @@ -26,7 +26,7 @@
from .lint import run as runLint


class RunCelltestsHandler(IPythonHandler):
class RunCelltestsHandler(JupyterHandler):
executor = ThreadPoolExecutor(4)

def initialize(self, rules=None, executable=None):
Expand Down Expand Up @@ -56,7 +56,7 @@ def post(self):
self.finish({"status": 0, "test": ret})


class RunLintsHandler(IPythonHandler):
class RunLintsHandler(JupyterHandler):
executor = ThreadPoolExecutor(4)

def initialize(self, rules=None, executable=None):
Expand Down
1 change: 1 addition & 0 deletions nbcelltests/tests/test_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def test_extract_extrametadata_magics_noncode():
# D = contribs to denominator of calc
# - = contribs nothing


# -- empty code cell with test
# -- markdown cell
# ND code cell with valid test
Expand Down
21 changes: 10 additions & 11 deletions nbcelltests/tests/test_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import unittest

from bs4 import BeautifulSoup
import json
import pytest
from nbval.kernel import CURRENT_ENV_KERNEL_NAME
import jupyter_client.kernelspec as kspec
Expand Down Expand Up @@ -762,6 +763,7 @@ def make_test_mod():
# https://github.com/jpmorganchase/nbcelltests/issues/125 before
# deciding how to handle that better here.


# No need to group these tests in a class (to be run sequentially) once
# https://github.com/jpmorganchase/nbcelltests/issues/207 is resolved.
class TestCoverage:
Expand Down Expand Up @@ -915,7 +917,7 @@ def _check(html, coverage_result):
tests_ran = False
for p in html_soup.find_all("p"):
# 1 cell test plus coverage test
if p.text.startswith("5 tests ran in"):
if p.text.startswith("5 tests "):
tests_ran = True
break

Expand All @@ -929,19 +931,16 @@ def _check(html, coverage_result):
"test_cell_coverage": coverage_result,
}

actual_results = html_soup.find_all(class_="results-table-row")
actual_results = json.loads(
html_soup.find("div", {"id": "data-container"}).get("data-jsonblob")
)["tests"]

assert len(actual_results) == len(expected_results)

for actual_result, expected_name in zip(
sorted(actual_results, key=lambda x: x.find_next(class_="col-name").text),
sorted(expected_results),
):
name = actual_result.find_next(class_="col-name").text
state = actual_result.find_next(class_="col-result").text

assert name.endswith(expected_name)
assert state == expected_results[expected_name]
for actual_result, data in actual_results.items():
actual_result_name = actual_result.rsplit("::", 1)[-1]
expected_result = expected_results[actual_result_name]
assert data[0]["result"] == expected_result


# TODO: either make genuinely abstract, or don't use classes/inheritance at all here (since classes/inheritance are not meaningful here anyway).
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@
requires = [
'backports.tempfile ; python_version < "3"',
"flake8",
"jupyter-server",
"nbconvert",
"nbformat>=4.0.0",
"nbval>=0.9.1",
"notebook",
"parameterized",
"pytest>=4.4.0",
"pytest-cov",
"pytest-html>=1.20.0",
"pytest-html>=4",
]

dev_requires = requires + [
"black>=20.",
"black>=20",
"beautifulsoup4",
"bump2version>=1.0.0",
"flake8>=3.7.8",
Expand Down

0 comments on commit 95b2d97

Please sign in to comment.