Skip to content

Commit

Permalink
hatch cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mscolnick committed Oct 2, 2024
1 parent 46faba0 commit 5f5e0d3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ jobs:
- name: 📥 Install Playwright Browsers
working-directory: ./frontend
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install chromium webkit --with-deps
run: pnpm playwright install chromium webkit --with-deps

- name: 🎭 Run Playwright tests
working-directory: ./frontend
run: npx playwright test
run: pnpm playwright test
# TODO(msconick) remove continue-on-error when all tests pass
continue-on-error: true
env:
Expand Down
21 changes: 11 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@ or [on Discord](https://discord.gg/JE7nhX6mD8).

## Prerequisites

To build marimo from source, you'll need to have Node.js, pnpm, GNU make, Python (>=3.8), and Hatch installed.
To build marimo from source, you'll need to have Node.js, pnpm, GNU make, Python (>=3.9), and Hatch installed.

- Install [Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm#using-a-node-version-manager-to-install-nodejs-and-npm) >= 18
- We use Node.js version 20
- Install [pnpm](https://github.com/pnpm/pnpm) == 9.x
- `npm install -g pnpm@9`
- Install [GNU Make](https://www.gnu.org/software/make/) (you may already have it installed)
- Install [Python](https://www.python.org/) >= 3.8. (You may already it installed. To see your version, use `python -V` at the command line.)
- Install [Hatch](https://hatch.pypa.io/latest/install/). Some options:
- `brew install hatch
- Install [Python](https://www.python.org/) >= 3.9. (You may already it installed. To see your version, use `python -V` at the command line.)
- Install [Hatch](https://hatch.pypa.io/latest/install/). Some installation options:
- `brew install hatch`
- `pipx install hatch`

And you'll need [pre-commit](https://pre-commit.com/) to run some validation checks:

```bash
pipx install pre-commit # or `pip install pre-commit` if you have a virtualenv
pipx install pre-commit
# or `pip install pre-commit` if you have a virtualenv
# or `brew install pre-commit`
```

You can optionally install pre-commit hooks to automatically run the validation checks
Expand Down Expand Up @@ -109,7 +111,6 @@ NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=development make fe -B
| `docs` | Docs | Build docs. Use `make ARGS="-a" docs` to force docs to rebuild |
| `docs-auto` | Docs | Autobuild docs |
| `docs-clean` | Docs | Remove built docs |
| `hatch-shell` | Setup | Enter a Hatch shell with an editable install of marimo |

## Lint, Typecheck, Format

Expand Down Expand Up @@ -225,23 +226,23 @@ make e2e
In `frontend/`:

```bash
npx playwright test --ui
pnpm playwright test --ui
```

**Run a specific test.**

In `frontend/`:

```bash
npx playwright test <filename> --ui
pnpm playwright test <filename> --ui
# e.g.
npx playwright test cells.test.ts --ui
pnpm playwright test cells.test.ts --ui
```

or

```bash
npx playwright test --debug <filename>
pnpm playwright test --debug <filename>
```

## Storybook
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fe-test:
.PHONY: e2e
# test end-to-end
e2e:
cd frontend; npx playwright install; npx playwright test
cd frontend; pnpm playwright install; pnpm playwright test

.PHONY: fe-lint
fe-lint:
Expand All @@ -62,9 +62,9 @@ fe-codegen:
cd openapi; pnpm install; pnpm codegen

.PHONY: py-check
# check python
# typecheck, lint, format python
py-check:
./scripts/pyfix.sh
./scripts/pycheck.sh

.PHONY: py-test
# test python
Expand Down
16 changes: 11 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,26 @@ extra-dependencies = [
]

[[tool.hatch.envs.test.matrix]]
python = ["3.8", "3.9","3.10", "3.11", "3.12"]
python = ["3.9","3.10", "3.11", "3.12"]

[tool.hatch.envs.test.scripts]
run = "pytest{env:HATCH_TEST_ARGS:} {args:tests}"
default = "pytest{env:HATCH_TEST_ARGS:} {args:tests}"

[tool.hatch.envs.test-optional]
template = "test"
# For testing mo.ui.chart, table, ...
extra-dependencies = [
"hypothesis~=6.102.1",
"httpx~=0.27.0",
"pytest~=8.3.2",
"pytest-codecov~=0.5.1",
"pytest-asyncio~=0.23.8",
# For testing mo.ui.chart, table, ...
"altair>=5.4.0",
"pandas>=1.5.3",
"pandas-stubs>=1.5.3.230321",
"geopandas~=0.14.4; python_version > '3.8'",
"matplotlib~=3.9.2; python_version > '3.8'",
"geopandas~=0.14.4; python_version > '3.9'",
"matplotlib~=3.9.2; python_version > '3.9'",
"pyarrow>=15.0.2,<18",
"pyarrow-stubs>=17.0",
"pyarrow-hotfix",
Expand All @@ -164,7 +169,7 @@ extra-dependencies = [
]

[[tool.hatch.envs.test-optional.matrix]]
python = ["3.8", "3.9","3.10", "3.11", "3.12"]
python = ["3.9","3.10", "3.11", "3.12"]

[tool.hatch.envs.docs]
dependencies = [
Expand All @@ -187,6 +192,7 @@ clean = "cd docs && make clean"

[tool.ruff]
line-length=79
include = ["marimo/**/*.py", "tests/**/*.py"]
exclude = [
"examples",
"scripts",
Expand Down
8 changes: 7 additions & 1 deletion scripts/pycheck.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/sh

echo "[check: typos]"
hatch run typos -w
echo "[check: copyright]"
./scripts/pycopyright.sh
echo "[check: lint]"
hatch run ruff check marimo/
hatch run ruff check --fix
echo "[check: format]"
hatch run ruff format
echo "[check: typecheck]"
hatch run mypy marimo/
12 changes: 0 additions & 12 deletions scripts/pyfix.sh

This file was deleted.

0 comments on commit 5f5e0d3

Please sign in to comment.