A software to help manage servicing of cars at Lyft.
- Python programming language, typing in Python, OOP python and Python modules.
- Test Driven Development (TDD), Unit testing.
- Python virtual environment.
- Linting; autopep8, pycodestyle.
- UML diagrams using draw.io.
- Version control using Git and Github.
Below are the design patterns used for the project.
Factory Method is a creational design pattern that provides an interface for creating objects in a superclass, but allows subclasses to alter the type of objects that will be created.
Strategy is a behavioral design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
# Install pycodestyle.
pip install pycodestyle
# Confirm install.
pycodestyle --version
# Lint file.
pycodestyle <FILE>
# Lint a file.
autopep8 --in-place <FILE>
autopep8 --in-place tests/test_engines/test_capulet_engine.py
# Lint all files in folder.
autopep8 --in-place --recursive <FOLDER>/*
autopep8 --in-place --recursive tests/*
# Lint all files in project.
autopep8 --in-place --recursive .
# Check typing for a file.
mypy <PYTHON_FILE>
mypy tests/test_engines/test_capulet_engine.py
mypy tests
# Check typing for all files.
mypy .
# Run all tests in test directory.
python3 -m unittest discover tests
# Generate requirements file.
pip freeze > requirements.txt
# Install all packages in requirements file.
pip install -r requirements.txt
A tool for creating isolated virtual python environments.
# Install virtualenv in ubuntu.
sudo apt install python3-venv
# Confirm installation of virtualenv
python3 -m venv --help
# Create a new virtual environment called venv
python -m venv venv
python3 -m venv venv
# Activate virtual environment.
source venv/bin/activate
#Deactivate virtual environment.
Deactivate
https://pypi.org/project/virtualenv/
A tool to check Python code against some of the style conventions in PEP 8.
# Install pycodestyle.
pip install pycodestyle
# Confirm install.
pycodestyle --version
# Lint a file.
pycodestyle <FILE>
https://pypi.org/project/pycodestyle/
Automatically formats Python code to conform to the PEP 8 style guide. I
# Install pycodestyle.
pip install --upgrade autopep8
# Confirm install.
autopep8 --version
# Lint a file.
autopep8 --in-place <FILE>
autopep8 --in-place tests/test_engines/test_capulet_engine.py
# Lint all files in folder.
autopep8 --in-place --recursive <FOLDER>/*
autopep8 --in-place --recursive tests/*
# Lint all files in project.
autopep8 --in-place --recursive .
https://pypi.org/project/pycodestyle/
A tool to check type annotations for Python programs.
# Install pycodestyle.
pip install mypy
# Confirm install.
mypy --version
# Lint all files.
autopep8 --in-place --recursive battery/ engine/ tires/ car.py car_factory.py serviceable_interface.py
mypy battery/ engine/ tires/ car.py car_factory.py serviceable_interface.py
# Check tests.
python3 -m unittest discover tests
mypy tests
autopep8 --in-place --recursive tests/*
# Check batteries.
autopep8 --in-place --recursive battery/*
mypy battery
# Check tires.
autopep8 --in-place --recursive tires/*
mypy tires