Skip to content

Commit

Permalink
Merge branch 'dev' into resource_types
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckierDodge committed Oct 25, 2024
2 parents 9bdbba9 + 5cbb3f8 commit 72ba7e8
Show file tree
Hide file tree
Showing 120 changed files with 3,297 additions and 2,769 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
steps:
- uses: actions/checkout@v3
name: Checkout code
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
name: Setup Python
with:
python-version: 3.12
- uses: pre-commit/[email protected]
name: Run Pre-Commit Checks
6 changes: 3 additions & 3 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
steps:
- uses: actions/checkout@v3
name: Checkout code
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.12
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: 3.9
python-version: 3.12
- name: Install dependencies
run: pdm install
- name: Publish to PyPi
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ jobs:
steps:
- uses: actions/checkout@v3
name: Checkout code
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.12
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: 3.9
- name: Build the Project
run: make init build
python-version: 3.12
- name: Test with pytest
run: make test
run: make init build test
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-json
Expand All @@ -17,7 +17,7 @@ repos:
- id: nbstripout
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.8
rev: v0.7.0
hooks:
# Run the linter.
- id: ruff
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ COPY requirements/requirements.txt wei/requirements/requirements.txt
COPY requirements/dev.txt wei/requirements/dev.txt
RUN --mount=type=cache,target=/root/.cache \
pip install --upgrade setuptools wheel pip && \
pip install -r wei/requirements/requirements.txt
pip install -r wei/requirements/requirements.txt && \
pip install -r wei/requirements/dev.txt

ENV PATH="${PATH}:~/.local/bin"

# Copy rest of wei files
COPY src wei/src
Expand Down
30 changes: 23 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################
.DEFAULT_GOAL := init

.PHONY: init checks test clean
.PHONY: init checks test clean down up restart rebuild

init: # Do the initial configuration of the project
@test -e .env || cp example.env .env
Expand All @@ -14,6 +14,11 @@ else
@sed -i 's/^USER_ID=.*/USER_ID=$(shell id -u)/' .env
@sed -i 's/^GROUP_ID=.*/GROUP_ID=$(shell id -g)/' .env
endif
ifeq ($(OS),Windows_NT)
@where pdm || (Invoke-WebRequest -Uri https://pdm-project.org/install-pdm.py -UseBasicParsing).Content | py -
else
@where pdm || curl -sSL https://pdm-project.org/install-pdm.py | python3 -
endif


.env: init
Expand All @@ -22,11 +27,19 @@ checks: # Runs all the pre-commit checks
@pre-commit install
@pre-commit run --all-files || { echo "Checking fixes\n" ; pre-commit run --all-files; }

test: init .env build # Runs all the tests
@docker compose up -d wei_postgres # Ensure PostgreSQL is up first
@docker compose up -d
@docker compose run test_wei_server pytest -p no:cacheprovider wei
@#docker compose down
test: init .env build up # Runs all the tests
@docker compose exec test_wei_server pytest -p no:cacheprovider wei || (docker compose logs --tail 25 && false)
@docker compose down

down:
@docker compose down

up:
@docker compose up -d --remove-orphans

restart: build up

rebuild: restart

clean:
@rm .env
Expand All @@ -44,7 +57,7 @@ build: build-python # Builds the project

# (Make sure you've installed PDM)

init-python: init pdm.lock deps # Installs the python environment (requires PDM)
init-python: init pdm-update pdm.lock deps # Installs the python environment (requires PDM)

build-python: init-python # Builds the pypi package for APP_NAME
pdm build
Expand All @@ -58,6 +71,9 @@ publish-python: init-python # Publishes the pypi package for wei
# Python Dependency Managment #
###############################

pdm-update:
pdm self update

pdm.lock: pyproject.toml # Generates the pdm.lock file
pdm install --group :all

Expand Down
30 changes: 24 additions & 6 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,45 @@ services:
ports:
- 2000:2000
env_file: .env
environment:
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
volumes:
- ~/.wei:/home/app/.wei
command: 'python3 wei/tests/test_module/test_rest_node.py --name synthesis --database_url ${DB_URL}
--port 2000
--alias synthesis'
--port 2000'
depends_on:
- wei_postgres
transfer:
image: ${IMAGE}
container_name: transfer
ports:
- 2001:2001
environment:
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
env_file: .env
volumes:
- ~/.wei:/home/app/.wei
command: 'python3 wei/tests/test_module/test_rest_node.py --name transfer --database_url ${DB_URL}
--port 2001
--alias transfer'
--port 2001'
depends_on:
- wei_postgres
measure:
image: ${IMAGE}
container_name: measure
ports:
- 2002:2002
environment:
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
env_file: .env
volumes:
- ~/.wei:/home/app/.wei
command: 'python3 wei/tests/test_module/test_rest_node.py --name measure --database_url ${DB_URL}
--port 2002
--alias measure'
--port 2002'
depends_on:
- wei_postgres

#####################
# WEI Core Services #
Expand All @@ -54,6 +66,9 @@ services:
- diaspora_config:/home/app/.diaspora
- ./tests/workcells:/workcell_defs
- ~/.wei:/home/app/.wei
environment:
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
env_file: .env
command: python3 -m wei.server --workcell /workcell_defs/${WORKCELL_FILENAME} --database_url ${DB_URL}
depends_on:
Expand All @@ -74,6 +89,9 @@ services:
utilities:
image: ${IMAGE}
container_name: utilities
environment:
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
env_file: .env
ports:
- 8001:8001
Expand Down
19 changes: 1 addition & 18 deletions docs/source/pages/_autosummary/wei.config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,9 @@ wei.config
.. automodule:: wei.config











.. rubric:: Classes

.. autosummary::

Config










19 changes: 1 addition & 18 deletions docs/source/pages/_autosummary/wei.core.admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ wei.core.admin
.. automodule:: wei.core.admin







.. rubric:: Functions

.. autosummary::
Expand All @@ -22,16 +17,4 @@ wei.core.admin
send_safety_stop
send_shutdown
send_unlock














19 changes: 1 addition & 18 deletions docs/source/pages/_autosummary/wei.core.events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,15 @@ wei.core.events
.. automodule:: wei.core.events







.. rubric:: Functions

.. autosummary::

send_event





.. rubric:: Classes

.. autosummary::

EventHandler










19 changes: 1 addition & 18 deletions docs/source/pages/_autosummary/wei.core.experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,11 @@ wei.core.experiment
.. automodule:: wei.core.experiment







.. rubric:: Functions

.. autosummary::

get_experiment
parse_experiments_from_disk
register_new_experiment














Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,4 @@ wei.core.interfaces.rest\_interface

.. automodule:: wei.core.interfaces.rest_interface




















Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,4 @@ wei.core.interfaces.ros2\_interface

.. automodule:: wei.core.interfaces.ros2_interface




















Loading

0 comments on commit 72ba7e8

Please sign in to comment.