diff --git a/.travis.yml b/.travis.yml index bd5f024d5..09b69fc6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,77 +1,76 @@ # -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013, 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. notifications: email: false services: - mysql - rabbitmq - redis - mongodb language: python python: - "2.6" - "2.7" install: - "sudo add-apt-repository -y ppa:chris-lea/node.js" - "sudo apt-get update" - "sudo apt-get -q install apache2 libapache2-mod-wsgi ssl-cert poppler-utils git subversion nodejs --fix-missing" - "sudo a2enmod actions" - "sudo a2enmod version" - "sudo a2enmod rewrite" - "sudo mkdir /etc/apache2/ssl" - "sudo /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem" - - "travis_retry pip install . --process-dependency-links --allow-all-external --quiet" - - "travis_retry pip install -r requirements-docs.txt --allow-all-external --quiet" + - "travis_retry pip install -r requirements-docs.txt --quiet" - "pybabel compile -f -d invenio/base/translations/" - "inveniomanage config create secret-key" - "inveniomanage config set CFG_EMAIL_BACKEND flask.ext.email.backends.console.Mail" - "inveniomanage config set CFG_BIBSCHED_PROCESS_USER `whoami`" - "inveniomanage config set PACKAGES_EXCLUDE []" # test all packages - "inveniomanage config set CFG_TMPDIR /tmp" - "sudo su -c \"npm install --silent -g bower grunt-cli\"" - "npm install --silent" - "inveniomanage config set CLEANCSS_BIN `find $PWD/node_modules -iname \"cleancss\" | grep \"\\.bin\" | head -1`" - "inveniomanage config set LESS_BIN `find $PWD/node_modules -iname \"lessc\" | grep \"\\.bin\" | head -1`" - "bower install" - "travis_retry grunt" - "inveniomanage collect" before_script: - "inveniomanage apache create-config" - "sudo ln -s $VIRTUAL_ENV/var/invenio.base-instance/apache/invenio-apache-vhost.conf /etc/apache2/sites-enabled/invenio.conf" - "sudo ln -s $VIRTUAL_ENV/var/invenio.base-instance/apache/invenio-apache-vhost-ssl.conf /etc/apache2/sites-enabled/invenio-ssl.conf" - "sudo /usr/sbin/a2dissite default || echo ':('" # - "sudo /usr/sbin/a2ensite invenio || echo ':('" # enable Invenio web site # - "sudo /usr/sbin/a2ensite invenio-ssl || echo ':('" # enable Invenio secure web site - "sudo /usr/sbin/a2enmod ssl" # enable SSL module - "sudo /usr/sbin/a2enmod xsendfile || echo ':('" - "sudo apachectl configtest && sudo service apache2 restart || echo 'Apache failed ...'" - "inveniomanage database init --yes-i-know || echo ':('" - "inveniomanage database create || echo ':('" # - "inveniomanage demosite create" # - "inveniomanage demosite populate" script: - "python setup.py test && sphinx-build -qnNW docs docs/_build/html" # - "wget -O /dev/null http://localhost" diff --git a/INSTALL.rst b/INSTALL.rst index 7c6cac519..47129284e 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -1,251 +1,251 @@ Invenio INSTALLATION ==================== About ----- This document specifies how to quickly install Invenio v2.0.0 for the first time. See RELEASE-NOTES if you are upgrading from a previous Invenio release. Prerequisites ------------- Here is the software you need to have around before you start installing Invenio for development. Unix-like operating system. The main development and production platforms for Invenio at CERN are GNU/Linux distributions Debian, Gentoo, Scientific Linux (RHEL-based), Ubuntu, but we also develop on Mac OS X. Basically any Unix system supporting the software listed below should do. If you are using Ubuntu 13.10 or later, then you can install Invenio by following this tutorial. **Note:** the recommended Python version is 2.7.5+ .. code-block:: console $ python --version Python 2.7.5+ $ sudo apt-get update $ sudo apt-get install mysql-server redis-server \ libmysqlclient-dev libxml2-dev libxslt-dev \ libjpeg-dev libfreetype6-dev libtiff-dev \ software-properties-common python-dev \ virtualenvwrapper build-essential git $ sudo pip install -U virtualenvwrapper pip $ source .bashrc MySQL Server asked you for a password, you will need it later and we will refer to it as ``$MYSQL_ROOT``. `node.js `_ and `npm `_ from Ubuntu are troublesome so we recommend you to install them from Chris Lea's PPA. .. code-block:: console $ sudo add-apt-repository ppa:chris-lea/node.js $ sudo apt-get update $ sudo apt-get install nodejs $ sudo su -c "npm install -g bower grunt-cli" For futher tutorial you will need to check that you have ``git-new-workdir``. .. code-block:: console $ mkdir -p $HOME/bin $ which git-new-workdir || { \ wget https://raw.github.com/git/git/master/contrib/workdir/git-new-workdir \ -O $HOME/bin/git-new-workdir; chmod +x $HOME/bin/git-new-workdir; } **NOTE:** Check that ``~/bin`` is in your ``$PATH``. .. code-block:: console $ export PATH+=:$HOME/bin Quick instructions for the impatient Invenio admin -------------------------------------------------- a. Installation ~~~~~~~~~~~~~~~ The first step of the installation is to download the development version of Invenio. This development is done in the ``pu`` branch. .. code-block:: console $ cd $HOME/src/ $ export BRANCH=pu $ git clone https://github.com/jirikuncar/invenio.git We recommend to work using `virtual environments `_ so packages are installed locally and it will make your live easier. ``(invenio)$`` tells your that the *invenio* environment is the active one. .. code-block:: console $ mkvirtualenv invenio (invenio)$ # we are in the invenio environment now and (invenio)$ # can leave it using the deactivate command. (invenio)$ deactivate $ # Now join it back, recreating it would fail. $ workon invenio (invenio)$ # That's all there is to know about it. Let's install Invenio in the environment just created. .. code-block:: console (invenio)$ cdvirtualenv (invenio)$ mkdir src; cd src (invenio)$ git-new-workdir $HOME/src/invenio/ invenio $BRANCH (invenio)$ cd invenio Installing the Python dependencies. .. code-block:: console (invenio)$ pip install -e . --process-dependency-links --allow-all-external Some modules may require specific dependencies listed in the ``requirements-[dev,img,mongo,...].txt`` files. Pick the ones you need. E.g. to add images support, we can do as follow: .. code-block:: console (invenio)$ pip install -r requirements-img.txt Compiling the translations. .. code-block:: console (invenio)$ pybabel compile -fd invenio/base/translations/ Installing the npm dependencies and the external JavaScript and CSS libraries. .. code-block:: console (invenio)$ npm install (invenio)$ bower install ``grunt`` and ``inveniomanage collect`` will create the static folder with all the required assets (JavaScript, CSS and images) from each module static folder and bower. .. code-block:: console (invenio)$ grunt (invenio)$ inveniomanage collect b. Configuration ~~~~~~~~~~~~~~~~ Generate the secret key for your installation. .. code-block:: console (invenio)$ inveniomanage config create secret-key If you are planning to develop localy in multiple environments please run the following commands. .. code-block:: console (invenio)$ inveniomanage config set CFG_EMAIL_BACKEND flask.ext.email.backends.console.Mail (invenio)$ inveniomanage config set CFG_BIBSCHED_PROCESS_USER $USER (invenio)$ inveniomanage config set CFG_DATABASE_NAME $BRANCH (invenio)$ inveniomanage config set CFG_DATABASE_USER $BRANCH (invenio)$ inveniomanage config set CFG_SITE_URL http://0.0.0.0:4000 Assets in non-development mode may be combined and minified using various filters (see :ref:`ext_assets`). We need to set the path to the binaries if they are not in the environment ``$PATH`` already. .. code-block:: console (invenio)$ inveniomanage config set LESS_BIN `find $PWD/node_modules -iname lessc | head -1` (invenio)$ inveniomanage config set CLEANCSS_BIN `find $PWD/node_modules -iname cleancss | head -1` Invenio comes with default demo site configuration examples that you can use for quick start. .. code-block:: console (invenio)$ cd $HOME/src/ (invenio)$ git clone https://github.com/inveniosoftware/invenio-demosite.git (invenio)$ cdvirtualenv src (invenio)$ git-new-workdir ~/src/invenio-demosite/ invenio-demosite $BRANCH (invenio)$ cd invenio-demosite - (invenio)$ pip install -e . + (invenio)$ pip install -r requirements.txt c. Development ~~~~~~~~~~~~~~ Once you have everything installed you can create database and populate it with demo records. .. code-block:: console (invenio)$ inveniomanage database init --user=root --password=$MYSQL_ROOT --yes-i-know (invenio)$ inveniomanage database create (invenio)$ inveniomanage demosite create Now you should be able to run the development server. Invenio uses `Celery `_ and `Redis `_ which must be running alongside with the web server. .. code-block:: console $ # make sure that redis is running $ sudo service redis-server status redis-server is running $ # or start it with start $ sudo service redis-start start $ # launch celery $ workon invenio (invenio)$ celeryd -E -A invenio.celery.celery --workdir=$VIRTUAL_ENV $ # in a new terminal $ workon invenio (invenio)$ inveniomanage runserver * Running on http://0.0.0.0:4000/ * Restarting with reloader **Troubleshooting:** As a developer, you may want to use the provided ``Procfile`` with `honcho `_. It starts all the services at once with nice colors. Be default, it also runs `flower `_ which offers a web interface to monitor the *Celery* tasks. .. code-block:: console (invenio)$ pip install flower When you have the servers running, it is possible to upload the demo records. .. code-block:: console $ # in a new terminal $ workon invenio (invenio)$ inveniomanage demosite populate And you may now open your favourite web browser on `http://0.0.0.0:4000/ `_ Optionally, if you are using Bash shell completion, then you may want to register python argcomplete for inveniomanage. .. code-block:: bash eval "$(register-python-argcomplete inveniomanage)" Good luck, and thanks for choosing Invenio. - Invenio Development Team diff --git a/docs/conf.py b/docs/conf.py index 00eb5899b..85146d18d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,317 +1,313 @@ # -*- coding: utf-8 -*- # # Invenio documentation build configuration file, created by # sphinx-quickstart on Fri Oct 11 10:18:35 2013. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """Sphinx configuration.""" from __future__ import print_function import os import sys -requirements = os.path.join(os.path.dirname(os.path.abspath(__file__)), - os.pardir, - "requirements-docs.txt") -_html_theme = open(requirements, "r").readline().strip() + +_html_theme = "sphinx_rtd_theme" _html_theme_path = [] try: - theme = __import__(_html_theme, globals(), locals(), [], -1) - _html_theme_path = [theme.get_html_theme_path()] + import sphinx_rtd_theme + _html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] except ImportError: - print("Template {0} not found, run:\n\n\tpip install -r {1}\n" - .format(_html_theme, requirements), - file=sys.stderr) + print("Template {0} not found, pip install it", file=sys.stderr) _html_theme = "default" # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) sys.path.append(os.path.abspath('_ext')) sys.path.append(os.path.abspath('_themes')) #sys.path.append(os.path.abspath('.')) sys.path.append(os.path.abspath('../invenio')) def setup(app): """Custom application tweaks.""" app.add_stylesheet("theme_overrides.css") # -- General configuration ---------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['flask_app', 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # Many pot files are generated under following directory. locale_dirs = ['locale/'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Invenio' copyright = u'2013, CERN' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.9999' # The full version, including alpha/beta/rc tags. release = '1.9999-dev' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. #html_theme = 'default' html_theme = _html_theme # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] html_theme_path = _html_theme_path # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. html_show_sourcelink = False # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'Inveniodoc' # -- Options for LaTeX output ------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', 'Invenio.tex', u'Invenio Documentation', u'CERN', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output ------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'invenio', u'Invenio Documentation', [u'CERN'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ----------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'Invenio', u'Invenio Documentation', u'CERN', 'Invenio', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # -- Options for Intersphinx mapping ------------------------------------------ # See intersphinx_mapping = { 'python': ('https://docs.python.org/2.7/', None), 'flaskregistry': ('http://flask-registry.readthedocs.org/en/latest/', None), #'flaskmenu': ('http://flask-menu.readthedocs.org/en/latest/', None), #'flaskbreadcrumbs': ( # 'http://flask-breadcrumbs.readthedocs.org/en/latest/', # None), 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None), 'flask': ('http://flask.pocoo.org/docs/', None), 'flaskassets': ('http://flask-assets.readthedocs.org/en/latest/', None), 'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None), 'jinja': ('http://jinja.pocoo.org/docs/', None), # FIXME not readable due to ValueError: unknown or unsupported inv version #'flasklogin': ('http://flask-login.readthedocs.org/en/latest/') } diff --git a/invenio/ext/debug_toolbar/__init__.py b/invenio/ext/debug_toolbar/__init__.py index 5617a6b8d..033060c06 100644 --- a/invenio/ext/debug_toolbar/__init__.py +++ b/invenio/ext/debug_toolbar/__init__.py @@ -1,55 +1,53 @@ # -*- coding: utf-8 -*- ## ## This file is part of Invenio. -## Copyright (C) 2013 CERN. +## Copyright (C) 2013, 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """ -Debug Toolbar Extension -======================= +Debug Toolbar Extension. Configuration ------------- -The toolbar support several configuration options: +The toolbar supports several configuration options: ==================================== ===================================== ========================== Name Description Default ==================================== ===================================== ========================== ``DEBUG_TB_ENABLED`` Enable the toolbar? ``app.debug`` ``DEBUG_TB_HOSTS`` Whitelist of hosts to display toolbar any host ``DEBUG_TB_INTERCEPT_REDIRECTS`` Should intercept redirects? ``True`` ``DEBUG_TB_PANELS`` List of module/class names of panels enable all built-in panels ``DEBUG_TB_PROFILER_ENABLED`` Enable the profiler on all requests ``False``, user-enabled ``DEBUG_TB_TEMPLATE_EDITOR_ENABLED`` Enable the template editor ``False`` ==================================== ===================================== ========================== For more information see http://flask-debugtoolbar.readthedocs.org/en/latest/ """ -from flask.ext.debugtoolbar import DebugToolbarExtension - def setup_app(app): - """ - Setup Flask application - """ + """Setup Flask with the DebugToolbar application.""" # Enable Flask Debug Toolbar early to also catch HTTPS redirects if app.debug: - from flask.ext.debugtoolbar import module - module.static_folder = 'static' - DebugToolbarExtension(app) + try: + from flask.ext.debugtoolbar import module, DebugToolbarExtension + module.static_folder = 'static' + DebugToolbarExtension(app) + except ImportError: + app.logger.exception("Flask-DebugToolbar is missing") return app diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index fe96c42d1..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,2 +0,0 @@ -ipython -ipdb diff --git a/requirements-docs.txt b/requirements-docs.txt index 67bf994dc..5c00e2285 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,3 @@ -sphinx_rtd_theme -r requirements.txt --r requirements-elasticsearch.txt --r requirements-img.txt --r requirements-sso.txt --r requirements-mongo.txt + +-e .[docs] diff --git a/requirements-elasticsearch.txt b/requirements-elasticsearch.txt deleted file mode 100644 index bfdd4470e..000000000 --- a/requirements-elasticsearch.txt +++ /dev/null @@ -1 +0,0 @@ -pyelasticsearch>=0.6.1 diff --git a/requirements-extras.txt b/requirements-extras.txt deleted file mode 100644 index 8a20160c1..000000000 --- a/requirements-extras.txt +++ /dev/null @@ -1,17 +0,0 @@ -http://sourceforge.net/projects/gnuplot-py/files/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz/download#egg=gnuplot-py-1.8 -pylint -http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download#egg=pychecker-0.8.19 -pep8 -selenium -winpdb -mock -cython -nose -nosexcover -flake8 -dropbox -oauth2client -apiclient -urllib3 -python-onedrive -python-openid diff --git a/requirements-img.txt b/requirements-img.txt deleted file mode 100644 index c07f0d7fa..000000000 --- a/requirements-img.txt +++ /dev/null @@ -1,2 +0,0 @@ -qrcode -Pillow diff --git a/requirements-mongo.txt b/requirements-mongo.txt deleted file mode 100644 index de4887b56..000000000 --- a/requirements-mongo.txt +++ /dev/null @@ -1 +0,0 @@ -pymongo diff --git a/requirements-sso.txt b/requirements-sso.txt deleted file mode 100644 index 53ed8e2d2..000000000 --- a/requirements-sso.txt +++ /dev/null @@ -1 +0,0 @@ -git+git://github.com/jirikuncar/flask-sso.git#egg=flask-sso-0.1 diff --git a/requirements.txt b/requirements.txt index 21e091df0..61fd6fd96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,74 +1,16 @@ -MySQL-python==1.2.5 -rdflib==2.4.2 -reportlab==2.5 -python-dateutil<=1.9999 -python-magic==0.4.2 -https://www.reportlab.com/ftp/pyRXP-1.16-daily-unix.tar.gz#egg=pyRXP-1.16 -numpy==1.7.0 -lxml==3.1.2 -mechanize==0.2.5 -python-Levenshtein==0.10.2 -http://pybrary.net/pyPdf/pyPdf-1.13.tar.gz#egg=pyPdf-1.13 -PyStemmer==1.3.0 -https://py-editdist.googlecode.com/files/py-editdist-0.3.tar.gz#egg=editdist-0.3 -feedparser==5.1.3 -BeautifulSoup==3.2.1 -beautifulsoup4==4.3.2 -python-twitter==0.8.7 -celery==3.0.17 -msgpack-python==0.3.0 -pyparsing==2.0.1 -git+git://github.com/lnielsen-cern/dictdiffer.git#egg=dictdiffer-0.0.3 -git+git://github.com/romanchyla/workflow.git@e41299579501704b1486c72cc2509a9f82e63ea6#egg=workflow-1.1.0 -requests==1.2.3 -PyPDF2 -rauth -unidecode -https://pyfilesystem.googlecode.com/files/fs-0.4.0.tar.gz#egg=fs-0.4.0 -libmagic==1.0 -Babel==1.3 -git+https://github.com/inveniosoftware/intbitset#egg=intbitset-2.0 -Jinja2==2.7.2 -SQLAlchemy==0.8.3 -Flask==0.10.1 -# Flask-WTF 0.9.5 doesn't support WTForms 2.0 as of yet. -WTForms>=1.0.5,<2.0 -fixture==1.5 -redis==2.8.0 -unittest2==0.5.1 -git+https://github.com/david-e/flask-admin.git@bootstrap3#egg=Flask-Admin-1.0.7 -Flask-Assets==0.9 -Flask-Babel==0.9 -Flask-Cache==0.12 -Flask-DebugToolbar==0.9.0 -Flask-Email==1.4.4 -Flask-Gravatar==0.4.0 -Flask-Login==0.2.7 -Flask-Principal==0.4.0 -Flask-RESTful==0.2.12 -Flask-OAuthlib==0.4.3 -#Flask-SQLAlchemy==1.0 -git+https://github.com/mitsuhiko/flask-sqlalchemy#egg=Flask-SQLAlchemy-1.99 -git+https://github.com/inveniosoftware/flask-menu.git#egg=Flask-Menu-0.1 -git+https://github.com/inveniosoftware/flask-breadcrumbs.git#egg=Flask-Breadcrumbs-0.1 -git+https://github.com/inveniosoftware/flask-registry.git#egg=Flask-Registry-0.1 -Flask-Script>=2.0.3 -#Flask-Testing==0.4 -https://github.com/jarus/flask-testing/zipball/master#egg=Flask-Testing-0.4.1 -Flask-WTF==0.9.5 -Cerberus==0.5 -#Flask-Collect>=0.2.2 -git+https://github.com/greut/Flask-Collect.git@setup-py-fix#egg=Flask-Collect-0.2.3-dev -Sphinx -alembic==0.6.2 -git+https://github.com/lnielsen-cern/setuptools-bower.git#egg=setuptools-bower-0.1 -pytz -#PyLD=0.5.0 + python 2.6 patches -git+https://github.com/inveniosoftware/pyld.git@python2.6#egg=PyLD-26.0.5.0-dev -SQLAlchemy-Utils<0.24.0 -wtforms-alchemy==0.12.6 -mock==1.0.1 -setuptools>=2.0 -httpretty==0.8.0 -raven==4.2.1 -six>=1.7.2 +-e git+git://github.com/lnielsen-cern/dictdiffer.git#egg=dictdiffer +-e hg+https://code.google.com/p/py-editdist/#egg=editdist +-e git+https://github.com/david-e/flask-admin.git@bootstrap3#egg=Flask-Admin +-e git+https://github.com/inveniosoftware/flask-breadcrumbs.git#egg=Flask-Breadcrumbs +-e git+https://github.com/greut/Flask-Collect.git@setup-py-fix#egg=Flask-Collect-dev +-e git+https://github.com/inveniosoftware/flask-menu.git#egg=Flask-Menu +-e git+https://github.com/inveniosoftware/flask-registry.git#egg=Flask-Registry +-e git+git://github.com/jirikuncar/flask-sso.git#egg=flask-sso +-e git+https://github.com/mitsuhiko/flask-sqlalchemy#egg=Flask-SQLAlchemy-dev +# requires numpy before it can be installed +#-e svn://svn.code.sf.net/p/gnuplot-py/code/trunk#egg=gnuplot-py +https://www.reportlab.com/ftp/pyRXP-1.16-daily-unix.tar.gz#egg=pyRXP +-e git+https://github.com/lnielsen-cern/setuptools-bower.git#egg=setuptools-bower +-e git+git://github.com/romanchyla/workflow.git@e41299579501704b1486c72cc2509a9f82e63ea6#egg=workflow + +-e .[development] diff --git a/setup.py b/setup.py index 988315edd..61cc68ff3 100644 --- a/setup.py +++ b/setup.py @@ -1,185 +1,254 @@ ## This file is part of Invenio. ## Copyright (C) 2013, 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """ -Invenio ------ - -Invenio is a digital library framework. And before you ask: -It's GNU/GPLv2 licensed! - -Invenio is Fun -`````````````` - -.. code:: python - - from invenio.base import create_app - app = create_app() - - if __name__ == "__main__": - app.run() - -And Easy to Setup -````````````````` - -.. code:: bash - - $ pip install invenio - $ inveniomanage runserver - * Running on http://localhost:4000/ +Invenio is Fun. Links -````` +----- * `website `_ -* `documentation `_ -* `development version `_ +* `documentation `_ +* `development version `_ """ -from __future__ import print_function -import glob import os -import re +import sys from setuptools import setup, find_packages -# Get the version string. Cannot be done with import! -with open(os.path.join('invenio', 'version.py'), 'rt') as f: - version = re.search( - '__version__\s*=\s*"(?P.*)"\n', - f.read() - ).group('version') - - -def match_feature_name(filename): - return re.match(r".*requirements-(\w+).txt$", filename).group(1) - - -def match_egg_name_and_version(dependency_link, version='>='): - eggname = re.sub(r'^.+://.*[@#&]egg=([^&]+).*$', r'\1', dependency_link) - return re.sub(r'-([\d\.]+(?:-dev)?)$', r'{0}\1'.format(version), eggname) - - -def read_requirements(filename='requirements.txt'): - req = [] - dep = [] - with open(filename, 'r') as f: - for line in f.readlines(): - line = line.strip() - if re.match('^(?:#|-r )', line): - continue - if '://' in line: - dep.append(str(line)) - req.append(match_egg_name_and_version(str(line))) - else: - req.append(str(line)) - return req, dep - +install_requires = [ + "alembic==0.6.2", + "Babel==1.3", + "BeautifulSoup==3.2.1", + "BeautifulSoup4==4.3.2", + "celery==3.0.17", + "Cerberus==0.5", + "dictdiffer==0.0.3", + "editdist==0.3", + "feedparser==5.1.3", + "fixture==1.5", + "Flask==0.10.1", + "Flask-Admin==1.0.7", + "Flask-Assets==0.9", + "Flask-Babel==0.9", + "Flask-Breadcrumbs==0.1", + "Flask-Cache==0.12", + "Flask-Collect>0.2.2", + "Flask-Email==1.4.4", + "Flask-Gravatar==0.4.0", + "Flask-Login==0.2.7", + "Flask-Menu==0.1", + "Flask-OAuthlib==0.4.3", + "Flask-Principal==0.4.0", + "Flask-Registry==0.1", + "Flask-RESTful==0.2.12", + "Flask-Script>=2.0.5", + "Flask-SQLAlchemy>1.9", + "Flask-WTF==0.9.5", + "fs==0.4.0", + "intbitset==2.0", + "Jinja2==2.7.2", + "libmagic==1.0", + "lxml==3.1.2", + "mechanize==0.2.5", + "msgpack-python==0.3.0", + "MySQL-python==1.2.5", + "numpy==1.7.0", + "pyparsing==2.0.1", + "python-Levenshtein==0.10.2", + "python-twitter==0.8.7", + "pyPDF==1.13", + "pyPDF2", + "PyLD>=0.5.2", + "pyRXP==1.16", + "pyStemmer==1.3.0", + # python-dateutil>=2.0 is only for Python3 + "python-dateutil>=1.5,<2.0", + "python-magic==0.4.6", + "pytz", + "rauth", + "raven==4.2.1", + "rdflib==2.4.2", + "redis==2.8.0", # Is it explicitly required? + "reportlab==2.5", + "requests==1.2.3", + "setuptools>=2.0", # dad? + "setuptools-bower==0.1", + "six>=1.7.2", + "Sphinx", + "SQLAlchemy==0.8.3", + "SQLAlchemy-Utils>=0.23.5,<0.24", + "unidecode", + "workflow==1.1.0", + # Flask-WTF 0.9.5 doesn't support WTForms 2.0 as of yet. + "WTForms>=1.0.5,<2.0", + "wtforms-alchemy==0.12.6" +] + + +extras_require = { + "docs": [ + "sphinx_rtd_theme" + ], + "development": [ + "Flask-DebugToolbar==0.9.0" + ], + "elasticsearch": [ + "pyelasticsearch>=0.6.1" + ], + "img": [ + "qrcode", + "Pillow" + ], + "mongo": [ + "pymongo" + ], + "misc": [ # was requirements-extras + "apiclient", # extra=cloud? + "dropbox", # extra=cloud? + "gnuplot-py==1.8", + "flake8", # extra=kwalitee? + "pep8", # extra=kwalitee? + "pychecker==0.8.19", # extra=kwalitee? + "pylint", # extra=kwalitee? + "nosexcover", # test? + "oauth2client", # extra=cloud? + "python-onedrive", # extra=cloud? + "python-openid", # extra=sso? + "urllib3", # extra=cloud? + ], + "sso": [ + "flask-sso==0.1" + ] +} + +extras_require["docs"] += extras_require["elasticsearch"] +extras_require["docs"] += extras_require["img"] +extras_require["docs"] += extras_require["mongo"] +extras_require["docs"] += extras_require["sso"] + +tests_require = [ + "httpretty==0.8.0", + "Flask-Testing==0.4.1", + "mock", + "nose", + "selenium", + "unittest2==0.5.1", +] + + +# Compatibility with Python 2.6 +if sys.version_info < (2, 7): + install_requires += [ + "argparse", + "importlib" + ] -install_requires, dependency_links = read_requirements() -# Finds all `requirements-*.txt` files and prepares dictionary with extra -# requirements (NOTE: no links are allowed here!) -extras_require = dict(map( - lambda filename: (match_feature_name(filename), - read_requirements(filename)[0]), - glob.glob('requirements-*.txt') + - glob.glob('invenio/modules/*/requirements-*.txt'))) +# Get the version string. Cannot be done with import! +g = {} +with open(os.path.join("invenio", "version.py"), "rt") as fp: + exec(fp.read(), g) +version = g["__version__"] packages = find_packages(exclude=['docs']) packages.append('invenio_docs') setup( name='Invenio', version=version, - url='http://invenio-sofrware.org/repo/invenio', + url='https://github.com/inveniosoftware/invenio', license='GPLv2', author='CERN', author_email='info@invenio-software.org', description='Digital library software', long_description=__doc__, packages=packages, package_dir={'invenio_docs': 'docs'}, include_package_data=True, zip_safe=False, platforms='any', entry_points={ 'console_scripts': [ 'inveniomanage = invenio.base.manage:main', 'plotextractor = invenio.utils.scripts.plotextractor:main', - ## Legacy + # Legacy 'alertengine = invenio.legacy.webalert.scripts.alertengine:main', 'batchuploader = invenio.legacy.bibupload.scripts.batchuploader', 'bibcircd = invenio.legacy.bibcirculation.scripts.bibcircd:main', 'bibauthorid = invenio.legacy.bibauthorid.scripts.bibauthorid:main', 'bibclassify = invenio.modules.classifier.scripts.classifier:main', 'bibconvert = invenio.legacy.bibconvert.scripts.bibconvert:main', 'bibdocfile = invenio.legacy.bibdocfile.scripts.bibdocfile:main', 'bibedit = invenio.legacy.bibedit.scripts.bibedit:main', 'bibencode = invenio.modules.encoder.scripts.encoder:main', 'bibindex = invenio.legacy.bibindex.scripts.bibindex:main', 'bibmatch = invenio.legacy.bibmatch.scripts.bibmatch:main', 'bibrank = invenio.legacy.bibrank.scripts.bibrank:main', 'bibrankgkb = invenio.legacy.bibrank.scripts.bibrankgkb:main', 'bibreformat = invenio.legacy.bibformat.scripts.bibreformat:main', 'bibsort = invenio.legacy.bibsort.scripts.bibsort:main', 'bibsched = invenio.legacy.bibsched.scripts.bibsched:main', 'bibstat = invenio.legacy.bibindex.scripts.bibstat:main', 'bibtaskex = invenio.legacy.bibsched.scripts.bibtaskex:main', 'bibtasklet = invenio.legacy.bibsched.scripts.bibtasklet:main', 'bibupload = invenio.legacy.bibupload.scripts.bibupload:main', 'dbexec = invenio.legacy.miscutil.scripts.dbexec:main', 'dbdump = invenio.legacy.miscutil.scripts.dbdump:main', 'docextract = invenio.legacy.docextract.scripts.docextract:main', 'elmsubmit = invenio.legacy.elmsubmit.scripts.elmsubmit:main', 'gotoadmin = invenio.modules.redirector.scripts.redirector:main', 'inveniocfg = invenio.legacy.inveniocfg:main', 'inveniogc = invenio.legacy.websession.scripts.inveniogc:main', 'inveniounoconv = invenio.legacy.websubmit.scripts.inveniounoconv:main', 'oaiharvest = invenio.legacy.oaiharvest.scripts.oaiharvest:main', 'oairepositoryupdater = invenio.legacy.oairepository.scripts.oairepositoryupdater:main', 'refextract = invenio.legacy.refextract.scripts.refextract:main', 'textmarc2xmlmarc = invenio.legacy.bibrecord.scripts.textmarc2xmlmarc:main', 'webaccessadmin = invenio.modules.access.scripts.webaccessadmin:main', 'webauthorprofile = invenio.legacy.webauthorprofile.scripts.webauthorprofile:main', 'webcoll = invenio.legacy.websearch.scripts.webcoll:main', 'webmessageadmin = invenio.legacy.webmessage.scripts.webmessageadmin:main', 'webstatadmin = invenio.legacy.webstat.scripts.webstatadmin:main', 'websubmitadmin = invenio.legacy.websubmit.scripts.websubmitadmin:main', 'xmlmarc2textmarc = invenio.legacy.bibrecord.scripts.xmlmarc2textmarc:main', 'xmlmarclint = invenio.legacy.bibrecord.scripts.xmlmarclint:main', ], "distutils.commands": [ "inveniomanage = invenio.base.setuptools:InvenioManageCommand", ] }, install_requires=install_requires, - dependency_links=dependency_links, extras_require=extras_require, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: GPLv2 License', 'Operating System :: OS Independent', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], - test_suite='invenio.testsuite.suite' + test_suite='invenio.testsuite.suite', + tests_require=tests_require )