Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py 3.13 rc #217

Merged
merged 7 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
name: coverage-${{ matrix.os }}
path: .coverage.*
retention-days: 1
include-hidden-files: true

report:
name: Report coverage
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ RUN apt-get -y update \
tk-dev \
&& rm -rf /var/lib/apt/lists/*

RUN git clone -b v2.4.14 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent change!


COPY --link scripts/build_python.sh /

# ------------------------------------------------------------------------------
FROM builder-py-base as builder-py-3_12
RUN git clone -b v2.4.10 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT \
&& /build_python.sh 3.12.5
RUN /build_python.sh 3.12.5
# ------------------------------------------------------------------------------
FROM builder-py-base as builder-py-3_13
RUN /build_python.sh 3.13.0rc3
# ------------------------------------------------------------------------------
FROM python:3.12-slim-bookworm as base

Expand All @@ -51,6 +55,7 @@ RUN apt-get -y update \

COPY --link --from=builder-nsjail /nsjail/nsjail /usr/sbin/
COPY --link --from=builder-py-3_12 /lang/ /lang/
COPY --link --from=builder-py-3_13 /lang/ /lang/

RUN chmod +x /usr/sbin/nsjail \
&& ln -s /lang/python/3.12/ /lang/python/default
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.7"

services:
snekbox:
container_name: snekbox_dev
Expand Down
22 changes: 11 additions & 11 deletions requirements/eval-deps.pip
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
anyio[trio]~=4.4
anyio[trio]~=4.6
arrow~=1.3
attrs~=24.2
beautifulsoup4~=4.12
einspect~=0.5 ; python_version == '3.12'
fishhook~=0.3
fishhook~=0.3; python_version == '3.12'
forbiddenfruit~=0.1
fuzzywuzzy~=0.18
lark~=1.2
matplotlib~=3.9 ; python_version == '3.12'
more-itertools~=10.4
matplotlib~=3.9
more-itertools~=10.5
networkx~=3.3
numpy~=2.1 ; python_version == '3.12'
pandas~=2.2 ; python_version == '3.12'
pendulum~=3.0
pyarrow~=17.0
numpy~=2.1
pandas~=2.2
pendulum~=3.0 ; python_version == '3.12'
pyarrow~=17.0; python_version == '3.12'
python-dateutil~=2.9
pyyaml~=6.0
scipy~=1.14 ; python_version == '3.12'
scipy~=1.14
sympy~=1.13
typing-extensions~=4.12
tzdata~=2024.1
yarl~=1.9
tzdata~=2024.2
yarl~=1.13
10 changes: 8 additions & 2 deletions snekbox/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ def parse_args() -> argparse.Namespace:
)
parser.add_argument("code", help="the Python code to evaluate")
parser.add_argument(
"nsjail_args", nargs="?", default=[], help="override configured NsJail options"
"nsjail_args",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a sample of what the help output is after this change?

Copy link
Member Author

@ChrisLovering ChrisLovering Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, the reason I added the default to the help kwarg directly is because it didn't get added automatically.

❯ python3 -m snekbox --help
usage: snekbox [-h] code [nsjail_args ...] [--- py_args ...]

positional arguments:
  code         the Python code to evaluate
  nsjail_args  override configured NsJail options (default: [])
  py_args      arguments to pass to the Python process (default: ['-c'])

options:
  -h, --help   show this help message and exit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - that still looks helpful

action="store_const",
const=[],
help="override configured NsJail options (default: [])",
)
parser.add_argument(
"py_args", nargs="?", default=["-c"], help="arguments to pass to the Python process"
"py_args",
action="store_const",
const=["-c"],
help="arguments to pass to the Python process (default: ['-c'])",
)

# nsjail_args and py_args are just dummies for documentation purposes.
Expand Down