From 7fc3e6f5274970617d07933638a2758bc53d8297 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Wed, 2 Apr 2025 20:54:05 +0530 Subject: [PATCH 1/3] feat: add Dockerfile for Python 3.13 with Pipenv setup --- dockerfiles/python-3.13.Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dockerfiles/python-3.13.Dockerfile diff --git a/dockerfiles/python-3.13.Dockerfile b/dockerfiles/python-3.13.Dockerfile new file mode 100644 index 00000000..4573a16c --- /dev/null +++ b/dockerfiles/python-3.13.Dockerfile @@ -0,0 +1,20 @@ +FROM python:3.13-alpine + +# We need to install Go to build the custom executable. +RUN apk add --no-cache "go>=1.20" + +RUN pip install --no-cache-dir "pipenv>=2024.4.0" + +COPY Pipfile /app/Pipfile +COPY Pipfile.lock /app/Pipfile.lock + +WORKDIR /app + +ENV WORKON_HOME=/venvs + +RUN pipenv install + +# Force environment creation +RUN pipenv run python3 -c "1+1" + +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Pipfile,Pipfile.lock" \ No newline at end of file From 593c6f18862aec42d2a4bd0c411a6a7e60673399 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Wed, 2 Apr 2025 20:54:09 +0530 Subject: [PATCH 2/3] feat: update Python version to 3.13 in configuration and documentation files --- compiled_starters/python/README.md | 2 +- compiled_starters/python/codecrafters.yml | 4 +-- solutions/python/01-oo8/code/README.md | 2 +- solutions/python/01-oo8/code/codecrafters.yml | 4 +-- solutions/python/02-cz2/code/codecrafters.yml | 4 +-- solutions/python/02-cz2/diff/README.md.diff | 32 +++++++++++++++++++ starter_templates/python/config.yml | 2 +- 7 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 solutions/python/02-cz2/diff/README.md.diff diff --git a/compiled_starters/python/README.md b/compiled_starters/python/README.md index bd69d05f..afccaba1 100644 --- a/compiled_starters/python/README.md +++ b/compiled_starters/python/README.md @@ -27,7 +27,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `python (3.11)` installed locally +1. Ensure you have `python (3.13)` installed locally 1. Run `./your_program.sh` to run your program, which is implemented in `app/main.py`. 1. Commit your changes and run `git push origin master` to submit your solution diff --git a/compiled_starters/python/codecrafters.yml b/compiled_starters/python/codecrafters.yml index ec2956e1..0e019626 100644 --- a/compiled_starters/python/codecrafters.yml +++ b/compiled_starters/python/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Python version used to run your code # on Codecrafters. # -# Available versions: python-3.12 -language_pack: python-3.12 +# Available versions: python-3.13 +language_pack: python-3.13 diff --git a/solutions/python/01-oo8/code/README.md b/solutions/python/01-oo8/code/README.md index bd69d05f..afccaba1 100644 --- a/solutions/python/01-oo8/code/README.md +++ b/solutions/python/01-oo8/code/README.md @@ -27,7 +27,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `python (3.11)` installed locally +1. Ensure you have `python (3.13)` installed locally 1. Run `./your_program.sh` to run your program, which is implemented in `app/main.py`. 1. Commit your changes and run `git push origin master` to submit your solution diff --git a/solutions/python/01-oo8/code/codecrafters.yml b/solutions/python/01-oo8/code/codecrafters.yml index ec2956e1..0e019626 100644 --- a/solutions/python/01-oo8/code/codecrafters.yml +++ b/solutions/python/01-oo8/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Python version used to run your code # on Codecrafters. # -# Available versions: python-3.12 -language_pack: python-3.12 +# Available versions: python-3.13 +language_pack: python-3.13 diff --git a/solutions/python/02-cz2/code/codecrafters.yml b/solutions/python/02-cz2/code/codecrafters.yml index ec2956e1..0e019626 100644 --- a/solutions/python/02-cz2/code/codecrafters.yml +++ b/solutions/python/02-cz2/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Python version used to run your code # on Codecrafters. # -# Available versions: python-3.12 -language_pack: python-3.12 +# Available versions: python-3.13 +language_pack: python-3.13 diff --git a/solutions/python/02-cz2/diff/README.md.diff b/solutions/python/02-cz2/diff/README.md.diff new file mode 100644 index 00000000..8733cd6c --- /dev/null +++ b/solutions/python/02-cz2/diff/README.md.diff @@ -0,0 +1,32 @@ +@@ -5,30 +5,30 @@ + + In this challenge, you'll build your own POSIX compliant shell that's capable of + interpreting shell commands, running external programs and builtin commands like + cd, pwd, echo and more. Along the way, you'll learn about shell command parsing, + REPLs, builtin commands, and more. + + **Note**: If you're viewing this repo on GitHub, head over to + [codecrafters.io](https://codecrafters.io) to try the challenge. + + # Passing the first stage + + The entry point for your `shell` implementation is in `app/main.py`. Study and + uncomment the relevant code, and push your changes to pass the first stage: + + ```sh + git commit -am "pass 1st stage" # any msg + git push origin master + ``` + + Time to move on to the next stage! + + # Stage 2 & beyond + + Note: This section is for stages 2 and beyond. + +-1. Ensure you have `python (3.13)` installed locally ++1. Ensure you have `python (3.11)` installed locally + 1. Run `./your_program.sh` to run your program, which is implemented in + `app/main.py`. + 1. Commit your changes and run `git push origin master` to submit your solution + to CodeCrafters. Test output will be streamed to your terminal. diff --git a/starter_templates/python/config.yml b/starter_templates/python/config.yml index 3da15320..22a03709 100644 --- a/starter_templates/python/config.yml +++ b/starter_templates/python/config.yml @@ -1,3 +1,3 @@ attributes: - required_executable: python (3.11) + required_executable: python (3.13) user_editable_file: app/main.py From 0df39662575116a89ee3e82b0bea851a4a367828 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Wed, 2 Apr 2025 21:05:58 +0530 Subject: [PATCH 3/3] fix: update Python version in README to 3.13 --- solutions/python/02-cz2/code/README.md | 2 +- solutions/python/02-cz2/diff/README.md.diff | 32 --------------------- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 solutions/python/02-cz2/diff/README.md.diff diff --git a/solutions/python/02-cz2/code/README.md b/solutions/python/02-cz2/code/README.md index bd69d05f..afccaba1 100644 --- a/solutions/python/02-cz2/code/README.md +++ b/solutions/python/02-cz2/code/README.md @@ -27,7 +27,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `python (3.11)` installed locally +1. Ensure you have `python (3.13)` installed locally 1. Run `./your_program.sh` to run your program, which is implemented in `app/main.py`. 1. Commit your changes and run `git push origin master` to submit your solution diff --git a/solutions/python/02-cz2/diff/README.md.diff b/solutions/python/02-cz2/diff/README.md.diff deleted file mode 100644 index 8733cd6c..00000000 --- a/solutions/python/02-cz2/diff/README.md.diff +++ /dev/null @@ -1,32 +0,0 @@ -@@ -5,30 +5,30 @@ - - In this challenge, you'll build your own POSIX compliant shell that's capable of - interpreting shell commands, running external programs and builtin commands like - cd, pwd, echo and more. Along the way, you'll learn about shell command parsing, - REPLs, builtin commands, and more. - - **Note**: If you're viewing this repo on GitHub, head over to - [codecrafters.io](https://codecrafters.io) to try the challenge. - - # Passing the first stage - - The entry point for your `shell` implementation is in `app/main.py`. Study and - uncomment the relevant code, and push your changes to pass the first stage: - - ```sh - git commit -am "pass 1st stage" # any msg - git push origin master - ``` - - Time to move on to the next stage! - - # Stage 2 & beyond - - Note: This section is for stages 2 and beyond. - --1. Ensure you have `python (3.13)` installed locally -+1. Ensure you have `python (3.11)` installed locally - 1. Run `./your_program.sh` to run your program, which is implemented in - `app/main.py`. - 1. Commit your changes and run `git push origin master` to submit your solution - to CodeCrafters. Test output will be streamed to your terminal.