Contributing to py-linq-sql

First thanks for contributing.

The following explains how to contribute to the project.

Table of Content

What do you need to install py-linq-sql on your computer

What version of python

py-linq-sql use the python version 3.10. To install this version use:

sudo apt install python3.10

Verify the version.

$ python3 --version
Python 3.10.0

Dependencies

py-linq-sql use some dependencies:

and some dependencies for the development:

Install procedure for the dependencies

You only need the classic dependencies to use py-linq-sql, they are all available on Pypi.

To install the dependencies you need poetry and just

just install

Or you can directly use poetry:

poetry install --no-dev --remove-untracked

Install procedure for development dependencies

You need to install all this package to contribute to the project, they are all available on Pypi.

To install the dependencies you need poetry and just

just install-all

Or you can directly use poetry (and npm for markdownlint)

poetry install --remove-untracked
sudo npm install
sudo npm install markdownlint-cli2 --global

Project structure

py-linq-sql is structured with 2 principal folders;

  • py-linq-sql
  • tests

py-linq-sql contains all the code of the library separate into different folders to find your way around the code.

tests contains all tests for the library (more than 1200).

How to

How to use tests

To launch test you can use the alias just:

just pytest

If all goes well you should have something like this:

Tests

How to report a bug

This section guides you through submitting a bug report for py-linq-sql. Before reporting check the issues and CHANGELOG.md as you might find out that you don't need to create one. If there is no trace of this bug create a issue here following the template, please include as many details as possible.

How to submit changes or enhancements

This section guides you through submitting changes or enhancements for py-linq-sql. Before proposing changes or enhancements check the issues and CHANGELOG.md as you might find out that you don't need to create one. If the enhancement or change has never been proposed create a issue here following the template, please include as many details as possible.

How to Merge Request

This section guides you to summit a merge request for py-linq-sql. Before create a merge request make sure you respond to an issue or have opened one. Please follow these steps to have your contribution considered by the maintainers:

  1. Follow all instructions in the template
  2. Follow the style guides

Pre-commit

py-linq-sql use pre-commit before commit and merge. Pre-commit is a git hook scripts are useful for identifying simple issues before submission to code review. You must install pre-commit before commit on the git.

just preinstall

Style Guide

py-linq-sql use some formatter and linter to improve understanding of the code by other developers.

Formatter

You can run all formatter on all code and test files with:

just onmy31

Black

Black is a formatter to save time and mental energy for more important matters. Black is run by pre-commit but you can run it manually.

black #filename

black documentation

Isort

Isort is a formatter to sort imports alphabetically, and automatically separated into sections and by type. Isort is run by pre-commit but you can run it manually.

isort #filename

isort documentation

Linter

You can run all linter on code with:

just lint

Pydocstyle

Pydocstyle is a linter for checking compliance with Python docstring conventions. Pydocstyle is run by pre-commit but you can run it manually.

just pydocstyle #path

or with just on all code with:

just pydocstyle

Pydocstyle documentation

Mypy

Mypy is a static type checker for Python. Mypy is run by pre-commit but you can run it manually.

just mypy

Mypy documentation

Pylint

Pylint is a static code analyse for Python. Pylint is run by pre-commit but you can run it manually.

just pylint #path

or with just on all code with:

just pylint

Pylint documentation

For more information on pylint errors you can use plerr with error code.

plerr W013

Flake8

Flake8 us a wrapper of PyFlakes, pycodestyle and 'Ned Batchelder’s McCabe script'. Flake8 is run by pre-commit.

Flake8 documentation

Flakehell

Flakehell is an evolved version of flake8. Flakehell is run by pre-commit but you can run it manually.

just flakehell #path

or with just on all code with:

just flakhell

Flakehell documentation

Contacts

  • Author: Ulysse CHOSSON (LESIA)
  • Maintainer: Ulysse CHOSSON (LESIA)
  • Email: ulysse.chosson@obspm.fr
  • Contributors:
    • Pierre-Yves MARTIN (LESIA)