Skip to content

Commit

Permalink
Refactor code and update GitHub actions
Browse files Browse the repository at this point in the history
Rearranged the order of functions in the sandboxes.py file and added a comment in the test_sandboxes.py file. The Github actions workflow auto-format.yml has also been updated to include more steps like installing Poetry, setting up python, installing dependencies, and formatting and linting the code.
  • Loading branch information
meanmail committed May 27, 2024
1 parent c2fba1d commit 69a5a89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Install Poetry
run: pipx install poetry==$(head -n 1 .poetry-version)

- uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
cache: 'poetry'

- name: Install dependencies
run: poetry install --no-interaction --no-ansi --no-root

- name: Check files using the ruff formatter
run: poetry run ruff format

- name: Check files using the ruff linter
run: poetry run ruff --fix --unsafe-fixes --preview --exit-zero .

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
Expand Down
2 changes: 1 addition & 1 deletion epicbox/sandboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from docker.models.containers import Container
from docker.models.images import Image

__all__ = ["create", "start", "destroy", "run", "working_directory"]
__all__ = ["create", "destroy", "run", "start", "working_directory"]

logger = structlog.get_logger()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_sandboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from epicbox import config, Profile, utils
from epicbox.exceptions import DockerError
from epicbox.sandboxes import (
_write_files,
_write_files, # noqa: PLC2701
create,
destroy,
run,
Expand Down

0 comments on commit 69a5a89

Please sign in to comment.