Skip to content

Commit

Permalink
Merge pull request #253 from finos/tkp/req
Browse files Browse the repository at this point in the history
Update `ruff` utilization, removed unused workflow, use ServerConnection.makeRequest
  • Loading branch information
timkpaine committed Mar 26, 2024
2 parents 8f71872 + 3922107 commit 4b3957d
Show file tree
Hide file tree
Showing 8 changed files with 1,161 additions and 1,194 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/publish.yml

This file was deleted.

20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ install: ## install to site-packages
###########
# Testing #
###########
testpy: ## Clean and Make unit tests
testpy: ## run python unit tests
python -m pytest -v jupyterlab_templates/tests --junitxml=junit.xml --cov=jupyterlab_templates --cov-report=xml:.coverage.xml --cov-branch --cov-fail-under=20 --cov-report term-missing

testjs: ## Clean and Make js tests
testjs: ## run javascript unit tests
cd js; yarn test

test: tests
tests: testpy testjs ## run the tests
tests: testpy testjs ## run all tests

###########
# Linting #
###########
lintpy: ## Black/flake8 python
python -m ruff jupyterlab_templates setup.py
lintpy: ## lint python with ruff
python -m ruff check jupyterlab_templates setup.py

lintjs: ## ESlint javascript
lintjs: ## lint javascript with eslint
cd js; yarn lint

lint: lintpy lintjs ## run linter
lint: lintpy lintjs ## run all linters

fixpy: ## Black python
fixpy: ## format python with ruff
python -m ruff format jupyterlab_templates setup.py

fixjs: ## ESlint Autofix JS
fixjs: ## format javascript with eslint
cd js; yarn fix

fix: fixpy fixjs ## run black/tslint fix
fix: fixpy fixjs ## run all autofixers
format: fix

#################
Expand Down
17 changes: 16 additions & 1 deletion js/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,22 @@
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
const esModules = ["@finos", "@jupyter", "@jupyterlab", "@jupyter-widgets", "lib0", "y-protocols", "internmap", "delaunator", "robust-predicates", "lodash-es", "nanoid"].join("|");
const esModules = [
"@finos",
"@jupyter",
"@jupyterlab",
"@jupyter-widgets",
"@microsoft",
"@rjsf",
"delaunator",
"exenv-es6",
"internmap",
"lib0",
"lodash-es",
"nanoid",
"robust-predicates",
"y-protocols",
].join("|");

module.exports = {
moduleDirectories: ["node_modules", "src", "tests"],
Expand Down
38 changes: 19 additions & 19 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,40 +46,40 @@
}
},
"dependencies": {
"@jupyterlab/application": "^4.0.7",
"@jupyterlab/apputils": "^4.1.7",
"@jupyterlab/coreutils": "^6.0.7",
"@jupyterlab/filebrowser": "^4.0.7",
"@jupyterlab/launcher": "^4.0.7",
"@jupyterlab/mainmenu": "^4.0.7",
"@jupyterlab/notebook": "^4.0.7",
"@jupyterlab/application": "^4.1.5",
"@jupyterlab/apputils": "^4.2.5",
"@jupyterlab/filebrowser": "^4.1.5",
"@jupyterlab/launcher": "^4.1.5",
"@jupyterlab/mainmenu": "^4.1.5",
"@jupyterlab/notebook": "^4.1.5",
"@jupyterlab/services": "^7.1.5",
"@lumino/disposable": "^2.1.2"
},
"devDependencies": {
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.2",
"@babel/eslint-parser": "^7.22.15",
"@babel/preset-env": "^7.23.2",
"@jupyterlab/builder": "^4.0.7",
"auditjs": "^4.0.41",
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3",
"@babel/eslint-parser": "^7.24.1",
"@babel/preset-env": "^7.24.3",
"@jupyterlab/builder": "^4.1.5",
"auditjs": "^4.0.45",
"auditjs-screener": "^0.1.1",
"babel-jest": "^29.7.0",
"eslint": "^8.52.0",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.3",
"isomorphic-fetch": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-transform-css": "^6.0.1",
"mkdirp": "^3.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"prettier": "^3.2.5",
"rimraf": "^5.0.5"
}
}
9 changes: 5 additions & 4 deletions js/src/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions js/tests/setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Object.defineProperty(window, "DragEvent", {
value: class DragEvent {},
});

Object.defineProperty(window, "matchMedia", {
writable: true,
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // Deprecated
removeListener: jest.fn(), // Deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
});

0 comments on commit 4b3957d

Please sign in to comment.