From e0307847770d089267253b86ad94350b1fe43eff Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Tue, 8 Mar 2016 20:32:46 +0200
Subject: [PATCH] - Add release environment to Tox, updated documentation.

---
 README.rst  |  1 +
 Vagrantfile |  2 +-
 tox.ini     | 13 +++++++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/README.rst b/README.rst
index 886f988..08b8275 100644
--- a/README.rst
+++ b/README.rst
@@ -16,6 +16,7 @@ Testing is done by running :code:`tox`. Auto-generated code (for now just
 :code:`unshare/constants.py`) is generated by running :code:`make all`. For Mac
 developers there's a Vagrant box defined (it optionally uses
 `vagrant-gatling-rsync <https://github.com/smerrill/vagrant-gatling-rsync>`_).
+Finally, releasing a version is done by running :code:`tox -e release`.
 
 TODO
 ----
diff --git a/Vagrantfile b/Vagrantfile
index 5000998..c522153 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -9,7 +9,7 @@ Vagrant.configure(2) do |config|
   config.vm.synced_folder ".", "/home/vagrant/python-unshare",
     type: "rsync",
     auto: true,
-    rsync__exclude: [".cache", ".tox", "*.egg-info", "*.swp", ".DS_Store", ".idea", "*.pyc", "__pycache__"]
+    rsync__exclude: [".cache", ".tox", "*.egg-info", "*.swp", ".DS_Store", ".idea", "*.pyc", "__pycache__", "dist"]
   config.vm.provision "shell", inline: <<-SHELL
     sudo apt-get update
     sudo apt-get install -yf build-essential linux-libc-dev python-pip python3-pip git
diff --git a/tox.ini b/tox.ini
index 9992870..1e63f79 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,3 +15,16 @@ commands =
     python setup.py check -m -r -s
     flake8 .
     py.test --verbose
+
+[testenv:release]
+basepython = python
+whitelist_externals =
+    sh
+    git
+deps =
+    twine
+    wheel
+commands =
+    sh -c 'git tag -f $(cat VERSION)'
+    python setup.py bdist_wheel
+#   twine upload --skip-existing dist/*
-- 
GitLab