Skip to content

Commit

Permalink
Upgrade python packages using poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Feb 7, 2025
1 parent 48a3666 commit 1682946
Show file tree
Hide file tree
Showing 18 changed files with 1,251 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OPENC3_ENTERPRISE_REGISTRY=ghcr.io
OPENC3_ENTERPRISE_NAMESPACE=openc3
OPENC3_UBI_REGISTRY=registry1.dso.mil
OPENC3_UBI_IMAGE=ironbank/redhat/ubi/ubi8-minimal
OPENC3_UBI_TAG=8.8
OPENC3_UBI_TAG=8.10
# Defined here as blank to avoid warnings. Used in the compose.yaml to pass '-ubi'.
OPENC3_IMAGE_SUFFIX=
# Bucket & Volume configuration
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/api_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install poetry
poetry install
working-directory: openc3/python
- name: Lint with ruff
run: |
ruff --config=../openc3/python/pyproject.toml --format=github scripts/*.py
poetry run ruff --config=../openc3/python/pyproject.toml --output-format=github scripts/*.py
working-directory: openc3-cosmos-script-runner-api
- name: Run unit tests
run: |
coverage run -m pytest ./test/
coverage xml -i
poetry run coverage run -m pytest ./test/
poetry run coverage xml -i
working-directory: openc3-cosmos-script-runner-api
- uses: codecov/codecov-action@v5
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/python_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install poetry
poetry install
working-directory: openc3/python
- name: Lint with ruff
run: |
ruff --format=github openc3
poetry run ruff check --output-format=github openc3
working-directory: openc3/python
- name: Run unit tests
run: |
coverage run -m pytest ./test/
coverage xml -i
poetry run coverage run -m pytest ./test/
poetry run coverage xml -i
working-directory: openc3/python
- uses: codecov/codecov-action@v5
with:
Expand Down
8 changes: 4 additions & 4 deletions docs.openc3.com/docs/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ Code coverage reports can be found at `cosmos/openc3/coverage/index.html`
1. Navigate to **cosmos/openc3/python** folder. Run the command:

```bash
cosmos/openc3/python % python -m pip install -r requirements-dev.txt
cosmos/openc3/python % python -m pip install -r requirements.txt
cosmos/openc3/python % coverage run -m pytest
cosmos/openc3/python % coverage html
cosmos/openc3/python % python -m pip install poetry
cosmos/openc3/python % poetry install
cosmos/openc3/python % poetry run coverage run -m pytest
cosmos/openc3/python % poetry run coverage html
```

Code coverage reports can be found at `cosmos/openc3/python/coverage/index.html`

This file was deleted.

2 changes: 1 addition & 1 deletion openc3-ruby/Dockerfile-ubi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG OPENC3_UBI_REGISTRY=registry1.dso.mil
ARG OPENC3_UBI_IMAGE=ironbank/redhat/ubi/ubi8-minimal
ARG OPENC3_UBI_TAG=8.8
ARG OPENC3_UBI_TAG=8.10

FROM ${OPENC3_UBI_REGISTRY}/${OPENC3_UBI_IMAGE}:${OPENC3_UBI_TAG}

Expand Down
6 changes: 6 additions & 0 deletions openc3.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
},
{
"path": "../openc3-schedule"
},
{
"path": "../openc3-news"
},
{
"path": "../openc3-cosmos-cfdp"
}
],
"settings": {
Expand Down
3 changes: 2 additions & 1 deletion openc3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ RUN mkdir -p lib/openc3/ext \
WORKDIR /openc3/python

RUN . /openc3/venv/bin/activate \
&& pip3 install -r requirements.txt && pip3 install --pre .
&& pip3 install poetry \
&& poetry install

WORKDIR /openc3/

Expand Down
2 changes: 1 addition & 1 deletion openc3/python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ipython_config.py
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
poetry.lock
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down
9 changes: 1 addition & 8 deletions openc3/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Additional functionality and support will be added over time.

```
pip install openc3
pip install poetry
```

See the docs, examples for usage
Expand All @@ -39,14 +40,6 @@ Now that we have a virtual environment, we need to activate it.

After you activate the environment, your command prompt will be modified to reflect the change.

### Development requirements-dev.txt

Although requests is required, when doing development work it is helpful to test with pytest, use black, and coverage. These can be found in `requirements-dev.txt`

```
> py -m pip install -r requirements-dev.txt
```

### Add Libraries and Create a requirements.txt File

After you activate the virtual environment, you can add packages to it using `pip`. You can also create a description of your dependencies using `pip`.
Expand Down
Loading

0 comments on commit 1682946

Please sign in to comment.