diff --git a/.gitignore b/.gitignore index 6aa3c74..e688c88 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ redi.pstats callgraph.svg mprofile_* private/ +.ropeproject/ diff --git a/.travis.yml b/.travis.yml index 2488103..7260e92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ + +# http://docs.travis-ci.com/user/migrating-from-legacy/ +sudo: false language: python python: - "2.7" before_install: - sudo apt-get install -y python-setuptools libxml2 libxslt1-dev python-dev + echo 'apt-get install -y libxml2 libxslt1-dev' install: - pip install requests - pip install lxml diff --git a/CHANGELOG b/CHANGELOG index b924ae3..8ea8533 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,23 @@ +2015-05-14 v0.14.2 + * Summary: Now RED-I can fetch more files initially and run pre-processors in a specific order. + + * Runs the dictionary of preprocessors in order sorted by their keys (module names). This is necessary when using multiple preprocessors that have ordered rules. Unsorted dictionaries have unpredictable ordering. (Nicholas Rejack) + * make clean: remove `.eggs` folder (Andrei Sura) + * Fixes #168 - add option to display version number (Andrei Sura) + * Moving logic for creating dictionary of files to download to __init__ method. Improved logging. (Nicholas Rejack) + * Updating TestGetEMRData.py to match new variable names in GetEmrData.py. (Nicholas Rejack) + * Updated GetEmrData.py to rename download_file variable to download_list and download_file function to download_files. (Nicholas Rejack) + * Fixing TestGetEMRData.py now that a new variable has been added to the EmrFileAccessDetails. (Nicholas Rejack) + * UpdatingGetEmrData.py with new functionality. Now, in settings.ini a dictionary of files to be downloaded can be specified for emr_data_file. (Nicholas Rejack) + * Changing variables in EmrFileAccessDetails for readability. (Nicholas Rejack) + * Update README.md (Christopher P. Barnes) + * Update README.md (Christopher P. Barnes) + * use travis in container (Andrei Sura) + * Add makefile tasks related to pypi (Andrei Sura) + * added RedHat/Fedora installation documentation. (Nicholas Rejack) + * bumping version number on docs/conf.py (Nicholas Rejack) + * repaired some broken text in about.rst in documentation. (Nicholas Rejack) + 2015-05-14 v0.14.2 * Summary: Preprocessing has been improved to use the rewritten raw CSV file after processing it. This relocates some of the XML processing from GetEMRData. diff --git a/Makefile b/Makefile index 1b692b7..f1c057d 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,9 @@ help: @echo "\t coverage - run code coverage analysis" @echo "\t lint - check code for sytax error" @echo "\t clean - remove generated files" - @echo "\t pypi - upload files to https://pypi.python.org/pypi/redi" + @echo "\t pypi_config - prepare the configuation for uploading the PyPi package" + @echo "\t pypi_register - register the package" + @echo "\t pypi_upload - upload the package https://pypi.python.org/pypi/redi" @echo "\t show_pips - show python packages installed globally" @echo "\t venv_help - show commands for installing 'redi' package in the 'venv' virtual environment" @echo "\t venv_show_pips - show python packages installed in the 'venv' virtual environment" @@ -37,7 +39,7 @@ lint: clean: find . -type f -name "*.pyc" -print | xargs rm -f - @rm -rf out dist build *.egg-info *.egg + @rm -rf out dist build *.egg-info .eggs @rm -rf nosetests.xml cover .coverage coverage.xml @rm -f pylint.out unittest_pysftp_rsa_key unittest_pysftp_rsa_key.pub destination_file source_file @rm -f formData.xml rawData.xml translationalData.xml rawDataWithFormName.xml rawDataWithFormCompletedField.xml @@ -45,9 +47,33 @@ clean: @rm -f all_form_events.xml person_form_event_tree.xml person_form_event_tree_with_data.xml @rm -f vagrant/redi.db config-example/report.xml redi.pstats mprofile_*.dat -pypi: - #https://pythonhosted.org/Distutils2/distutils/packageindex.html - python setup.py sdist register upload -r pypi +pypi_config: + @test -f ~/.pypirc || echo "Please create the ~/.pypirc file first. Here is a template: \n" + @test -f ~/.pypirc || (cat pypirc && exit 1) + +pypi_register: pypi_config + python setup.py register -r mdat + +pypi_upload: pypi_config + @# use secure submission: https://packaging.python.org/en/latest/distributing.html + which twine || pip install twine + #python setup.py sdist register upload -r redi + python setup.py sdist --formats=zip + twine upload dist/* -r mdat + @echo "Done. To test please execute:" + @echo "virtualenv venv && . venv/bin/activate && pip install redi && redi -h" + + +pypi_internal: + @# Test deployment on a local PyPi server + @# mkdir ~/packages && cd ~/packages + @# htpasswd -sc .htaccess tester + virtualenv venv && . venv/bin/activate + which pypi-server || pip install pypiserver + pypi-server -p 8080 -P .htaccess ~/packages & + python setup.py sdist register -r internal + python setup.py sdist upload -r internal + pip install --extra-index-url http://localhost:8080/simple/ redi show_pips: find /Library/Python/2.7/site-packages/ -maxdepth 2 -name __init__.py | cut -d '/' -f 6 diff --git a/docs/about.rst b/docs/about.rst index 6f2e273..f7ec168 100644 --- a/docs/about.rst +++ b/docs/about.rst @@ -106,43 +106,156 @@ Installing RED-I on Windows * Open a command prompt by clicking on the Start menu, and typing "cmd" in the Run box. * Install 64-bit Python 2.7.9 by running the following command in the command prompt: -
-msiexec /i https://www.python.org/ftp/python/2.7.9/python-2.7.9.amd64.msi -+ +.. raw:: html + +
+ msiexec /i https://www.python.org/ftp/python/2.7.9/python-2.7.9.amd64.msi ++ * Next you need to be insure the command interpreter will be able to find the Python modules. Set the paths to the modules by running the following commands in the command prompt: -
-setx path "%path%;c:\python27" -setx path "%path%;c:\python27\lib\site-packages" -setx path "%path%;c:\python27\scripts” -+ +.. raw:: html + +
+ setx path "%path%;c:\python27" + setx path "%path%;c:\python27\lib\site-packages" + setx path "%path%;c:\python27\scripts” ++ * Make a new directory for the RED-I files by running the following command in the command prompt: -
-mkdir c:\redi -+ +.. raw:: html + +
+ mkdir c:\redi ++ * Download the RED-I source code from: [https://github.com/ctsit/redi/archive/0.14.1.zip] * Copy the contents of the RED-I zip file from c:\Users\%username%\Downloads\redi-0.14.1\redi-0.14.1 to c:\redi * Download the easy_install setup file from: https://bootstrap.pypa.io/ez_setup.py * Run the easy_install setup file with the following command in the command prompt: -
-python c:\Users\%username%\Downloads\ez_setup.py -+ +.. raw:: html + +
+ python c:\Users\%username%\Downloads\ez_setup.py ++ Note: you may need to modify the path to the ez_setup.py file if it is downloaded to a different location. * Next, make a binary install of RED-I by running the following commands in the command prompt: -
-cd c:\redi -python c:\redi\setup.py bdist_egg -+ +.. raw:: html + +
+ cd c:\redi + python c:\redi\setup.py bdist_egg ++ * You will need to manually install the pycrypto dependency. To avoid having to compile it with VCForPython you can download a pre-compiled binary and install it with the following command: -
-c:\python27\scripts\easy_install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1.win-amd64-py2.7.exe -+ +.. raw:: html + +
+ c:\python27\scripts\easy_install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1.win-amd64-py2.7.exe ++ * Finally, install your binary of RED-I with the following command: -
-c:\python27\scripts\easy_install.exe c:\redi\dist\redi-0.14.1-py2.7.egg -+ +.. raw:: html + +
+ c:\python27\scripts\easy_install.exe c:\redi\dist\redi-0.14.1-py2.7.egg ++ +Installing RED-I on Red Hat and Fedora +---------------------------- +Download and install setuptools. Setuptools will aid you in installing the redi package. + +.. raw:: html + +
+ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && sudo python get-pip.py ++ +Note that you must have gcc (the Gnu Compiler Collection) to build RED-I. Check that you have gcc installed: + +.. raw:: html + +
+ gcc --version ++ +If gcc is not installed, install it: + +.. raw:: html + +
+ sudo yum install gcc ++ +Install the development libxslt, libxml2, and python-devel libraries. These allow you to build the redi source. + +.. raw:: html + +
+ sudo yum install libxslt-devel libxml2-devel python-devel ++ +Install redi using pip. + +.. raw:: html + +
+ sudo pip install redi ++ +RED-I is now be installed. + +If you get an error message while compiling pycrypto, you will need to install pycrypto separately: + +.. raw:: html + +
+ sudo yum install python-crypto ++ +* To use the example config, documentation, and other associated RED-I files, you will need to get files from the GitHub repository. You have two options: + +1. Clone the repo by using Git. + +.. raw:: html + +
+ yum install git ++ +Set up your install of Git to use the key on your GitHub account. Instructions are at: https://help.github.com/articles/generating-ssh-keys/ + +Now, clone the redi git repo: + +.. raw:: html + +
+ clone git@github.com:ctsit/redi.git ++ +You now have a directory called redi with the source, docs, example configuration and other RED-I files. + +2. Download the zip file + +.. raw:: html + +
+ wget https://github.com/ctsit/redi/archive/master.zip + sudo yum install unzip + unzip master.zip ++ +* You now have a directory called redi-master with the source, docs, example configuration and other RED-I files. How to Test RED-I with a Sample Project --------------------------------------- diff --git a/docs/conf.py b/docs/conf.py index ff12d83..d166cae 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -61,9 +61,9 @@ # built documents. # # The short X.Y version. -version = '0.11.3' +version = '0.14.2' # The full version, including alpha/beta/rc tags. -release = '0.11.3' +release = '0.14.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/redi_usage.rst b/docs/redi_usage.rst index c3ebeab..7ca86ec 100644 --- a/docs/redi_usage.rst +++ b/docs/redi_usage.rst @@ -10,6 +10,20 @@ Optional command-line arguments: -------------------------------- - -h, --help: show the help message + +- -v, --verbose: increase verbosity of output + + :: + + $ redi -v + +- -V, --version: Show version number + + :: + + $ redi -V + + - -c: Specify the path to the configuration folder. :: @@ -24,7 +38,7 @@ Optional command-line arguments: :: - $ redi -k + $ redi -k When this parameter is provided, the output files are stored in **/out/out\_