Skip to content

Commit 60c3524

Browse files
DrLynchbradley-erickson
authored andcommitted
Merge in from ETS Updates. (#129)
Add in new ETS Updates.
2 parents 6f12321 + ef1374f commit 60c3524

303 files changed

Lines changed: 24783 additions & 26585 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,31 @@ on: [push]
55
jobs:
66
lint-python:
77
runs-on: ubuntu-latest
8-
strategy:
9-
matrix:
10-
python-version: ["3.9", "3.10"]
118
steps:
12-
- uses: actions/checkout@v3
13-
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v3
15-
with:
16-
python-version: ${{ matrix.python-version }}
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install pycodestyle
21-
- name: Analysing the code with pycodestyle
22-
run: |
23-
pycodestyle --ignore=E501,W503 $(git ls-files 'learning_observer/*.py' 'modules/*.py')
9+
- name: Checkout code
10+
uses: actions/checkout@v3
11+
- name: Set up Python
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: '3.11'
15+
16+
- name: Install Make
17+
run: sudo apt-get install make
18+
19+
- name: Lint files
20+
run: make linting-python
2421
lint-node:
2522
runs-on: ubuntu-latest
2623
steps:
2724
- name: Checkout code
28-
uses: actions/checkout@v2
29-
- name: Set up Node.js
30-
uses: actions/setup-node@v2
25+
uses: actions/checkout@v3
26+
- name: Set up Node
27+
uses: actions/setup-node@v4
3128
with:
32-
node-version: '16.x'
33-
- name: Install dependencies
34-
run: |
35-
npm install
36-
37-
- name: List unused CSS
38-
run: npm run find-unused-css
29+
node-version: '22.x'
3930

40-
- name: Lint CSS
41-
run: npm run lint:css
31+
- name: Install Make
32+
run: sudo apt-get install make
4233

43-
- name: Lint JS
44-
run: npm run lint:js
34+
- name: Lint files
35+
run: make linting-node

.github/workflows/pytest.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test packages
2+
3+
on: [push]
4+
5+
jobs:
6+
test-packages:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
package: ['learning_observer/', 'modules/writing_observer/']
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.11'
18+
19+
- name: Install Make
20+
run: sudo apt-get install make
21+
22+
- name: Get list of changed files
23+
id: changes
24+
run: |
25+
git fetch origin master
26+
git diff --name-only origin/master HEAD > changed_files.txt
27+
28+
- name: Check if package has changes
29+
id: package_check
30+
run: |
31+
if grep -qE "^${{ matrix.package }}" changed_files.txt; then
32+
echo "run_tests=true" >> $GITHUB_ENV
33+
else
34+
echo "run_tests=false" >> $GITHUB_ENV
35+
fi
36+
37+
- name: Skip tests if no changes
38+
if: env.run_tests == 'false'
39+
run: echo "Skipping tests for ${{ matrix.package }} as there are no changes."
40+
41+
- name: Install the base Learning Observer
42+
if: env.run_tests == 'true'
43+
run: make install
44+
45+
- name: Install the package with pip
46+
if: env.run_tests == 'true'
47+
run: pip install -e ${{ matrix.package }}
48+
49+
- name: Run tests
50+
if: env.run_tests == 'true'
51+
run: make test PKG=${{ matrix.package }}

.github/workflows/versioning.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ LanguageTool-5.4
3737
package-lock.json
3838
learning_observer/learning_observer/static_data/google/
3939
learning_observer/learning_observer/static_data/admins.yaml
40-
.ipynb_checkpoints/
40+
.ipynb_checkpoints/
41+
.eggs/
42+
.next/

.readthedocs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version: 2
77

88
# Set the version of Python and other tools you might need
99
build:
10-
os: ubuntu-22.04
10+
os: ubuntu-24.04
1111
tools:
12-
python: "3.10"
12+
python: "3.11"
1313
# You can also specify other tool versions:
1414
# nodejs: "19"
1515
# rust: "1.64"
@@ -26,4 +26,4 @@ sphinx:
2626
# Optionally declare the Python requirements required to build your docs
2727
python:
2828
install:
29-
- requirements: requirements.txt
29+
- requirements: autodocs/requirements.txt

CONTRIBUTORS.TXT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Piotr Mitros
22
Oren Livne
33
Paul Deane
4+
Bradley Erickson

Makefile

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
1-
PACKAGES ?= wo,awe
1+
# TODO rename these packages to something else
2+
PACKAGES ?= wo
3+
4+
help:
5+
@echo "Available commands:"
6+
@echo ""
7+
@echo " run Run the learning_observer Python application."
8+
@echo " install-pre-commit-hook Install the pre-commit git hook."
9+
@echo " install Install the learning_observer package in development mode."
10+
@echo " install-dev Install dev dependencies (requires additional setup)."
11+
@echo " install-packages Install specific packages: [${PACKAGES}]."
12+
@echo " test Run tests for the specified package (PKG=<package>)."
13+
@echo " linting-setup Setup linting tools and dependencies."
14+
@echo " linting-python Lint Python files using pycodestyle and pylint."
15+
@echo " linting-node Lint Node files (JS, CSS, and unused CSS detection)."
16+
@echo " linting Perform all linting tasks (Python and Node)."
17+
@echo " build-wo-chrome-extension Build the writing-process extension."
18+
@echo " build-python-distribution Build a distribution for the specified package (PKG=<package>)."
19+
@echo ""
20+
@echo "Note: All commands are executed in the current shell environment."
21+
@echo " Ensure your virtual environment is activated if desired, as installs and actions"
22+
@echo " will occur in the environment where the 'make' command is run."
23+
@echo ""
24+
@echo "Use 'make <command>' to execute a command. For example: make run"
225

326
run:
427
# If you haven't done so yet, run: make install
528
# we need to make sure we are on the virtual env when we do this
6-
cd learning_observer && python learning_observer --watchdog=restart
29+
cd learning_observer && python learning_observer
730

8-
venv:
9-
# This is unnecessary since LO installs requirements on install.
10-
# pip install --no-cache-dir -r requirements.txt
31+
# Install commands
32+
install-pre-commit-hook:
33+
# Adding pre-commit.sh to Git hooks
34+
cp scripts/hooks/pre-commit.sh .git/hooks/pre-commit
35+
chmod +x .git/hooks/pre-commit
1136

12-
# install commands
13-
install: venv
37+
install: install-pre-commit-hook
1438
# The following only works with specified packages
1539
# we need to install learning_observer in dev mode to
1640
# more easily pass in specific files we need, such as creds
@@ -25,42 +49,28 @@ install: venv
2549
@LODRC_CURRENT=$$(curl -s https://raw.githubusercontent.com/ETS-Next-Gen/lo_assets/main/lo_dash_react_components/lo_dash_react_components-current.tar.gz); \
2650
pip install https://raw.githubusercontent.com/ETS-Next-Gen/lo_assets/main/lo_dash_react_components/$${LODRC_CURRENT}
2751

28-
install-dev: venv
52+
install-dev:
2953
# TODO create a dev requirements file
3054
pip install --no-cache-dir -e learning_observer/[${PACKAGES}]
3155
. ${HOME}/.nvm/nvm.sh && nvm use && pip install -v -e modules/lo_dash_react_components/
3256

33-
install-packages: venv
57+
install-packages:
3458
pip install -e learning_observer/[${PACKAGES}]
3559

36-
# Just a little bit of dependency hell...
37-
# The AWE Components are built using a specific version of
38-
# `spacy`. This requires an out-of-date `typing-extensions`
39-
# package. There are few other dependecies that require a
40-
# newer version. As far as I can tell, upgrading this package
41-
# does not effect the functionality we receive from the AWE
42-
# components.
43-
# TODO remove this extra step after AWE Component's `spacy`
44-
# is no longer version locked.
45-
pip install -U typing-extensions
46-
47-
# testing commands
60+
# Testing commands
4861
test:
49-
# this is where we run doctests
50-
pytest modules/wo_highlight_dashboard
62+
@if [ -z "$(PKG)" ]; then echo "No module specified, please try again with \"make test PKG=path/to/module\""; exit 1; fi
63+
./test.sh $(PKG)
5164

5265
# Linting commands
53-
linting-setup:
54-
# Setting up linting related packages
55-
pip install pycodestyle pylint
56-
npm install
57-
5866
linting-python:
5967
# Linting Python modules
68+
pip install pycodestyle pylint
6069
pycodestyle --ignore=E501,W503 $$(git ls-files 'learning_observer/*.py' 'modules/*.py')
6170
pylint -d W0613,W0511,C0301,R0913,too-few-public-methods $$(git ls-files 'learning_observer/*.py' 'modules/*.py')
6271

6372
linting-node:
73+
npm install
6474
# TODO each of these have lots of errors and block
6575
# the next item from running
6676
# Starting to lint Node modules
@@ -74,8 +84,27 @@ linting-node:
7484
linting: linting-setup linting-python linting-node
7585
# Finished linting
7686

77-
build-writing-ext:
87+
# Build commands
88+
build-wo-chrome-extension:
7889
# Installing LO Event
7990
cd modules/lo_event && npm install & npm link lo_event
8091
# Building extension
8192
cd extension/writing-process && npm install && npm run build
93+
94+
build-python-distribution:
95+
# Building distribution for package
96+
pip install build
97+
# Switching to package directory
98+
cd $(PKG) && python -m build
99+
100+
# TODO we may want to have a separate command for uploading to testpypi
101+
upload-python-package-to-pypi: build-python-distribution
102+
pip install twine
103+
# TODO we currently only upload to testpypi
104+
# TODO we need to include `TWINE_USERNAME=__token__`
105+
# and `TWINE_PASSWORD={ourTwineToken}` to authenticate
106+
#
107+
# TODO We have not fully tested the following commands.
108+
# Try out the following steps and fix any bugs so the
109+
# Makefile can do it automatically.
110+
# cd $(PKG) && twine upload -r testpypi dist/*

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0+2025.10.01T21.16.15.146Z.8b205d0c.master

autodocs/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
_build/
2-
generated/
2+
generated/
3+
apidocs/
4+
module_readmes/

0 commit comments

Comments
 (0)