Closed evgenyigumnov closed 1 month ago
Create Folder
Create a folder named python.
python
Copy Files
Create copies of prompt.txt inside the python folder.
prompt.txt
rustsn --lang=python
take 2 params and add them and return result
setup.py
from setuptools import setup, find_packages setup( name="solution", version="1.0.0", description="Minimalistic project", packages=find_packages(where='src'), package_dir={"": "src"}, install_requires=[], tests_require=["pytest"], entry_points={ "console_scripts": [ "solution=src.solution:main", ], }, )
requirements.txt
pytest
src/solution.py
def solution(a, b): return a + b
tests/test_solution.py
import pytest from src.solution import solution def test_solution_integers(): assert solution(1, 2) == 3 def test_solution_negatives(): assert solution(-1, -2) == -3 def test_solution_strings(): assert solution('1', '2') == '12'
pip install -r requirements.txt
Python typically doesn't require a compilation step, but if you are packaging the project, you can build it using:
python setup.py build
Run the tests using pytest:
Create Folder
Create a folder named
python
.Copy Files
Create copies of
prompt.txt
inside thepython
folder.Launch Example
Example Query
Example Generation
setup.py
requirements.txt
src/solution.py
tests/test_solution.py
Example Install Dependencies
Example Launch Compilation
Python typically doesn't require a compilation step, but if you are packaging the project, you can build it using:
Example Launch Test
Run the tests using
pytest
: