summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorLancelot SIX <lsix+github@lancelotsix.com>2020-01-21 11:47:40 +0100
committerGitHub <noreply@github.com>2020-01-21 11:47:40 +0100
commite0fa73d6927dc55167eb8339867d80dd6f02260e (patch)
tree26d313b2cf7f94e50146740927ee3ae5f62ed98f /pkgs
parente48d9e6871624e016b1281378ac0a68490aeb31e (diff)
parentcecfde44e6f68395abb2fef79cfb84d153f0296e (diff)
downloadnixpkgs-e0fa73d6927dc55167eb8339867d80dd6f02260e.tar
nixpkgs-e0fa73d6927dc55167eb8339867d80dd6f02260e.tar.gz
nixpkgs-e0fa73d6927dc55167eb8339867d80dd6f02260e.tar.bz2
nixpkgs-e0fa73d6927dc55167eb8339867d80dd6f02260e.tar.lz
nixpkgs-e0fa73d6927dc55167eb8339867d80dd6f02260e.tar.xz
nixpkgs-e0fa73d6927dc55167eb8339867d80dd6f02260e.tar.zst
nixpkgs-e0fa73d6927dc55167eb8339867d80dd6f02260e.zip
Merge pull request #66391 from doom3wasagoodgame/init-python-package-coreapi
Packages for the python coreapi client
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/coreapi/default.nix44
-rw-r--r--pkgs/development/python-modules/coreschema/default.nix34
-rw-r--r--pkgs/development/python-modules/drf-yasg/default.nix40
-rw-r--r--pkgs/development/python-modules/itypes/default.nix31
-rw-r--r--pkgs/top-level/python-packages.nix8
5 files changed, 157 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/coreapi/default.nix b/pkgs/development/python-modules/coreapi/default.nix
new file mode 100644
index 00000000000..216d1ee6985
--- /dev/null
+++ b/pkgs/development/python-modules/coreapi/default.nix
@@ -0,0 +1,44 @@
+{
+  stdenv,
+  fetchFromGitHub,
+  buildPythonPackage,
+  django,
+  coreschema,
+  itypes,
+  uritemplate,
+  requests,
+  pytest,
+}:
+
+buildPythonPackage rec {
+  pname = "coreapi";
+  version = "2.3.3";
+
+  src = fetchFromGitHub {
+    repo = "python-client";
+    owner = "core-api";
+    rev = version;
+    sha256 = "1c6chm3q3hyn8fmjv23qgc79ai1kr3xvrrkp4clbqkssn10k7mcw";
+  };
+
+  propagatedBuildInputs = [
+    django
+    coreschema
+    itypes
+    uritemplate
+    requests
+  ];
+
+  checkInputs = [ pytest ];
+  checkPhase = ''
+    cd ./tests
+    pytest
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Python client library for Core API";
+    homepage = https://github.com/core-api/python-client;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ivegotasthma ];
+  };
+}
diff --git a/pkgs/development/python-modules/coreschema/default.nix b/pkgs/development/python-modules/coreschema/default.nix
new file mode 100644
index 00000000000..949fa31df95
--- /dev/null
+++ b/pkgs/development/python-modules/coreschema/default.nix
@@ -0,0 +1,34 @@
+{
+  stdenv,
+  fetchFromGitHub,
+  buildPythonPackage,
+  jinja2,
+  pytest,
+}:
+
+buildPythonPackage rec {
+  pname = "coreschema";
+  version = "0.0.4";
+
+  src = fetchFromGitHub {
+    repo = "python-coreschema";
+    owner = "core-api";
+    rev = version;
+    sha256 = "027pc753mkgbb3r1v1x7dsdaarq93drx0f79ppvw9pfkcjcq6wb1";
+  };
+
+  propagatedBuildInputs = [ jinja2 ];
+
+  checkInputs = [ pytest ];
+  checkPhase = ''
+    cd ./tests
+    pytest
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Python client library for Core Schema";
+    homepage = https://github.com/ivegotasthma/python-coreschema;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ivegotasthma ];
+  };
+}
diff --git a/pkgs/development/python-modules/drf-yasg/default.nix b/pkgs/development/python-modules/drf-yasg/default.nix
new file mode 100644
index 00000000000..707b1e5bc6e
--- /dev/null
+++ b/pkgs/development/python-modules/drf-yasg/default.nix
@@ -0,0 +1,40 @@
+{
+  stdenv,
+  buildPythonPackage,
+  fetchPypi,
+  inflection,
+  ruamel_yaml,
+  setuptools_scm,
+  six,
+  coreapi,
+  djangorestframework,
+}:
+
+buildPythonPackage rec {
+  pname = "drf-yasg";
+  version = "1.16.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0ri5h5xsacm99c6gvb4ldwisbqgiv2vq8qbn7vrh6vplzlpyvzb8";
+  };
+
+  nativeBuildInputs = [
+    setuptools_scm
+  ];
+
+  propagatedBuildInputs = [
+    six
+    inflection
+    ruamel_yaml
+    coreapi
+    djangorestframework
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Generation of Swagger/OpenAPI schemas for Django REST Framework";
+    homepage = https://github.com/axnsan12/drf-yasg;
+    maintainers = with maintainers; [ ivegotasthma ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/itypes/default.nix b/pkgs/development/python-modules/itypes/default.nix
new file mode 100644
index 00000000000..1386ba39a26
--- /dev/null
+++ b/pkgs/development/python-modules/itypes/default.nix
@@ -0,0 +1,31 @@
+{
+  stdenv,
+  fetchFromGitHub,
+  buildPythonPackage,
+  pytest,
+}:
+
+buildPythonPackage rec {
+  pname = "itypes";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "tomchristie";
+    rev = version;
+    sha256 = "0zkhn16wpslkxkq77dqw5rxa28nrchcb6nd3vgnxv91p4skyfm62";
+  };
+
+  checkInputs = [ pytest ];
+  checkPhase = ''
+    mv itypes.py itypes.py.hidden
+    pytest tests.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Simple immutable types for python";
+    homepage = https://github.com/tomchristie/itypes;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ivegotasthma ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index ae7387bf5cb..098d3b19eee 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -2115,6 +2115,10 @@ in {
 
   cookies = callPackage ../development/python-modules/cookies { };
 
+  coreapi = callPackage ../development/python-modules/coreapi { };
+
+  coreschema = callPackage ../development/python-modules/coreschema { };
+
   coveralls = callPackage ../development/python-modules/coveralls { };
 
   coverage = callPackage ../development/python-modules/coverage { };
@@ -2500,6 +2504,8 @@ in {
 
   urllib3 = callPackage ../development/python-modules/urllib3 {};
 
+  drf-yasg = callPackage ../development/python-modules/drf-yasg { };
+
   dropbox = callPackage ../development/python-modules/dropbox {};
 
   drms = callPackage ../development/python-modules/drms { };
@@ -2749,6 +2755,8 @@ in {
 
   itsdangerous = callPackage ../development/python-modules/itsdangerous { };
 
+  itypes = callPackage ../development/python-modules/itypes { };
+
   iniparse = callPackage ../development/python-modules/iniparse { };
 
   intreehooks = callPackage ../development/python-modules/intreehooks { };