Skip to content

Commit

Permalink
Update Poetry version and dependencies in poetry.lock
Browse files Browse the repository at this point in the history
The update was made from Poetry 1.5.1 to 1.7.1. This also led to the modification of some packages like 'certifi' and 'charset-normalizer', updating their versions and hash values as per the new dependencies.
  • Loading branch information
meanmail committed Jan 14, 2024
1 parent 6614088 commit f5275b3
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 303 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "00:00"
groups:
all-actions:
patterns: [ "*" ]

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "00:00"
29 changes: 18 additions & 11 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
name: Format code
on:
pull_request:
push:
branches:
- 'master'
pull_request:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
cancel-in-progress: false

jobs:
format:
name: Format with black and ruff
name: Format and lint with ruff
runs-on: [self-hosted, small]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: ./.github/workflows/actions/prepare
- run: poetry run black .
- run: poetry run ruff --fix --exit-zero .
- 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:
fetch: false
default_author: github_actions
message: 'Auto format'
add: '.'
add: '*.py'
1 change: 1 addition & 0 deletions .poetry-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.7.1
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.6
4 changes: 2 additions & 2 deletions epicbox/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,12 @@ def truncate_result(result: dict[str, Any]) -> dict[str, Any]:
MAX_OUTPUT_LENGTH = 100
truncated = {}
for k, v in result.items():
if k in ["stdout", "stderr"] and len(v) > MAX_OUTPUT_LENGTH:
if k in {"stdout", "stderr"} and len(v) > MAX_OUTPUT_LENGTH:
truncated[k] = v[:MAX_OUTPUT_LENGTH] + b" *** truncated ***"
else:
truncated[k] = v
return truncated


def is_killed_by_sigkill_or_sigxcpu(status: int) -> bool:
return status - 128 in [signal.SIGKILL, signal.SIGXCPU]
return status - 128 in {signal.SIGKILL, signal.SIGXCPU}
462 changes: 183 additions & 279 deletions poetry.lock

Large diffs are not rendered by default.

38 changes: 29 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,23 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.11"
python = "~3.11"
docker = ">=6.1.3"
python-dateutil = "^2.4"
requests = "^2.31.0"
structlog = ">=23.1.0"

[tool.poetry.group.dev.dependencies]
black = "^23.9.1"
mypy = "^1.5.1"
pytest = "^7.4.2"
ruff = "^0.0.291"
ruff = "^0.1.13"
types-python-dateutil = "^2.8.19.14"
types-requests = "^2.31.0.4"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
target-version = ['py311']

[tool.ruff]
target-version = "py311"

Expand All @@ -44,10 +40,8 @@ ignore = [
"ANN003",
"ANN101",
"ARG001",
"FBT003",
"FBT001",
"FBT002",
"B017",
"COM812",
"CPY001",
"D100",
"D101",
Expand All @@ -57,6 +51,10 @@ ignore = [
"D105",
"D107",
"E203",
"FBT001",
"FBT002",
"FBT003",
"ISC001",
"N806",
"PLR2004",
"PLR6301",
Expand Down Expand Up @@ -133,3 +131,25 @@ warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true

exclude = [
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
4 changes: 2 additions & 2 deletions tests/test_sandboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_run_memory_limit(profile: Profile) -> None:

assert result["oom_killed"] is True
assert result["timeout"] is False
assert result["exit_code"] not in [None, 0]
assert result["exit_code"] not in {None, 0}


@pytest.mark.skipif(
Expand All @@ -288,7 +288,7 @@ def test_run_file_size_limit(profile: Profile) -> None:
def test_run_read_only_file_system(profile_read_only: Profile) -> None:
result = run(profile_read_only.name, "touch /tmp/file")

assert result["exit_code"] not in [None, 0]
assert result["exit_code"] not in {None, 0}
assert b"Read-only file system" in result["stderr"]


Expand Down

0 comments on commit f5275b3

Please sign in to comment.