Skip to content

Commit

Permalink
Clean up dependencies in prep for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
jkenlooper committed Apr 17, 2019
1 parent b2a57bf commit 970cae3
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 42 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CACHEDIR := $(PREFIXDIR)/var/lib/puzzle-massive/cache/
INTERNALIP := $(shell hostname -I | cut -d' ' -f1)

# Get the version from the package.json
TAG := $(shell cat package.json | python -c 'import sys, json; print json.load(sys.stdin)["version"]')
TAG := $(shell cat package.json | python -c 'import sys, json; print(json.load(sys.stdin)["version"])')

# For debugging what is set in variables
inspect.%:
Expand All @@ -43,7 +43,7 @@ ifeq ($(shell which virtualenv),)
$(error run "./bin/setup.sh" to install virtualenv)
endif
ifeq ($(shell ls bin/activate),)
$(error run "virtualenv .")
$(error run "virtualenv . -p python2")
endif
ifneq ($(shell which pip),$(project_dir)bin/pip)
$(warning run "source bin/activate" to activate the virtualenv. Using $(shell which pip). Ignore this warning if using sudo make install.)
Expand All @@ -62,7 +62,7 @@ objects := site.cfg web/puzzle-massive.conf stats/awstats.puzzle.massive.xyz.con
#openssl dhparam -out $@ 2048

bin/chill: chill/requirements.txt requirements.txt
pip install -r $<
pip install --upgrade --upgrade-strategy eager -r $<
touch $@;

objects += chill/puzzle-massive-chill.service
Expand All @@ -77,11 +77,11 @@ frozen.tar.gz: db.dump.sql site.cfg package.json $(shell find templates/ -type f

# Also installs janitor and artist
bin/puzzle-massive-api: api/requirements.txt requirements.txt api/setup.py
pip install -r $<
pip install --upgrade --upgrade-strategy eager -r $<
touch $@;

bin/puzzle-massive-divulger: divulger/requirements.txt requirements.txt divulger/setup.py
pip install -r $<
pip install --upgrade --upgrade-strategy eager -r $<
touch $@;


Expand Down
5 changes: 0 additions & 5 deletions api/api/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def main():
""
args = docopt(__doc__, version='0.0')
config_file = args['--config']
# parse args and pass to run, server, etc.
#site_config = RawConfigParser()
#site_config.read('site.cfg')

appconfig = loadConfig(config_file)
cookie_secret = appconfig.get('SECURE_COOKIE_SECRET')
Expand All @@ -53,8 +50,6 @@ def run(config, cookie_secret):

def serve(config, cookie_secret):
from gevent import pywsgi
#from geventwebsocket.handler import WebSocketHandler
#from geventwebsocket import WebSocketServer, Resource

app = make_app(config=config, cookie_secret=cookie_secret)

Expand Down
27 changes: 8 additions & 19 deletions api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
-r ../requirements.txt
Beaker == 1.6.4
#Jinja2==2.9
Pillow == 3.3.0
https://github.com/jkenlooper/chill/archive/develop.zip#egg=chill
psycopg2<2.9.0
git+https://github.com/jkenlooper/pyselect#egg=pyselect
Pillow == 6.0.0
git+https://github.com/jkenlooper/glue#egg=glue
https://github.com/jkenlooper/pixsaw/archive/develop.zip#egg=pixsaw
docopt==0.6.2
html == 1.16
piecemaker == 0.2.4
progressbar == 2.3
pycurl==7.43.0.2
pysqlite==2.8.3
redis == 2.10.6
rq==0.12.0
websocket-client==0.53.0
requests==2.20
Flask-Sockets==0.2.1
simplejson == 3.1.3
flask-secure-cookie == 0.1.2
https://github.com/jkenlooper/piecemaker/archive/develop.zip#egg=piecemaker
#pycurl==7.43.0.2

requests==2.21
#TODO: update to cairosvg==2.3.0 when only supporting py3
cairosvg==1.0.22
pycairo==1.17.1
boto3==1.9.47
-e api/
3 changes: 2 additions & 1 deletion bin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@
/thresholder.py
/viewer.py
/wsdump.py

/futurize
/pasteurize
12 changes: 9 additions & 3 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ apt-get --yes install \
apt-get --yes install \
python \
python-dev \
python3-dev \
python-pip \
python-numpy \
sqlite3 \
libpq-dev \
python-psycopg2 \
Expand All @@ -22,15 +24,19 @@ apt-get --yes install \
awstats

apt-get --yes install libssl-dev
apt-get --yes install python-pycurl
apt-get --yes install imagemagick libcurl4-openssl-dev
#apt-get --yes install python-pycurl
apt-get --yes install imagemagick
#apt-get --yes install libcurl4-openssl-dev

# Install support for Pillow
apt-get --yes install python-imaging
# TODO: Are these libs still needed if installing python-imaging?
apt-get --yes install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
apt-get --yes install optipng

apt-get --yes install libsqlite3-dev

# Dependencies for piecemaker
apt-get --yes install optipng
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt-get install -y nodejs # also installs npm

Expand Down
1 change: 1 addition & 0 deletions bin/site-cfg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python

from __future__ import print_function
import sys
import os.path

Expand Down
2 changes: 0 additions & 2 deletions chill/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
-r ../requirements.txt
https://github.com/jkenlooper/chill/archive/develop.zip#egg=chill
psycopg2<2.9.0
git+https://github.com/jkenlooper/pyselect#egg=pyselect
File renamed without changes.
3 changes: 3 additions & 0 deletions divulger/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
-r ../requirements.txt
websocket-client==0.53.0
gevent-websocket==0.10.1
# TODO: include numpy and wsaccel to improve performance of ws.send
-e divulger/
4 changes: 2 additions & 2 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ been uploaded to the home directory.

```bash
cd /usr/local/src/puzzle-massive;
virtualenv .;
virtualenv . -p python2;
source bin/activate;
make ENVIRONMENT=production && \
sudo make ENVIRONMENT=production install;
Expand Down Expand Up @@ -130,7 +130,7 @@ by the public.

```bash
cd /usr/local/src/puzzle-massive/;
virtualenv .;
virtualenv . -p python2;
source bin/activate;
make ENVIRONMENT=production;
cp chill-data.sql db.dump.sql;
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ When first installing on the dev machine run:

```bash
# Setup to use a virtual python environment
virtualenv .;
virtualenv . -p python2;
source bin/activate;

# Makes the initial development version
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ cp ~/.env ~/.htpasswd /vagrant/;
# Build and install

# Isolate the python environment and make it active
virtualenv .;
virtualenv . -p python2;
source bin/activate;

# Use nvm to set Node version
Expand Down
15 changes: 12 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
Flask==1.0
SQLAlchemy==1.3.2
gevent==1.3.6
gevent-websocket==0.10.1
SQLAlchemy==1.3.3
gevent==1.4.0
https://github.com/jkenlooper/chill/archive/develop.zip#egg=chill
psycopg2<2.9.0

#TODO: modify zadd commands before updating to redis 3
redis == 2.10.6
#TODO: use hiredis to improve redis parser speed
hiredis == 1.0.0
#TODO: rq==1.0 requires redis >= 3
rq==0.12.0

0 comments on commit 970cae3

Please sign in to comment.