From 4d29e1167d40f223a02e158251560190cf437939 Mon Sep 17 00:00:00 2001
From: ulif <uli@gnufix.de>
Date: Sun, 29 Mar 2015 20:26:16 +0200
Subject: [PATCH] Turn diceware module into a package.

Move wordlists into the new package. This should fix
the data_files problem on most platforms and in most
environments.

Seems to be really tricky to install data files in a
foreseeable location.

The more finegrained solution of conorsch might be
slightly less stable in the long run, therefore we
selected the 'package', actually.
---
 CHANGES.rst                                       | 7 +++++++
 MANIFEST.in                                       | 2 +-
 diceware.py => diceware/__init__.py               | 0
 {wordlists => diceware/wordlists}/wordlist_en.txt | 0
 setup.cfg                                         | 2 +-
 setup.py                                          | 7 ++-----
 6 files changed, 11 insertions(+), 7 deletions(-)
 rename diceware.py => diceware/__init__.py (100%)
 rename {wordlists => diceware/wordlists}/wordlist_en.txt (100%)

diff --git a/CHANGES.rst b/CHANGES.rst
index 6049093..705a3f4 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,13 @@ Changes
 0.4 (unreleased)
 ----------------
 
+- Turned former `diceware` module into a Python package. This is to
+  fix `bug #1 Wordlists aren't included during installation
+  <https://github.com/ulif/diceware/issues/1>`_, this time really.
+  Wordlists will from now on be stored inside the `diceware` package.
+  Again many thanks to `conorsch <https://github.com/conorsch>`_ who
+  digged deep into the matter and also came up with a very considerable
+  solution.
 - Use readthedocs theme in docs.
 
 
diff --git a/MANIFEST.in b/MANIFEST.in
index 2552183..3dd298f 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1,2 @@
-recursive-include wordlists *.txt
+recursive-include diceware/wordlists *.txt
 include README.rst CHANGES.rst LICENSE
diff --git a/diceware.py b/diceware/__init__.py
similarity index 100%
rename from diceware.py
rename to diceware/__init__.py
diff --git a/wordlists/wordlist_en.txt b/diceware/wordlists/wordlist_en.txt
similarity index 100%
rename from wordlists/wordlist_en.txt
rename to diceware/wordlists/wordlist_en.txt
diff --git a/setup.cfg b/setup.cfg
index dd70e16..c220397 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -6,4 +6,4 @@ docs = develop easy_install diceware[docs]
 [pytest]
 addopts = --doctest-modules
           --doctest-glob='*.rst'
-          tests docs README.rst diceware.py
+          diceware tests docs README.rst
diff --git a/setup.py b/setup.py
index e82ed2c..06778cb 100644
--- a/setup.py
+++ b/setup.py
@@ -48,8 +48,8 @@ setup(
     license="GPL 3.0",
     keywords="diceware password passphrase",
     url="https://github.com/ulif/diceware/",
-    py_modules=['diceware', ],
-    packages=[],
+    py_modules=[],
+    packages=['diceware', ],
     namespace_packages=[],
     long_description=read('README.rst') + '\n\n\n' + read('CHANGES.rst'),
     classifiers=[
@@ -85,7 +85,4 @@ setup(
             'diceware = diceware:main',
         ]
         },
-    data_files=[
-        ('wordlists', ['wordlists/wordlist_en.txt']),
-        ],
 )
-- 
GitLab