Contributing to py-linq-sql
First thanks for contributing.
The following explains how to contribute to the project.
Table of Content
- Contributing to py-linq-sql
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:
- pytest
- pytest-sugar
- pytest-pudb
- pytest-postgresql
- pytest-cov
- xdoctest
- tmp-connection-psql
- psycopg-pool
- mpmath
- numpy
- assertpy
- strenum
- pre-commit
- black
- isort
- mypy
- ruff
- sniffio
- sqlfluff
- dlint
- bandit
- import-linter
- codespell
- mkdocs
- mkdocstrings
- Pygments
- mkdocs-autorefs
- mdx_truly_sane_lists
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:
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:
- Follow all instructions in the template
- 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
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
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
Mypy
Mypy is a static type checker for Python. Mypy is run by pre-commit but you can run it manually.
just mypy
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
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.
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
Contacts
- Author: Ulysse CHOSSON (LESIA)
- Maintainer: Ulysse CHOSSON (LESIA)
- Email: ulysse.chosson@obspm.fr
- Contributors:
- Pierre-Yves MARTIN (LESIA)