Skip to main content

Python

This is a list of best practices to be applied in developments with the goal of increasing the standardization of our code and quality:

  • Handling max login attempts in scraping, with a notify (ex, email) to avoid credential blacklisting and alert users
  • Install private packages trought gitlab registry, avoiding the git+repo@branch form), this is allow correct versioning
  • Network resources (ex. fileserver) could not always be available. On script's startup, test the connectivity, if there's somethings wrong, then send an alert to our team. However, you should save the files locally
  • As documentation, a README file is a description of the development with the POV of a developer, so you have to describe the core mechanism of the script and known errors or bug
  • To prevent the library update from creating a development malfunction, specify in the requirements.txt the version used
  • The core code must be stored in "src" folder, to optimize organization and module importing
  • When a development is ready to be released or have to be updated in remote environments, always write/update a secret note in bitwarden named "env_{COLL/DEV/PROD}_{automation_code}_{automation_name}"
  • Writing unit test to avoid change request/bug resolution/refactor from creating a development malfunction. This can be done easily writing atomic functions and test every core function of the development
  • Package versioning tags are a key to release correct versions for different scopes (ex. 1.0.0.dev, 1.0.0)
  • Store semversioning in developments too, in files like setup.toml, .version and commits. To update new version easly, you can use a tool called bumpversion (this is a guide made by lclementi)
  • Colour formatter