-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pythonPackages.minio: init at 4.0.11 #54972
Conversation
@peterromfeldhk You are packaging multiple Python packages. Will this lead up to packaging some specific application? If so, please replace these PRs by a single one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message should equal this PR's title.
oh ok.. will do.. yes the goal is to have all our project deps managed by nix to make easy nice containers :) |
@dotlambda not sure i understand you correctly... i am packaging up a lot of deps from a private project, so i can use nix in future. should i do one big MR? |
In that case, there won't be an application I can test the dependencies with. Hence no need to do a single PR. |
The minio python libraries are quite useful, and generic enough to have them packaged in nixpkgs IMHO. I updated the minio test to use the minio python bindings to create a file and check for it afterwards: From 74b37052c34d5d3265037fb74b3a23dd05fbbe4f Mon Sep 17 00:00:00 2001
From: Florian Klink <flokli@flokli.de>
Date: Tue, 5 Feb 2019 18:31:39 +0100
Subject: [PATCH] minio: test minio python library in minio test
---
nixos/tests/minio.nix | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/nixos/tests/minio.nix b/nixos/tests/minio.nix
index 40a59954665..f1218b53771 100644
--- a/nixos/tests/minio.nix
+++ b/nixos/tests/minio.nix
@@ -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;
'';
--
2.19.2
@peterromfeldhk could you |
@GrahamcOfBorg test minio |
accessKey = "BKIKJAA5BMMU2RHO6IBB"; | ||
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12"; | ||
minioPythonScript = pkgs.writeScript "minio-test.py" '' | ||
#! ${pkgs.python3.withPackages(ps: [ ps.minio ])}/bin/python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#! ${pkgs.python3.withPackages(ps: [ ps.minio ])}/bin/python | |
#! ${(pkgs.python3.withPackages (ps: [ ps.minio ])}).interpreter} |
@GrahamcOfBorg test minio |
@GrahamcOfBorg build nixosTests.minio |
This was not fixed. |
My bad, sorry :-/ |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)