Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5b0dc3c88cf6
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cb09c5bf6a93
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Mar 29, 2019

  1. minio: init at 4.0.13

    peterromfeldhk authored and flokli committed Mar 29, 2019
    Copy the full SHA
    364cbd0 View commit details
  2. Merge pull request #54972 from trustedkey/minio

    pythonPackages.minio: init at 4.0.11
    flokli authored Mar 29, 2019
    Copy the full SHA
    cb09c5b View commit details
Showing with 51 additions and 4 deletions.
  1. +25 −4 nixos/tests/minio.nix
  2. +24 −0 pkgs/development/python-modules/minio/default.nix
  3. +2 −0 pkgs/top-level/python-packages.nix
29 changes: 25 additions & 4 deletions nixos/tests/minio.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
import ./make-test.nix ({ pkgs, ...} : {
import ./make-test.nix ({ pkgs, ...} :
let
accessKey = "BKIKJAA5BMMU2RHO6IBB";
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
minioPythonScript = pkgs.writeScript "minio-test.py" ''
#! ${pkgs.python3.withPackages(ps: [ ps.minio ])}/bin/python
import io
import os
from minio import Minio
minioClient = Minio('localhost:9000',
access_key='${accessKey}',
secret_key='${secretKey}',
secure=False)
sio = io.BytesIO()
sio.write(b'Test from Python')
sio.seek(0, os.SEEK_END)
sio_len = sio.tell()
sio.seek(0)
minioClient.put_object('test-bucket', 'test.txt', sio, sio_len, content_type='text/plain')
'';
in {
name = "minio";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ bachp ];
@@ -8,8 +28,7 @@ import ./make-test.nix ({ pkgs, ...} : {
machine = { pkgs, ... }: {
services.minio = {
enable = true;
accessKey = "BKIKJAA5BMMU2RHO6IBB";
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
inherit accessKey secretKey;
};
environment.systemPackages = [ pkgs.minio-client ];

@@ -25,9 +44,11 @@ import ./make-test.nix ({ pkgs, ...} : {
$machine->waitForOpenPort(9000);
# Create a test bucket on the server
$machine->succeed("mc config host add minio http://localhost:9000 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v4");
$machine->succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} S3v4");
$machine->succeed("mc mb minio/test-bucket");
$machine->succeed("${minioPythonScript}");
$machine->succeed("mc ls minio") =~ /test-bucket/ or die;
$machine->succeed("mc cat minio/test-bucket/test.txt") =~ /Test from Python/ or die;
$machine->shutdown;
'';
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/minio/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ stdenv, lib, buildPythonPackage, isPy3k, fetchPypi
, urllib3, python-dateutil , pytz, faker, mock, nose }:

buildPythonPackage rec {
pname = "minio";
version = "4.0.13";

src = fetchPypi {
inherit pname version;
sha256 = "1sbmv1lskm5cs3jmn8f2688pimgibly16g8ycc6fgnsjanyby35l";
};

disabled = !isPy3k;

checkInputs = [ faker mock nose ];
propagatedBuildInputs = [ urllib3 python-dateutil pytz ];

meta = with lib; {
description = "Simple APIs to access any Amazon S3 compatible object storage server";
homepage = https://github.com/minio/minio-py;
maintainers = with maintainers; [ peterromfeldhk ];
license = licenses.asl20;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
@@ -3192,6 +3192,8 @@ in {

minimock = callPackage ../development/python-modules/minimock { };

minio = callPackage ../development/python-modules/minio { };

moviepy = callPackage ../development/python-modules/moviepy { };

mozterm = callPackage ../development/python-modules/mozterm { };