Skip to content
 
 

Latest commit

 

History

252 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements Status Build Status

codewars

Codewars Kata Python solutions

Project Structure

  • python2 - Python 2 katas
  • python3 - Python 3 katas
  • tests - tests for both language version katas and utils
  • utils - simple scripts I wrote to handle the project routines

Prerequisites

  • Old katas use Python 2, new katas - Python 3
  • Requirements: pip install -r requirements.txt (virtual environment is strongly suggested)

System Variables

Utilities and utility tests requires Codewars API key. Store it inside utils/envs.py:

touch utils/envs.py
echo "ACCESS_KEY='<your_api_key>'" > utils/envs.py

Tests

I use pytest to run test suit. Unfortunately it's impossible to switch to nose or unittest because pytest syntax is heavily used (fixtures, parametrization and so on). Still you can freely write unittest-style tests if needed - pytest understands it correctly. Flag --doctest-modules is also used to analyze doctests (there're few here and there).

For syntax style validation pylint is used.

Language version will be auto selected according to active virtual environment.

Unit and Doc Tests

invoke test

Syntax Validation

invoke syntax

Utils

Active

  • invoke new <slug> - creates new solution and test files depends on the given kata slug (uses jinja2 and codewars API), for example: invoke new hello-world will be call codewars API to provide a description and difficulty level for the hello-world kata (you can check kata's slug in it's url). In case of success - hello_world.py and test_hello_world.py will be created in the corresponding folders (according to active Python version and kata difficulty level).

Dated

  • invoke update - updates dependencies of Python 2 and Python 3 pyenv virtual environments (codewars2 and codewars3).
  • invoke sort - was used to sort old kata files depends on the language version (uses codewars API and concurrent.futures for performance)

Contribution

All contributions are warmly welcomed! I would love to see better solutions, solutions to missing katas, error fixes, new automation scripts or additional docs. Please, do not hesitate if you consider your skill to be not that good, I'm also not a Senior Developer you know 😏 At least we would have a nice discussion in your pull request! 😊

Contacts

Feel free to contact me if you have any questions, problems with this repository or suggestions, I would love to help! 😎

About

Codewars Python solutions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages