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 tests
directory at the root of the repository.