Skip to content

Commit

Permalink
Python 2.6 and docu fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Feb 5, 2015
1 parent f53c7ba commit ff94176
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 34 deletions.
Binary file added dist/pyrfc-1.9.4-py2.6-linux-x86_64.egg
Binary file not shown.
Binary file modified dist/pyrfc-1.9.4-py2.7-linux-x86_64.egg
Binary file not shown.
64 changes: 35 additions & 29 deletions doc/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Toolchain preparation
Linux platform
---------------
* :ref:`Install Python <install-python-linux>`
* Install ``easy_install`` as described in :ref:`pyrfc installation <install-python-connector>`
* :ref:`Install SAP NW RFC Library <install-c-connector>`
* To get any software from the Git source control system the Git
client is required as well, use whatever your distribution has
Expand All @@ -26,6 +27,7 @@ Windows platform
-----------------

* :ref:`Install Python <install-python-win>`
* Install ``easy_install`` as described in :ref:`pyrfc installation <install-python-connector>`
* :ref:`Install SAP NW RFC Library <install-c-connector>`
* To get any software from the Git source control system the Git
client is required as well. Download and install from
Expand Down Expand Up @@ -54,20 +56,20 @@ Otherwise, follow the example below.
Linux platform
--------------

Clone the repository
Clone the repository:

.. code-block:: sh
.. code-block:: sh
git clone https://github.com/SAP/PyRFC
git clone https://github.com/SAP/PyRFC
Edit ``setup.py`` and set the CYTHON_VERSION

Build the distribution

.. code-block:: sh
.. code-block:: sh
python setup.py clean --all
python setup.py bdist_egg
python setup.py clean --all
python setup.py bdist_egg
The result is found in the ``dist/`` directory. The process has to be done on all platforms
for which we provide eggs.
Expand All @@ -78,27 +80,27 @@ Windows platform

Open the ``GIT Bash`` shell and clone the repository.

.. code-block:: sh
.. code-block:: sh
git clone https://github.com/SAP/PyRFC
git clone https://github.com/SAP/PyRFC
Open the ``CMD Shell`` from ``Microsoft Windows SDK 7.0`` and change to cloned ``pyrfc`` folder.

Edit ``setup.py`` and set the CYTHON_VERSION

Set env variables for the release, use /x64 for 64 bit and /x86 for 32 bit:

.. code-block:: sh
.. code-block:: sh
set DISTUTILS_USE_SDK=1
setenv /x64 /release
set DISTUTILS_USE_SDK=1
setenv /x64 /release
Build the distribution:

.. code-block:: sh
.. code-block:: sh
python setup.py clean --all
python setup.py bdist_egg
python setup.py clean --all
python setup.py bdist_egg
Check the ``pyrfc\dist`` folder for a new created egg.

Expand All @@ -114,11 +116,11 @@ the PATH variable.
However, the PATH variable is modified when using a virtual environment, therefore
modify the ``Scripts/activate.bat`` file with:

.. code-block:: sh
.. code-block:: sh
set SAPNWRFC_HOME=C:\nwrfcsdk_x86
set PATH=C:\nwrfcsdk_x86\lib\;%PATH%
set PATH=%VIRTUAL_ENV%\Scripts;%PATH%
set SAPNWRFC_HOME=C:\nwrfcsdk_x86
set PATH=C:\nwrfcsdk_x86\lib\;%PATH%
set PATH=%VIRTUAL_ENV%\Scripts;%PATH%
This assures that specific SAP NW RFC Library is used (e.g. 32bit in this example).
This is not required for building the distribution, but rather for importing the Python connector.
Expand All @@ -131,11 +133,11 @@ Python 3

Prerequisites for building on Python 3, tested on Linux Mint and Ubuntu

.. code-block:: sh
.. code-block:: sh
sudo apt-get install python3-setuptools python3-dev python-configparser
sudo easy_install3 pip
sudo pip3 install cython sphinx ipython
sudo apt-get install python3-setuptools python3-dev python-configparser
sudo easy_install3 pip
sudo pip3 install cython sphinx ipython
Building the documentation
Expand All @@ -145,26 +147,30 @@ Ensure that the lib directory of the SAP NW RFC library is in your PATH environm

Change into the ``doc`` directory and type:

.. code-block:: sh
.. code-block:: sh
make clean
make html
make clean
make html
The result is found in ``_build/html`` and for other options call ``make``.

* If you get an error *'sphinx-build' is not recognized as an internal or external command, operable program or batch file* on calling ``make html``, install ``sphinx``
* If you have DLL import errors (Windows), check the lib directory of the SAP NW RFC Library PATH env variable.

GitHub Pages
------------

The docu is hosted on GitHub Pages, a propietary solution where a git branch ``gh-pages`` is created
as an orphan and the output of the documentation build process (``_build/html``) is stored in that branch.

GitHub then serves these files under a special ``/pages/`` url.

To update GitHub Pages, copy everyhing under ``_build/html`` and overwrite the existing files in the ``gh-pages`` branch root.

.. code-block:: sh
cp _build/html ~/tmp
git checkout gh-pages
rm -Rf *.html *.js *.egg build doc _* pyrfc* *.inv
cp -Rf ~/tmp/_build/html/. .
.. note::

An additional file .nojekyll is placed in ``gh-pages`` to disable the default GitHub processing which breaks sphinx style folders with leading underscores.
Expand Down
21 changes: 20 additions & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,26 @@ Python on Linux
.. _`install-python-linux`:

* Install Python 2.7 (64bit, usually the default) via your preferred package manager
and ``easy_install``.

* Install ``easy_install``

Use the ``distribute`` implementation of ``easy_install`` by downloading
https://bootstrap.pypa.io/ez_setup.py and running

.. code-block:: none
python ez_setup.py
.. note::

At this point you may like to install the `pip`_ package which extends
the functionality of ``easy_install``. However, ``pip`` cannot handle binary
build distributions, which will be used later.

If you are in a internal network that uses a proxy to access resources from
the internet, you may encounter :ref:`connection problems<install-problems>`.

.. _pip: http://pypi.python.org/pypi/pip

* Virtual environment (optional)

Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Note: Historically, the default setup.py did _not_ contain cython requirements.
# To build just the extensions inplace, use:
# python setup.py build_ext --inplace
CYTHON_VERSION = '0.21.1' # fixed to assure conscious change of version.
CYTHON_VERSION = '0.21.2' # fixed to assure conscious change of version.
try:
import Cython
except ImportError:
Expand All @@ -41,12 +41,12 @@ def _read(name):
if sys.platform.startswith('linux'):
LIBS = ['sapnwrfc', 'sapucum']
MACROS = [('NDEBUG', None), ('_LARGEFILE_SOURCE', None), ('_FILE_OFFSET_BITS', 64), ('SAPonUNIX', None), ('SAPwithUNICODE', None) , ('SAPwithTHREADS', None), ('SAPonLIN', None)]
COMPILE_ARGS = ['-Wall', '-O2', '-fexceptions', '-funsigned-char', '-fno-strict-aliasing', '-Wall', '-Wno-uninitialized', '-Wcast-align', '-fPIC', '-pthread', '-minline-all-stringops', '-I{}/include'.format(SAPNWRFC_HOME)]
LINK_ARGS = ['-L{}/lib'.format(SAPNWRFC_HOME)]
COMPILE_ARGS = ['-Wall', '-O2', '-fexceptions', '-funsigned-char', '-fno-strict-aliasing', '-Wall', '-Wno-uninitialized', '-Wcast-align', '-fPIC', '-pthread', '-minline-all-stringops', '-I{0}/include'.format(SAPNWRFC_HOME)]
LINK_ARGS = ['-L{0}/lib'.format(SAPNWRFC_HOME)]
elif sys.platform.startswith('win'):
LIBS = ['sapnwrfc', 'libsapucum']
MACROS = [('_LARGEFILE_SOURCE', None), ('SAPwithUNICODE', None), ('_CONSOLE', None), ('WIN32', None), ('SAPonNT', None), ('SAP_PLATFORM_MAKENAME', 'ntintel'), ('UNICODE', None), ('_UNICODE', None)]
COMPILE_ARGS = ['-I{}\\include'.format(SAPNWRFC_HOME)]
COMPILE_ARGS = ['-I{0}\\include'.format(SAPNWRFC_HOME)]
#LINK_ARGS = ['-L{}\\lib'.format(SAPNWRFC_HOME)] # JK: Does not work with MS VS8.0 Linker, works with MinGW?
LINK_ARGS = ['-LIBPATH:{0}\\lib'.format(SAPNWRFC_HOME)]

Expand All @@ -69,6 +69,7 @@ def _read(name):
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Cython',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
Expand Down

0 comments on commit ff94176

Please sign in to comment.