Skip to content

Add Python as a language #7

Merged
ranuru merged 11 commits into
developmentfrom
feature/languages
May 7, 2026
Merged

Add Python as a language #7
ranuru merged 11 commits into
developmentfrom
feature/languages

Conversation

@ranuru

@ranuru ranuru commented May 7, 2026

Copy link
Copy Markdown
Owner

This pull request introduces support for Python challenge variants alongside the existing JavaScript ones. The main changes include adding a Python code runner as a new service, updating the backend and frontend to handle multi-language support, and seeding the database with Python variants for all challenges. The frontend now allows users to select between JavaScript and Python for each challenge, and the backend is updated to serve and process these variants.

Multi-language challenge support:

  • Added a new ChallengeVariant entity and repository to support multiple language variants (e.g., Python) for each challenge, including fields for starter code and harness templates. [1] [2]
  • Updated the Challenge model to include a list of ChallengeVariant objects, and refactored data seeding to add Python variants for all challenges using appropriate harness templates and starter code. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Python runner service:

  • Added a new runner service (Dockerized Flask app) that safely executes submitted Python code in a sandboxed environment, receiving code and input via HTTP and returning results as JSON. [1] [2] [3]
  • Updated docker-compose.yml and frontend Nginx config to include and route requests to the new runner service. [1] [2]

Frontend enhancements:

  • Updated the challenge page to allow users to select the language (JavaScript or Python) for each challenge, dynamically loading the appropriate starter code and sending code to the correct backend (web worker for JS, runner service for Python). [1] [2] [3]
  • Improved deep equality checking for test results by sorting object keys before comparison, ensuring consistent results across languages.

These changes collectively enable users to solve challenges in either JavaScript or Python, with full backend and frontend support for both languages.

@ranuru ranuru self-assigned this May 7, 2026
@ranuru ranuru added the enhancement New feature or request label May 7, 2026
@ranuru ranuru linked an issue May 7, 2026 that may be closed by this pull request
@ranuru ranuru merged commit 1ff1ce1 into development May 7, 2026
2 checks passed
@ranuru ranuru deleted the feature/languages branch May 7, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature/add python

1 participant