Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Various tasks, challenges and demo materials for the python training course

License

Notifications You must be signed in to change notification settings

edu-python-course/problem-sets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PYTHON TRAINING COURSE: PROBLEM SETS

pytest sonarcloud

This repository contains various problem sets (aka tasks or challenges) for the Python training course. These challenges will help you to improve your skills in some basic Python topics. Many tasks are collected from authors' interview experience.

Getting started

This section describes the general usage of the project.

Installing dependencies

It's recommended to use poetry with this project. Otherwise you are to do some additional work while installing dependencies and configuring internal packages.

Once you've cloned the repository to your local machine install dependencies:

poetry install

This will also install internal packages for future tests.

PIP support

For whose, who prefer to use pip as a package manager, it's supported. However it's not a primary package manager for this project, so problems may still appear - please, report to bug tracker in case of any.

You will need to install project dependencies and source code. To do this use commands:

pip install -r requirements.txt
pip install -e .

Sometimes, you may get an error while installing the source code. Upgrading pip to the latest version helps for the most of the times.

Code health check

There are few dependencies installed to check the code health:

  • pytest-cov
  • mypy
  • pylint

They are acting as stand-alone commands, available from your terminal with poetry:

poetry run pytest
poetry run mypy
poetry run pylint src

Running tox

tox aims to automate and standardize testing in Python. It is a generic virtualenv management and test command line tool you can use for:

  • checking that your package installs correctly with different Python versions and interpreters
  • running your tests in each of the environments, configuring your test tool of choice
  • acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell-based testing.

It's also include to the project's deps, run it with:

poetry run tox

Project structure

/problem-sets
|-- src/
|-- tests/

There are two major directories: src and tests. Any useful code should be included to the source (src). Test cases for functions, classes etc. should lie inside of tests directory. It's ok to created nested packages within these directories if needed.

Contributing

For more details refer to contributing guide.