Skip to content

Commit 3af09db

Browse files
committed
move to uv/ruff
Signed-off-by: Kirill Mokevnin <[email protected]>
1 parent 710515d commit 3af09db

File tree

110 files changed

+319
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+319
-207
lines changed

Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
FROM hexletbasics/base-image
22

3-
RUN apt update && apt install -y python3-venv python3-pytest python3-pip
3+
# Install pipx using apt to avoid externally-managed Python issues
4+
RUN apt-get update && apt-get install -y pipx \
5+
&& pipx ensurepath \
6+
&& apt-get clean \
7+
&& rm -rf /var/lib/apt/lists/*
48

5-
RUN pip3 install --break-system-package flake8
9+
# Update PATH
10+
ENV PATH="/root/.local/bin:${PATH}"
11+
ENV PATH="/exercises-python/bin:${PATH}"
612

7-
RUN python3 -m venv /exercises-python/venv
8-
RUN /exercises-python/venv/bin/pip install --upgrade pip
13+
RUN pipx install uv
14+
15+
ENV UV_PROJECT_ENVIRONMENT=/usr
916

1017
WORKDIR /exercises-python
1118

19+
COPY pyproject.toml uv.lock ./
20+
21+
RUN uv sync --locked
22+
1223
COPY . .
1324

1425
ENV PYTHONPATH=/exercises-python/src
15-
16-
ENV PATH=/exercises-python/bin:$PATH

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ compose-code-lint:
2828
docker compose run exercises make code-lint
2929

3030
code-lint:
31-
flake8 modules
31+
ruff check
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
print('Hello, World!')
1+
print("Hello, World!")

modules/10-basics/10-hello-world/test_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
def test(capsys):
5-
expected = 'Hello, World!'
5+
expected = "Hello, World!"
66
expect_output(capsys, expected)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def test():
2-
with open('index.py') as file:
2+
with open("index.py") as file:
33
comment = file.read().rstrip()
4-
assert comment == '# You know nothing, Jon Snow!'
4+
assert comment == "# You know nothing, Jon Snow!"
55
print(comment)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
print('Robert')
2-
print('Stannis')
3-
print('Renly')
1+
print("Robert")
2+
print("Stannis")
3+
print("Renly")

modules/10-basics/30-instructions/test_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
def test(capsys):
5-
expected = 'Robert\nStannis\nRenly'
5+
expected = "Robert\nStannis\nRenly"
66
expect_output(capsys, expected)

modules/10-basics/40-testing/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
print('9780262531962')
1+
print("9780262531962")

modules/10-basics/40-testing/test_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
def test(capsys):
5-
expected = '9780262531962'
5+
expected = "9780262531962"
66
expect_output(capsys, expected)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
print('What Is Dead May Never Die')
1+
print("What Is Dead May Never Die")

0 commit comments

Comments
 (0)