Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 9 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2.1
orbs:
node: circleci/node@5.1.0
python: circleci/python@4.0.0
jobs:
frontend-build-and-test:
executor:
Expand All @@ -27,45 +28,25 @@ jobs:
- run: npx playwright install
- run: npm test
backend-build-and-test:
docker:
- image: python:3.9
executor:
name: python/default
tag: "3.11"
steps:
- checkout
- restore_cache:
keys:
# when lock files change, use increasingly general
# patterns to restore cache
- &cache_key # yamllint disable-line rule:line-length
python-3.9-packages-v1-{{ .Branch }}-{{ checksum "requirements.in" }}-{{ checksum "requirements.txt" }}
# yamllint disable-line rule:line-length
- python-3.9-packages-v1-{{ .Branch }}-{{ checksum "requirements.in" }}-
- python-3.9-packages-v1-{{ .Branch }}-
- python-3.9-packages-v1-main-
- python-3.9-packages-v1-

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- run:
name: Build
command: |
python3.9 -m venv venv/
venv/bin/pip install pip-tools --constraint requirements.in
venv/bin/pip-sync
- python/install-packages:
pkg-manager: uv
args: --locked
- run:
name: PyTest with linters
command: venv/bin/pytest
- run:
name: Install package locally
command: venv/bin/pip install -e .
command: uv run pytest
- run:
name: Build metadata
command: scripts/gd build-metadata
command: uv run gd build-metadata
- run: cp -r public /tmp/workspace
- persist_to_workspace:
root: /tmp/workspace
paths:
- data
- save_cache:
paths:
- venv/
key: *cache_key

workflows:
build-and-test:
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ https://dictionary.telemetry.mozilla.org
## Getting Started

You should be able to create your own local copy of the dictionary so long as
you have [Python](https://www.python.org/) (version 3.9+) and
[node.js](https://nodejs.org/) (version 18+) installed. You will also need npm
v8 or greater: run `npm install -g npm@latest` if you need to upgrade.
you have [Python](https://www.python.org/) (version 3.11+),
[uv](https://astral.sh/uv), [node.js](https://nodejs.org/) (version 18+)
installed. You will also need npm v8 or greater: run `npm install -g npm@latest`
if you need to upgrade.

Assuming those requirements are met, follow these instructions:

```bash
# Create and activate a python virtual environment.
python3 -m venv venv/
venv/bin/pip install -r requirements.txt

# Build data needed by dashboard
./scripts/gd build-metadata
# Or, on Windows: python3 -m etl build-metadata
uv run gd build-metadata

# Install npm dependencies and start a local
# instance of the GUI
Expand Down
Empty file added etl/__init__.py
Empty file.
9 changes: 3 additions & 6 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
[build]
command = """
set -e
pip install -e .
./scripts/gd build-metadata
# glean.js currently requires a virtual environment
python3 -m venv venv
venv/bin/pip3 install setuptools wheel
curl -LsSf https://astral.sh/uv/install.sh | sh && export PATH=\"$HOME/.local/bin:$PATH\"
uv run gd build-metadata
npm ci
npm run build
if [ "$STORYBOOK" ]; then
npm run build-storybook
mv storybook-static public/storybook
fi
"""
environment = { PYTHON_VERSION = "3.9" }
environment = { PYTHON_VERSION = "3.11" }
publish = "public"

[context.production]
Expand Down
Loading