- Clone this repository:
git clone git@github.com:merixstudio/simple-storage.git
- Enter the
simple-storagedirectory:cd simple-storage/ - Create a virtual environment
virtualenv .venv
- Activate the virtual environment you just created.
source .venv/bin/activate - Having the virtual environment activated, install required dependencies:
pip install mypy flake8 pytest pytest-cov pytest-xdist boto3 google-cloud-storage
- Set all the required environment variables:
export STORAGES_BACKEND=storages.backends.file_system.FileSystemStorage export STORAGES_PATH=. export STORAGES_AWS_ACCESS_KEY_ID=YOURAWSACCESSKEYID export STORAGES_AWS_SECRET_ACCESS_KEY=YOURAWSSECRETACCESSKEY export STORAGES_AWS_BUCKET_NAME=your-bucket-name export STORAGES_GOOGLE_CLOUD_CREDENTIALS=your-google-cloud-storage-credentials export STORAGES_GOOGLE_CLOUD_BUCKET_NAME=your-google-cloud-bucket-name
To run the tests simply execute the following command:
pytest -n 5 --cov=storagesNote: tests are being run in parallel using pytest-xdist package. The
-n 5parameter tells thepytest-xdistpackage how many workers should be spawned to run the tests.
Additionally, a test coverage report would be generated (--cov=storages argument).
We are aiming to maintain the 100% test coverage of this package.
- We expect you to create a branch per each new feature / bugfix.
- We are not enforcing any specific branch naming convention.
- Write the code.
- Auto-format the code using
blackandisort:black storages/ isort storages/
- Make sure that
flake8andmypydon't report any problems:flake8 storages/ mypy storages/
- Run the tests and make sure that you've got 100% test coverage:
pytest -n 5 --cov=storages
Note: Each time you push new code to the repository a GitHub Action called
Lint and testwill be triggered. This action will run tests and lint your code, no surprises here 😉.If the linting process fails or tests wouldn't pass the whole build will fail, so please remember to go through the steps 1-3 and make sure that no problems are being reported to avoid these sad ❌ symbols next to your build.
- Make sure that you've maintained the 100% test coverage of the codebase.
- Make sure you've updated the
README.mdfile if there are any changes in that may make theREADME.mdfile obsolete.
- We expect you to be as descriptive as possible when creating a pull request.
- Please include the following information:
- what feature is being added and what was the reasoning
- which issues does this pull request refer to (if applicable)
- The target branch for merging any new feature should be
staging. - Remember to mark the Pull Request with a proper label.
Thank you for your contributions! 😁