Giter Club home page Giter Club logo

pythonbase's Introduction

My Module

Intro

Description

This project has been developed using Python 3.10 and Poetry. So, Python 3 and pip3 are required.

Dependencies are managed through the tool poetry that you can install as follows

pip install "poetry"

When you use poetry, you can use all the commands listed in this files following the pattern

poetry run [tool/programa/aplication]

If you run the commands using poetry, it will create a virtualenvironment that poetry will manage trasnparently. But the commands in this file are written taking into account that you are already using virtualenv or conda environments, so poetry doesn't need to create a managed virtualenvironment when it's run inside one of this. Then you can run the commands inside this file without the need to write poetry run

This project uses pre-commit hooks to check code quality and format before it s finally committed to the repository. To configure the pre-commit hooks to evaluate your code, follow this steps:

  1. Install pre-commit utility: pip install pre-commit
  2. Run inside the root directory the following command: pre-commit install
  3. Done

After this setup, black and flake should run before each commit command

git commit -m "example commit"
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
black....................................................................Passed
flake8...................................................................Passed
[master 12a838b] example commit

If you don't follow the style guide, this tools will show warning and they will abort your commit

git commit -m "example commit"
black....................................................................Failed
- hook id: black
- files were modified by this hook

reformatted example_package/common/infraestructure/timescale_engine.py

All done! ✨ 🍰 ✨
1 file reformatted, 3 files left unchanged.

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

example_package/cli.py:12:80: E501 line too long (88 > 79 characters)
example_package/common/infraestructure/timescale_engine.py:10:80: E501 line too long (88 > 79 characters)

The Python version used is Python 3.10.

All the other required python packages may be installed using the command:

poetry install

A new requirement must be added using the command poetry add dependency or editing de file pyproject.toml file.

All the configuration variables are included on .env files. For further information read the related documentation. An example .env file is provided .env.example you can use it as a base .env file if you rename it to .env

# All tests
PYTHONPATH=. pytest ./src/tests

# All tests verbose mode (not encouraged use logging module instead)
PYTHONPATH=. pytest -s --log-cli-level=INFO

# Unit tests
PYTHONPATH=. pytest -s --log-cli-level=INFO src/tests/unit

# Integration tests
PYTHONPATH=. pytest -s --log-cli-level=INFO src/tests/integration

# Validation tests
PYTHONPATH=. pytest -s --log-cli-level=INFO src/tests/validation

To run the command line without installing it, use the following command: python3 -m src.cli --help

Scaffolding

  • mymodule: contiene el desarrollo realizado
  • .github/workflows: contiene los tareas de CI/CD definidas por Gradiant durante la realización del proyecto
  • tools: herramientas y utilidades de cara a ejecutar el servicio

pythonbase's People

Contributors

diegoreico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pythonbase's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.