Skip to content

Commit

Permalink
handle perspective 3, move to pnpm
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
  • Loading branch information
timkpaine committed Nov 17, 2024
1 parent 6030af2 commit 835804d
Show file tree
Hide file tree
Showing 13 changed files with 3,409 additions and 2,563 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
docs/* linguist-documentation
*.ipynb linguist-documentation

*.js text eol=lf
*.py text eol=lf
*.md text eol=lf
docs/img/*.gif filter=lfs diff=lfs merge=lfs -text
raydar/dashboard/static/index.psp2.js filter=lfs diff=lfs merge=lfs -text
23 changes: 11 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
python-version: [3.9, 3.11]
node-version: [18.x]
perspective-bound: [4, 3]

steps:
- uses: actions/checkout@v4
Expand All @@ -42,16 +42,12 @@ jobs:
cache: "pip"
cache-dependency-path: 'pyproject.toml'

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: js/yarn.lock

- name: Install yarn
run: npm install -g yarn

version: 9
package_json_file: js/package.json

- name: Install dependencies
run: make develop

Expand All @@ -61,21 +57,24 @@ jobs:
- name: Lint
run: make lint

- name: Install version-check deps
run: pip install "perspective-python<${{ matrix.perspective-bound }}"

- name: Test
run: make tests
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Upload test results (Python)
uses: actions/upload-artifact@v4
with:
name: py-test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.node-version}}
name: py-test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.perspective-bound }}
path: junit.xml
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Upload test results (JS)
uses: actions/upload-artifact@v4
with:
name: js-test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.node-version}}
name: js-test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.perspective-bound }}
path: js/junit.xml
if: ${{ matrix.os == 'ubuntu-latest' }}

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,5 @@ $RECYCLE.BIN/
**/coverage/

# Compiled JS assets
raydar/dashboard/static/
raydar/dashboard/static/
!raydar/dashboard/static/index.psp2.js
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ requirements: ## install prerequisite python build requirements
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'`

develop: ## install to site-packages in editable mode
cd js; yarn
cd js; pnpm install
python -m pip install -e .[develop]

install: ## install to site-packages
Expand All @@ -27,7 +27,7 @@ testpy: ## run the python unit tests
python -m pytest -v raydar/tests --junitxml=junit.xml --cov=raydar --cov-report=xml:.coverage.xml --cov-branch --cov-fail-under=1 --cov-report term-missing

testjs: ## run the javascript unit tests
cd js; yarn test
cd js; pnpm run test

test: tests
tests: testpy testjs ## run all the unit tests
Expand All @@ -42,7 +42,7 @@ lintpy: ## lint python with ruff
python -m ruff format --check raydar setup.py

lintjs: ## lint javascript with eslint
cd js; yarn lint
cd js; pnpm run lint

lint: lintpy lintjs ## run all linters

Expand All @@ -51,7 +51,7 @@ fixpy: ## autoformat python code with isort and ruff
python -m ruff format raydar setup.py

fixjs: ## autoformat javascript code with eslint
cd js; yarn fix
cd js; pnpm run fix

fix: fixpy fixjs ## run all autofixers
format: fix
Expand Down Expand Up @@ -95,7 +95,7 @@ clean: ## clean the repository
find . -name ".ipynb_checkpoints" | xargs rm -rf
rm -rf .coverage coverage *.xml build dist *.egg-info lib node_modules .pytest_cache *.egg-info
rm -rf raydar/dashboard/static
cd js && yarn clean
cd js; pnpm run clean
git clean -fd

###########
Expand Down
4 changes: 2 additions & 2 deletions docs/wiki/Build-from-Source.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ cd raydar

## Install NodeJS

Follow the instructions for [installing NodeJS](https://nodejs.org/en/download/package-manager/all) for your system. Once installed, you can [install `yarn`](https://classic.yarnpkg.com/lang/en/docs/install/) with:
Follow the instructions for [installing NodeJS](https://nodejs.org/en/download/package-manager/all) for your system. Once installed, you can [install `pnpm`](https://pnpm.io) with:

```bash
npm instal --global yarn
npm install --global pnpm
```

## Install Python dependencies
Expand Down
17 changes: 9 additions & 8 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@
"lint": "prettier --check \"src/*.js\" \"src/*.html\" \"src/*.css\" \"*.js\" \"*.json\" \"../*.md\" \"../docs/wiki/*.md\"",
"fix": "prettier --write \"src/*.js\" \"src/*.html\" \"src/*.css\" \"*.js\" \"*.json\" \"../*.md\" \"../docs/wiki/*.md\"",
"test": ":",
"watch:esbuild": "yarn build:esbuild --watch",
"watch:esbuild": "pnpm run build:esbuild --watch",
"watch": "npm-run-all -p watch:*"
},
"dependencies": {
"@finos/perspective": "^2.5.0",
"@finos/perspective-viewer": "^2.5.0",
"@finos/perspective-viewer-d3fc": "^2.5.0",
"@finos/perspective-viewer-datagrid": "^2.5.0",
"@finos/perspective-workspace": "^2.5.0"
"@finos/perspective": "^3.1.4",
"@finos/perspective-viewer": "^3.1.4",
"@finos/perspective-viewer-d3fc": "^3.1.4",
"@finos/perspective-viewer-datagrid": "^3.1.4",
"@finos/perspective-workspace": "^3.1.4"
},
"devDependencies": {
"@finos/perspective-esbuild-plugin": "^2.5.0",
"@finos/perspective-esbuild-plugin": "^3.1.4",
"@prospective.co/procss": "^0.1.13",
"esbuild": "^0.19.2",
"esbuild-plugin-less": "^1.2.4",
"eslint": "^8.47.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.2"
"prettier": "^3.0.2",
"rimraf": "^6.0.1"
}
}
Loading

0 comments on commit 835804d

Please sign in to comment.