From 9ac1f998853bf8284a61125f7779bc9146153986 Mon Sep 17 00:00:00 2001 From: Kelvin Jayanoris Date: Mon, 26 Mar 2018 19:25:16 +0300 Subject: [PATCH 1/5] Fix setup.py - Only leave Django in `install_requires`. We do not use setup.py for python library dependency management and should only keep the bare minimum inside `install_requires`. Having many un-updated things here may break tools like `pip-compile` for people who include onadata in their python requirements files. - Remove `dependency_links` completely. This is more accurately handled in our requirement files. - Exclude tests and docs from `find_packages` - Add module docstring --- setup.py | 112 +++++++++---------------------------------------------- 1 file changed, 18 insertions(+), 94 deletions(-) diff --git a/setup.py b/setup.py index e4dbc18def..70ed432763 100644 --- a/setup.py +++ b/setup.py @@ -1,101 +1,25 @@ -from setuptools import setup, find_packages +""" +Setup file for onadata + +Ona is a social enterprise that builds the data infrastructure to drive change. +We believe technology affords new opportunities for governments and development +organizations to be increasingly data driven, collaborative and accountable. +Our goal is never simply to build a great product, but to support great +outcomes. +See: +https://github.com/onaio/onadata +https://ona.io +""" + +from setuptools import setup, find_packages setup( - name="core", - version="1.1.4", # dev version + name="onadata", + version="1.13.0", description="Collect Analyze and Share Data!", author="Ona Systems Inc", author_email="support@ona.io", license="Copyright (c) 2014 Ona Systems Inc All rights reserved.", - packages=find_packages(), - # pip is unable to install from git repos so we will depend on Makefile - # for this - dependency_links=[ - 'http://github.com/onaio/pxform.git@onaio#egg=pyxform', - 'http://github.com/onaio/django-digest.git@django-1.9-fixes#' - 'egg=django-digest', - 'http://github.com/jbalogh/django-nose.git#egg=django-nose', - 'http://github.com/onaio/python-json2xlsclient.git#egg=j2xclient', - 'http://github.com/onaio/django-cors-headers.git@allow-all-for-url#' - 'egg=cors-headers', - 'http://bitbucket.org/fomcl/savreaderwriter/downloads/' - 'savReaderWriter-3.4.2.zip'], - install_requires=[ - 'alabaster==0.7.7', - 'amqp==1.4.9', - 'anyjson==0.3.3', - 'babel==2.3.3', - 'billiard==3.3.0.23', - 'celery==3.1.23', - 'defusedxml==0.4.1', - 'dict2xml==1.4', - 'django-braces==1.8.1', - 'django-celery==3.1.17', - 'django-db-readonly==0.4.1', - 'django-filter==0.13.0', - 'django-guardian==1.4.4', - 'django-oauth-toolkit==0.10.0', - 'django-ordered-model==1.1.0', - 'django-query-builder==0.10.0', - 'django-registration-redux==1.4', - 'django-reversion==1.10.2', - 'django-taggit==0.18.1', - 'django-templated-email==0.4.9', - 'Django==1.9.5', - 'djangorestframework-csv==1.4.1', - 'djangorestframework-gis==0.10.1', - 'djangorestframework-jsonp==1.0.2', - 'djangorestframework-xml==1.3.0', - 'djangorestframework==3.3.3', - 'docutils==0.12', - 'dpath==1.4.0', - 'elaphe==0.6.0', - 'et-xmlfile==1.0.1', - 'fleming==0.4.3', - 'funcsigs==1.0.0', - 'geojson==1.3.2', - 'google-api-python-client==1.5.0', - 'gspread==0.3.0', - 'httmock==1.2.5', - 'httplib2==0.9.2', - 'imagesize==0.7.0', - 'jdcal==1.2', - 'Jinja2==2.8', - 'jsonfield==0.9.23', - 'kombu==3.0.35', - 'librabbitmq==1.6.1', - 'lxml==3.6.0', - 'Markdown==2.6.6', - 'MarkupSafe==0.23', - 'mock==2.0.0', - 'modilabs-python-utils==0.1.5', - 'nose==1.3.7', - 'numpy==1.11.0', - 'oauth2client==2.0.2', - 'oauthlib==1.0.3', - 'openpyxl==2.3.5', - 'ordereddict==1.1', - 'pbr==1.9.1', - 'Pillow==3.2.0', - 'psycopg2==2.6.1', - 'pyasn1-modules==0.0.8', - 'pyasn1==0.1.9', - 'Pygments==2.1.3', - 'PyJWT==1.4.0', - 'pylibmc==1.5.1', - 'pymongo==3.2.2', - 'python-dateutil==2.5.2', - 'python-digest==1.7', - 'python-memcached==1.57', - 'pytz==2016.3', - 'recaptcha-client==1.0.6', - 'requests==2.9.1', - 'rsa==3.4.2', - 'simplejson==3.8.2', - 'six==1.10.0', - 'snowballstemmer==1.2.1', - 'sphinx==1.4.1', - 'unicodecsv==0.14.1', - 'xlrd==0.8.0', - 'xlwt==1.0.0']) + packages=find_packages(exclude=['docs', 'tests']), + install_requires=['Django==1.11.11']) From 482daf37303d82e4af3f1d40c0b119309fff26ba Mon Sep 17 00:00:00 2001 From: Kelvin Jayanoris Date: Wed, 28 Mar 2018 12:22:42 +0300 Subject: [PATCH 2/5] Use setupy.py to track dependencies - Add dependencies to `install_requires` option of setup.py - Make `base.in` use dependencies from `setup.py` --- requirements/base.in | 102 +++---------------------------------------- setup.py | 101 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 99 insertions(+), 104 deletions(-) diff --git a/requirements/base.in b/requirements/base.in index f57fa2c9d0..79b4d99c20 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -1,102 +1,10 @@ -Django -django-guardian +# load from setup.py +-e . + +# installed from Git -e git+https://github.com/bfirsh/django-ordered-model.git@master#egg=django-ordered-model -e git+https://github.com/onaio/django-multidb-router.git@django-1.11#egg=django-multidb-router -django-registration-redux -django-templated-email -django-reversion -django-filter - -# generic relation -django-query-builder - -celery -django-celery -librabbitmq - -# cors -django-cors-headers -django-debug-toolbar - -python-digest -e git+https://github.com/onaio/django-digest.git@django-1.9-fixes#egg=django-digest - -# oauth2 support -django-oauth-toolkit -oauth2client -jsonpickle - -# jwt -PyJWT - -# captcha -recaptcha-client - -# API support -djangorestframework -djangorestframework-csv -djangorestframework-gis -djangorestframework-jsonapi -djangorestframework-jsonp -djangorestframework-xml - -geojson - -# tagging -django-taggit - -# database -psycopg2>2.7.1 -pymongo - -# sms support -dict2xml -lxml - -pyxform -#pyfloip>=0.0.1 -e git+https://github.com/onaio/floip-py.git@master#egg=floip - -# spss -#-e git+https://bitbucket.org/fomcl/savreaderwriter.git@v3.4.2#egg=savreaderwriter -savreaderwriter - -unicodecsv -xlrd -xlwt -openpyxl -e git+https://github.com/onaio/python-json2xlsclient.git#egg=python-json2xlsclient - -# tests -mock -httmock --e git+https://github.com/jbalogh/django-nose.git#egg=django-nose - -# JSON data type support, keeping it around for previous migration -jsonfield<1.0 - -# memcached support -pylibmc -python-memcached - -# docs -sphinx -Markdown - -dpath -elaphe -httplib2 -modilabs-python-utils -numpy -Pillow -python-dateutil -pytz -requests -simplejson -google-api-python-client -uwsgi -flake8 -raven - -django-activity-stream -paho-mqtt +-e git+https://github.com/jbalogh/django-nose.git#egg=django-nose \ No newline at end of file diff --git a/setup.py b/setup.py index 70ed432763..c06669f6d1 100644 --- a/setup.py +++ b/setup.py @@ -1,25 +1,112 @@ """ Setup file for onadata -Ona is a social enterprise that builds the data infrastructure to drive change. -We believe technology affords new opportunities for governments and development -organizations to be increasingly data driven, collaborative and accountable. -Our goal is never simply to build a great product, but to support great -outcomes. +Onadata is a Django application that provides APIs for data collection and +aggregation. + +It provides: +- ODK aggregate server API +- ODK briefcase API +- REST APIs to interact with data that is used by ona.io See: https://github.com/onaio/onadata https://ona.io +https://opendatakit.org """ from setuptools import setup, find_packages -setup( +config = dict( name="onadata", version="1.13.0", description="Collect Analyze and Share Data!", author="Ona Systems Inc", author_email="support@ona.io", license="Copyright (c) 2014 Ona Systems Inc All rights reserved.", + project_urls={ + 'Source': 'https://github.com/onaio/onadata', + }, packages=find_packages(exclude=['docs', 'tests']), - install_requires=['Django==1.11.11']) + install_requires=[ + "Django>=1.11<2", + "django-guardian", + "django-registration-redux", + "django-templated-email", + "django-reversion", + "django-filter", + # generic relation + "django-query-builder", + "celery", + "django-celery", + "librabbitmq", + # cors + "django-cors-headers", + "django-debug-toolbar", + # digest authentication + "python-digest", + # oauth2 support + "django-oauth-toolkit", + "oauth2client", + "jsonpickle", + # jwt + "PyJWT", + # captcha + "recaptcha-client", + # API support + "djangorestframework", + "djangorestframework-csv", + "djangorestframework-gis", + "djangorestframework-jsonapi", + "djangorestframework-jsonp", + "djangorestframework-xml", + # geojson + "geojson", + # tagging + "django-taggit", + # database + "psycopg2>2.7.1", + "pymongo", + # sms support + "dict2xml", + "lxml", + # pyxform + "pyxform", + # spss + "savreaderwriter", + # tests + "mock", + "httmock", + # JSON data type support, keeping it around for previous migration + "jsonfield<1.0", + # memcached support + "pylibmc", + "python-memcached", + # docs + "sphinx", + "Markdown", + # others + "unicodecsv", + "xlrd", + "xlwt", + "openpyxl", + "dpath", + "elaphe", + "httplib2", + "modilabs-python-utils", + "numpy", + "Pillow", + "python-dateutil", + "pytz", + "requests", + "simplejson", + "google-api-python-client", + "uwsgi", + "flake8", + "raven", + "django-activity-stream", + "paho-mqtt", + ] +) + +setup(**config) From 9134de892d99bdd55f7e3e2c6c299e0ab10f1d87 Mon Sep 17 00:00:00 2001 From: Kelvin Jayanoris Date: Wed, 28 Mar 2018 12:27:09 +0300 Subject: [PATCH 3/5] update base.pip and dev.pip --- requirements/base.pip | 26 ++++++++++++++------------ requirements/dev.pip | 26 ++++++++++++++------------ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/requirements/base.pip b/requirements/base.pip index 3396dd6332..83b9061654 100644 --- a/requirements/base.pip +++ b/requirements/base.pip @@ -8,6 +8,7 @@ -e git+https://github.com/onaio/django-multidb-router.git@django-1.11#egg=django-multidb-router -e git+https://github.com/jbalogh/django-nose.git#egg=django-nose -e git+https://github.com/bfirsh/django-ordered-model.git@master#egg=django-ordered-model +-e file:///home/mosh/ona/onadata -e git+https://github.com/onaio/floip-py.git@master#egg=floip -e git+https://github.com/onaio/python-json2xlsclient.git#egg=python-json2xlsclient alabaster==0.7.10 # via sphinx @@ -17,7 +18,7 @@ argparse==1.4.0 # via unittest2 babel==2.4.0 # via sphinx billiard==3.3.0.23 # via celery cchardet==1.1.3 # via datapackage, tabulator -celery==3.1.25 +celery==3.1.25 # via django-celery certifi==2017.4.17 # via requests chardet==3.0.3 # via requests click==6.7 # via datapackage, tableschema, tabulator @@ -40,13 +41,13 @@ django-render-block==0.5 # via django-templated-email django-reversion==2.0.8 django-taggit==0.22.1 django-templated-email==2.2.0 -django==1.11.11 +django==1.11.11 # via django-celery, django-debug-toolbar, django-oauth-toolkit, django-query-builder, django-render-block, django-reversion, djangorestframework-jsonapi, jsonfield djangorestframework-csv==2.0.0 djangorestframework-gis==0.11.2 djangorestframework-jsonapi==2.4.0 djangorestframework-jsonp==1.0.2 djangorestframework-xml==1.3.0 -djangorestframework==3.6.3 +djangorestframework==3.6.3 # via djangorestframework-csv, djangorestframework-gis, djangorestframework-jsonapi docutils==0.13.1 # via sphinx dpath==1.4.0 elaphe==0.6.0 @@ -57,10 +58,11 @@ fleming==0.4.5 # via django-query-builder formencode==1.3.1 # via pyxform funcsigs==1.0.2 # via mock functools32==3.2.3.post2 # via jsonschema +future==0.16.0 geojson==1.3.5 google-api-python-client==1.6.2 httmock==1.2.6 -httplib2==0.10.3 +httplib2==0.10.3 # via google-api-python-client, oauth2client idna==2.5 # via requests ijson==2.3 # via tabulator imagesize==0.7.1 # via sphinx @@ -85,13 +87,13 @@ mock==2.0.0 modilabs-python-utils==0.1.5 nose==1.3.7 numpy==1.12.1 -oauth2client==4.1.0 +oauth2client==4.1.0 # via google-api-python-client oauthlib==2.0.1 # via django-oauth-toolkit olefile==0.44 # via pillow -openpyxl==2.4.8 +openpyxl==2.4.8 # via tabulator paho-mqtt==1.3.1 pbr==3.0.1 # via mock -pillow==4.1.1 +pillow==4.1.1 # via elaphe psycopg2==2.7.3.1 pyasn1-modules==0.0.8 # via oauth2client pyasn1==0.2.3 # via oauth2client, pyasn1-modules, rsa @@ -101,14 +103,14 @@ pygments==2.2.0 # via sphinx pyjwt==1.5.0 pylibmc==1.5.2 pymongo==3.4.0 -python-dateutil==2.6.0 +python-dateutil==2.6.0 # via fleming, tableschema python-digest==1.7 python-memcached==1.58 -pytz==2017.2 +pytz==2017.2 # via babel, celery, django, django-query-builder, fleming pyxform==0.10.0 raven==6.1.0 recaptcha-client==1.0.6 -requests==2.17.3 +requests==2.17.3 # via datapackage, httmock, sphinx, tableschema, tabulator rfc3986==1.1.0 # via tableschema rsa==3.4.2 # via oauth2client savreaderwriter==3.4.2 @@ -123,10 +125,10 @@ tableschema==1.0.8 # via datapackage tabulator==1.11.1 # via datapackage, tableschema traceback2==1.4.0 # via unittest2 typing==3.6.1 # via sphinx -unicodecsv==0.14.1 +unicodecsv==0.14.1 # via datapackage, djangorestframework-csv, pyxform, tableschema, tabulator unittest2==1.1.0 # via pyxform uritemplate==3.0.0 # via google-api-python-client urllib3==1.21.1 # via requests uwsgi==2.0.15 -xlrd==1.1.0 +xlrd==1.1.0 # via pyxform, tabulator xlwt==1.2.0 diff --git a/requirements/dev.pip b/requirements/dev.pip index de2f33a341..1ecdc288e5 100644 --- a/requirements/dev.pip +++ b/requirements/dev.pip @@ -8,6 +8,7 @@ -e git+https://github.com/onaio/django-multidb-router.git@django-1.11#egg=django-multidb-router -e git+https://github.com/jbalogh/django-nose.git#egg=django-nose -e git+https://github.com/bfirsh/django-ordered-model.git@master#egg=django-ordered-model +-e file:///home/mosh/ona/onadata -e git+https://github.com/onaio/floip-py.git@master#egg=floip -e git+https://github.com/onaio/python-json2xlsclient.git#egg=python-json2xlsclient alabaster==0.7.10 # via sphinx @@ -20,7 +21,7 @@ backports.functools-lru-cache==1.4 # via astroid, pylint backports.shutil-get-terminal-size==1.0.0 # via ipython billiard==3.3.0.23 # via celery cchardet==1.1.3 # via datapackage, tabulator -celery==3.1.25 +celery==3.1.25 # via django-celery certifi==2017.4.17 # via requests chardet==3.0.3 # via requests click==6.7 # via datapackage, tableschema, tabulator @@ -45,13 +46,13 @@ django-render-block==0.5 # via django-templated-email django-reversion==2.0.8 django-taggit==0.22.1 django-templated-email==2.2.0 -django==1.11.11 +django==1.11.11 # via django-celery, django-debug-toolbar, django-oauth-toolkit, django-query-builder, django-render-block, django-reversion, djangorestframework-jsonapi, jsonfield djangorestframework-csv==2.0.0 djangorestframework-gis==0.11.2 djangorestframework-jsonapi==2.4.0 djangorestframework-jsonp==1.0.2 djangorestframework-xml==1.3.0 -djangorestframework==3.6.3 +djangorestframework==3.6.3 # via djangorestframework-csv, djangorestframework-gis, djangorestframework-jsonapi docutils==0.13.1 # via sphinx dpath==1.4.0 elaphe==0.6.0 @@ -62,10 +63,11 @@ fleming==0.4.5 # via django-query-builder formencode==1.3.1 # via pyxform funcsigs==1.0.2 # via mock functools32==3.2.3.post2 # via jsonschema +future==0.16.0 geojson==1.3.5 google-api-python-client==1.6.2 httmock==1.2.6 -httplib2==0.10.3 +httplib2==0.10.3 # via google-api-python-client, oauth2client idna==2.5 # via requests ijson==2.3 # via tabulator imagesize==0.7.1 # via sphinx @@ -95,16 +97,16 @@ mock==2.0.0 modilabs-python-utils==0.1.5 nose==1.3.7 numpy==1.12.1 -oauth2client==4.1.0 +oauth2client==4.1.0 # via google-api-python-client oauthlib==2.0.1 # via django-oauth-toolkit olefile==0.44 # via pillow -openpyxl==2.4.8 +openpyxl==2.4.8 # via tabulator paho-mqtt==1.3.1 pathlib2==2.3.0 # via ipython, pickleshare pbr==3.0.1 # via mock pexpect==4.2.1 # via ipython pickleshare==0.7.4 # via ipython -pillow==4.1.1 +pillow==4.1.1 # via elaphe prompt-toolkit==1.0.14 # via ipython psycopg2==2.7.3.1 ptyprocess==0.5.2 # via pexpect @@ -120,14 +122,14 @@ pylint-django==0.7.2 pylint-plugin-utils==0.2.6 # via pylint-celery, pylint-django pylint==1.7.2 pymongo==3.4.0 -python-dateutil==2.6.0 +python-dateutil==2.6.0 # via fleming, tableschema python-digest==1.7 python-memcached==1.58 -pytz==2017.2 +pytz==2017.2 # via babel, celery, django, django-query-builder, fleming pyxform==0.10.0 raven==6.1.0 recaptcha-client==1.0.6 -requests==2.17.3 +requests==2.17.3 # via datapackage, httmock, sphinx, tableschema, tabulator rfc3986==1.1.0 # via tableschema rsa==3.4.2 # via oauth2client savreaderwriter==3.4.2 @@ -146,13 +148,13 @@ tabulator==1.11.1 # via datapackage, tableschema traceback2==1.4.0 # via unittest2 traitlets==4.3.2 # via ipython typing==3.6.1 # via sphinx -unicodecsv==0.14.1 +unicodecsv==0.14.1 # via datapackage, djangorestframework-csv, pyxform, tableschema, tabulator unittest2==1.1.0 # via pyxform uritemplate==3.0.0 # via google-api-python-client urllib3==1.21.1 # via requests uwsgi==2.0.15 wcwidth==0.1.7 # via prompt-toolkit wrapt==1.10.10 # via astroid -xlrd==1.1.0 +xlrd==1.1.0 # via pyxform, tabulator xlwt==1.2.0 yapf==0.16.3 From 071367371ca732865ec58f924fef2c6629d4ad02 Mon Sep 17 00:00:00 2001 From: Kelvin Jayanoris Date: Wed, 28 Mar 2018 12:40:22 +0300 Subject: [PATCH 4/5] Remove local `onadata` package reference --- requirements/base.pip | 1 - requirements/dev.pip | 1 - 2 files changed, 2 deletions(-) diff --git a/requirements/base.pip b/requirements/base.pip index 83b9061654..a30ad0b6d7 100644 --- a/requirements/base.pip +++ b/requirements/base.pip @@ -8,7 +8,6 @@ -e git+https://github.com/onaio/django-multidb-router.git@django-1.11#egg=django-multidb-router -e git+https://github.com/jbalogh/django-nose.git#egg=django-nose -e git+https://github.com/bfirsh/django-ordered-model.git@master#egg=django-ordered-model --e file:///home/mosh/ona/onadata -e git+https://github.com/onaio/floip-py.git@master#egg=floip -e git+https://github.com/onaio/python-json2xlsclient.git#egg=python-json2xlsclient alabaster==0.7.10 # via sphinx diff --git a/requirements/dev.pip b/requirements/dev.pip index 1ecdc288e5..43a2491c74 100644 --- a/requirements/dev.pip +++ b/requirements/dev.pip @@ -8,7 +8,6 @@ -e git+https://github.com/onaio/django-multidb-router.git@django-1.11#egg=django-multidb-router -e git+https://github.com/jbalogh/django-nose.git#egg=django-nose -e git+https://github.com/bfirsh/django-ordered-model.git@master#egg=django-ordered-model --e file:///home/mosh/ona/onadata -e git+https://github.com/onaio/floip-py.git@master#egg=floip -e git+https://github.com/onaio/python-json2xlsclient.git#egg=python-json2xlsclient alabaster==0.7.10 # via sphinx From 8838226442c8cefe6c98ae6f35cf8323d9669d52 Mon Sep 17 00:00:00 2001 From: Kelvin Jayanoris Date: Wed, 28 Mar 2018 12:56:39 +0300 Subject: [PATCH 5/5] Remove unnecessary dict --- setup.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index c06669f6d1..394b07483f 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ from setuptools import setup, find_packages -config = dict( +setup( name="onadata", version="1.13.0", description="Collect Analyze and Share Data!", @@ -106,7 +106,4 @@ "raven", "django-activity-stream", "paho-mqtt", - ] -) - -setup(**config) + ])