From 476aa3e4b88503581eb0b948791f8f620920abb2 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Fri, 7 Jun 2019 14:06:35 -0400
Subject: [PATCH] Set up minimal Python packaging

---
 default.nix                                  |  6 +----
 secure-access-token-authorizer.nix           |  7 ++++++
 setup.cfg                                    | 26 ++++++++++++++++++++
 setup.py                                     |  3 +++
 src/_secureaccesstokenauthorizer/__init__.py | 15 +++++++++++
 5 files changed, 52 insertions(+), 5 deletions(-)
 create mode 100644 secure-access-token-authorizer.nix
 create mode 100644 setup.cfg
 create mode 100644 setup.py
 create mode 100644 src/_secureaccesstokenauthorizer/__init__.py

diff --git a/default.nix b/default.nix
index 56748f3..3e33118 100644
--- a/default.nix
+++ b/default.nix
@@ -1,6 +1,2 @@
 { pkgs ? import <nixpkgs> { } }:
-pkgs.stdenv.mkDerivation rec {
-  version = "0.0";
-  name = "secure-access-token-authorizer-${version}";
-  depsBuildBuild = [ pkgs.python37Packages.sphinx ];
-}
+pkgs.python37Packages.callPackage ./secure-access-token-authorizer.nix { }
diff --git a/secure-access-token-authorizer.nix b/secure-access-token-authorizer.nix
new file mode 100644
index 0000000..3b916b3
--- /dev/null
+++ b/secure-access-token-authorizer.nix
@@ -0,0 +1,7 @@
+{ buildPythonPackage, sphinx }:
+buildPythonPackage rec {
+  version = "0.0";
+  name = "secure-access-token-authorizer-${version}";
+  src = ./.;
+  depsBuildBuild = [ sphinx ];
+}
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..1c57183
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,26 @@
+[metadata]
+name = Secure Access Token Authorizer
+version = attr: _secureaccesstokenauthorizer.__version__
+description = A `Tahoe-LAFS`_ storage-system plugin which authorizes storage operations based on privacy-respecting tokens.
+long_description = file: README.rst, CHANGELOG.rst, LICENSE-2.0.txt
+keywords = tahoe-lafs, storage, privacy, cryptography
+license = Apache 2.0
+classifiers =
+    Framework :: Twisted
+    Programming Language :: Python :: 3
+    Programming Language :: Python :: 3.7
+    Programming Language :: Python :: 2
+    Programming Language :: Python :: 2.7
+author = PrivateStorage.io, LLC
+maintainer = PrivateStorage.io, LLC
+home-page = https://privatestorage.io/
+author-email = support@privatestorage.io
+platform = POSIX
+
+[options]
+package_dir=
+    =src
+packages=find:
+
+[options.packages.find]
+where=src
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..6068493
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,3 @@
+from setuptools import setup
+
+setup()
diff --git a/src/_secureaccesstokenauthorizer/__init__.py b/src/_secureaccesstokenauthorizer/__init__.py
new file mode 100644
index 0000000..4990b68
--- /dev/null
+++ b/src/_secureaccesstokenauthorizer/__init__.py
@@ -0,0 +1,15 @@
+# Copyright 2019 PrivateStorage.io, LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+__version__ = "0.0"
-- 
GitLab