Skip to content
Snippets Groups Projects
Select Git revision
  • 8a452189e6f4897032015031e0d9f52eacd9aba8
  • main default protected
2 results

example-repository-stable

  • Open with
  • Download source code
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • user avatar
    Felipe Delestro Matos authored
    8a452189
    History
    Name Last commit Last update
    qimex
    tests
    .gitignore
    .gitlab-ci.yml
    LICENSE
    README.md

    Example repository

    This is an example repository of how Python projects should be organized as at QIM.

    File structure

    On the root of the repository, at minimum you should have:

    • README.md
    • LICENSE
    • .gitignore file (you can use the one from here as a base template)
    • A single project_name directory that contains all the main code
    • requirements.txt (for the pip requirements)

    Depending on your project, you might also have:

    • .gitlab-ci.yml for the CI/CD pipeline

    Code directory

    Use a simple but meaningful name, as this is the name you're project is going to be imported in case it is packed as a library.

    Here we use qimex as in QIM Example

    Remember to have a __init__.py file in your directory, so that it can be imported as a library. The file can be empty.

    Coding guidelines

    Details of the coding guidelines can be found at the QIM Gitlab Wiki

    In summary:

    • Use Google style for docstrings.
    • Raise errors when necessary.
    • Avoid large files.

    Testing

    We should use pytest to manage unit testing of the repository.

    All tests should be inside a testsdirectory at the root of the repository.