Skip to content
Permalink
Browse files

Setup improvements (#9)

* Add requirements.txt

* Add tweepy to requirements

* Clean up setup.py

* Add build_macOS.sh file for testing convenience

* Update README
  • Loading branch information...
Ickerday authored and Nick-Gottschlich committed Jul 7, 2018
1 parent a43b0f5 commit 0a357ae86638e1bd7d113116e46c3ba6f600c969
Showing with 42 additions and 18 deletions.
  1. +13 −6 README.md
  2. +5 −0 build_macOS.sh
  3. +4 −0 requirements.txt
  4. +20 −12 setup.py
@@ -10,16 +10,23 @@ This is in very early versions, this readme will contain a list of what sites ar
This is the simplest option. Bundled and easily usable files are available in the zip files on the [releases](https://github.com/Nick-Gottschlich/Social-Amnesia/releases) page.

### How to run Social Amnesia from the command line
If you have python3 you can run Social Amnesia directly by cloning this repo and running `python3 SocialAmnesia.py` on a command line. You will have to install several packages with a package manager like "pip" or "pip3".
*NOTE:* As of 7.07.18 the project is not compatible with Python 3.7 yet - [related tweepy issue](https://github.com/tweepy/tweepy/pull/1042).

`pip3 install praw`
`pip3 install arrow`
* Clone the repo
* Set up a new [virtualenv](https://virtualenv.pypa.io/en/stable/) and activate it
* Run:
```
pip3 install -r requirements.txt
python3 SocialAmnesia.py
```
* Have fun!

### How to build the executable for Social Amnesia

Build the executable by first installing cx_freeze by running `pip3 install cx_Freeze`. Then you can build the executable running `python3 setup.py `. This will create a folder called `build`, inside you can a folder with some crazy name, and in that you should see a 'Social Amnesia' executable. Run that executable to start the program.

You can build a mac DMG using `python3 setup.py bdist_dmg` and you can build a windows installer using `python3 setup.py bdist_msi`. These will let you install and use Social Amnesia as an actual application.
Install the requirements using pip3 (see above).
Then you can build the executable by running `python3 setup.py bdist_msi` (Windows) or `python3 setup.py bdist_dmg` (macOS).
This will create a folder called `build`, in which you should find a folder with a name starting with 'exe.'.
There should be a 'Social Amnesia' executable waiting inside. Run that executable to start the program.

Note: On windows you may have to copy `tcl86t.dll` and `tk86t.dll` from your `Python3X/DLLs` into the folder with the executable to get this to run.

@@ -0,0 +1,5 @@
#!/bin/sh

echo 'Building macOS executable...'
python3 setup.py bdist_dmg
echo 'Done! Check the build folder'
@@ -0,0 +1,4 @@
arrow==0.12.1
cx-Freeze==5.1.1
praw==5.4.0
tweepy==3.6.0
@@ -1,16 +1,24 @@
from cx_Freeze import setup, Executable
from multiprocessing import Queue
import os
import sys

from cx_Freeze import setup, Executable

app_name = "Social Amnesia"
app_description = 'Forget the past. Social Amnesia makes sure ' \
'your social media accounts only show your posts ' \
'from recent history, not from "that phase" 5 years ago.'

base = None
if sys.platform == "win32":
base = "Win32GUI"
os.environ['TCL_LIBRARY'] = "C:\\Python36\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Python36\\tcl\\tk8.6"
build_exe_options = {"packages": ["os", "idna"]}
setup(name="Social Amnesia",
version="0.2.0",
description="Social Amnesia",
options={"build_exe": build_exe_options},
executables=[Executable("SocialAmnesia.py", base=base)])
if sys.platform == 'win32':
base = 'Win32GUI'
os.environ['TCL_LIBRARY'] = 'C:\\Python36\\tcl\\tcl8.6'
os.environ['TK_LIBRARY'] = 'C:\\Python36\\tcl\\tk8.6'

build_exe_options = {'packages': ['os', 'idna', 'multiprocessing']}
executables = [Executable('SocialAmnesia.py', base=base)]

setup(name=app_name,
version='0.2.0',
description=app_description,
options={'build_exe': build_exe_options},
executables=executables)

0 comments on commit 0a357ae

Please sign in to comment.
You can’t perform that action at this time.