Skip to content

Commit a4256dc

Browse files
authored
Merge pull request #177 from codecrafters-io/andy/upgrade-python
CC-2005: [grep] [Python] Use uv and upgrade to 3.14
2 parents 620ca05 + 551f1c3 commit a4256dc

File tree

29 files changed

+139
-172
lines changed

29 files changed

+139
-172
lines changed

compiled_starters/python/.codecrafters/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec pipenv run python3 -m app.main "$@"
11+
exec uv run --quiet -m app.main "$@"

compiled_starters/python/.gitignore

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ ipython_config.py
9494
# install all needed dependencies.
9595
#Pipfile.lock
9696

97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
97103
# poetry
98104
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99105
# This is especially recommended for binary packages to ensure reproducibility, and is more
@@ -106,8 +112,10 @@ ipython_config.py
106112
#pdm.lock
107113
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108114
# in version control.
109-
# https://pdm.fming.dev/#use-with-ide
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110116
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
111119

112120
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113121
__pypackages__/
@@ -151,3 +159,16 @@ dmypy.json
151159

152160
# Cython debug symbols
153161
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
.idea/
169+
170+
# Ruff stuff:
171+
.ruff_cache/
172+
173+
# PyPI configuration file
174+
.pypirc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.14

compiled_starters/python/Pipfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

compiled_starters/python/Pipfile.lock

Lines changed: 0 additions & 37 deletions
This file was deleted.

compiled_starters/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Time to move on to the next stage!
3131

3232
Note: This section is for stages 2 and beyond.
3333

34-
1. Ensure you have `python (3.13)` installed locally
34+
1. Ensure you have `uv` installed locally
3535
1. Run `./your_program.sh` to run your program, which is implemented in
3636
`app/main.py`.
3737
1. Commit your changes and run `git push origin master` to submit your solution

compiled_starters/python/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Python version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: python-3.13
11-
buildpack: python-3.13
10+
# Available versions: python-3.14
11+
buildpack: python-3.14
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[project]
2+
name = "codecrafters-grep"
3+
version = "0.1.0"
4+
requires-python = ">=3.14"
5+
dependencies = []

compiled_starters/python/uv.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiled_starters/python/your_program.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ set -e # Exit early if any commands fail
1212
#
1313
# - Edit this to change how your program runs locally
1414
# - Edit .codecrafters/run.sh to change how your program runs remotely
15-
exec pipenv run python3 -m app.main "$@"
15+
exec uv run --quiet -m app.main "$@"

0 commit comments

Comments
 (0)