Skip to content

Installation

Iván Andrés L. edited this page Dec 16, 2024 · 8 revisions

We welcome contributions to this project! Follow these steps to contribute:

Clone the repository and install the required dependencies:

git clone https://github.com/andrextor/python-checkout.git
cd python-checkout

Install Poetry

Ensure Poetry is installed on your system:

curl -sSL https://install.python-poetry.org | python3 -

Install Dependencies

Install the required dependencies using Poetry:

poetry install --no-root

Activate the Development Environment

By default, Poetry creates virtual environments in a central location: ~/.cache/pypoetry/virtualenvs/

If you prefer project-specific environments (e.g., ./.venv), configure Poetry to do so:

poetry config virtualenvs.in-project true
poetry shell

Running Tests

To run tests and check coverage:

poetry run pytest --cov=checkout --cov-report=html

Code Formatting and Linting

Use the following commands to ensure your code adheres to the project’s style guidelines:

poetry run black .
poetry run flake8
poetry run isort .

Type Checking

Run type checks using mypy:

poetry run mypy src

Adding Dependencies

To add new dependencies:

poetry add <package_name>

Development dependencies:

poetry add --group dev <package_name>

Project Structure

The project is organized as follows:

  • entities: Core models like Settings, Authentication, and payment-related entities (Amount, Transaction, etc.).
  • messages: Handles request and response objects for PlaceToPay interactions.
  • exceptions: Custom exception handling for the library.
  • clients: HTTP client interactions, including RestCarrier.
  • contracts: Interfaces for reusable components.
  • tests: Unit tests to ensure the library’s functionality.

Contribution