Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

fixtup-minio-s3

ci

NOT READY YET, WORK IN PROGRESS !!!

The fixtup-minio-s3 plugin allows you to download the files of a fixture into an s3 bucket managed by minio and run the integration tests on an s3 bucket.

The plugin also allows you to manage the life cycle of the bucket on which the files are loaded by recreating it between each test or by emptying it between each test.

tests/integrations/test_s3_sdk.py

import fixtup

with fixtup.up('minio'), \
    fixtup.up('s3_content'):
    # the files are loaded into the s3 bucket
    # the integration tests are running

Once the plugin is installed and activated in fixtup, we declare the minio.yml manifest in a fixture so that it loads the files into an s3 bucket when launched.

tests/fixtures/s3_content/minio.yml

minio_endpoint: http://localhost:9000 # [optional], default : http://localhost:9000
authentification: minioadmin:minioadmin # [optional], default : minioadmin:minioadmin
bucket: bucket # [optional], default : bucket
setup_data_bucket_policy: new_bucket | clear_bucket | none # [optional], default : new_bucket
copy_ignore: [] # [optional], default : []

it is possible to exclude files from copying to the s3 bucket using the copy_ignore parameter

copy_ignore:
  - 'file.svg'
  - '**/*.svg'

Links

The latest version

You can find the latest version to ...

git clone https://github.com/FabienArcellier/fixtup-minio-s3.git

Usage

The minio fixture starts a minio server using docker-compose. The s3_content fixture creates the bucket if it is absent and copies the fixture files into the bucket.

import fixtup

with fixtup.up('minio'), \
    fixtup.up('s3_content'):
    # the files are loaded into the s3 bucket
    # the integration tests are running
    pass

test/fixtures/minio/docker-compose.yml

version: '3.8'
services:
  database:
    image: quay.io/minio/minio
    command: server /data
    ports:
      - 9000:9000
      - 9001:9001

test/fixtures/s3_content/minio.yml

minio_endpoint: http://localhost:9000 # [optional], default : http://localhost:9000
authentification: minioadmin:minioadmin # [optional], default : minioadmin:minioadmin
bucket: bucket # [optional], default : bucket
setup_data_bucket_policy: new_bucket | clear_bucket | none # [optional], default : new_bucket
copy_ignore: [] # [optional], default : []

Publish the library on pypi

The publication use a tag-based workflow to run the publication on github action. First, a developper tag a commit using alfred publish, then github action publish the library on pypi.

The alfred publish take the version number from pyproject.toml. The command will raise an error if the current branch is not master, if changes are in progress, or if the tag already exists, if the branch is not synchronized with remote branch

alfred publish

Develop with gitpod

gitpod can be used as an IDE. You can load the code inside to try the code.

Open in Gitpod

Developper guideline

Add a dependency

bash poetry add requests

Install development environment

Use make to instanciate a python virtual environment in ./venv and install the python dependencies.

poetry install

Update release dependencies

Use make to instanciate a python virtual environment in ./venv and freeze dependencies version

poetry update update

Activate the python environment

When you setup the requirements, a venv directory on python 3 is created. To activate the venv, you have to execute :

poetry shell

Run the continuous integration process

Before commit or send a pull request, you have to execute pylint to check the syntax of your code and run the unit tests to validate the behavior.

$ poetry run alfred ci

Contributors

  • Fabien Arcellier

License

MIT License

Copyright (c) 2024-2024 Fabien Arcellier

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for fixtup-minio-s3 0.0.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fixtup-minio-s3 0.0.1a0
File Size Uploaded
fixtup_minio_s3-0.0.1a0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fixtup-minio-s3 0.0.1a0
File Interpreter ABI Platform
fixtup_minio_s3-0.0.1a0-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / fixtup_minio_s3-0.0.1a0.tar.gz

Download URL fixtup_minio_s3-0.0.1a0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f2b6fcbf71a3a54edd069fe05261fd12f97893c4a2f44a778174dd2baa4bf6a2
BLAKE2b-256 checksum
How to use checksums
6453b35f0b514a0f58a4817b2d059df55718cdf230dbb3c9b82770555c63fd59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / fixtup_minio_s3-0.0.1a0-py3-none-any.whl

Download URL fixtup_minio_s3-0.0.1a0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a02bbf6721bff03ec8d305800e8a24faa480deadccffc9b646889060bd31003a
BLAKE2b-256 checksum
How to use checksums
4e89407007b45fce321d25e85d964104e09e2b1e91a2dce686bc42bce3376430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.0.1a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page