-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
3,173 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
OS := $(shell uname) | ||
VERSION = `cat VERSION` | ||
default: | ||
@echo | ||
@echo "Available tasks:" | ||
@echo | ||
@echo "inst - (re)installs dependencies" | ||
@echo "wheel - build & install wheel" | ||
@echo "egg - build & install egg" | ||
@echo "test - test" | ||
|
||
.PHONY: inst | ||
inst: inst2 inst3 | ||
|
||
.PHONY: inst2 | ||
inst2: pip2 install --user cython pytest | ||
|
||
.PHONY: inst3 | ||
inst3: pip3 install --user cython pytest | ||
|
||
.PHONY: test | ||
test: test2 test3 | ||
|
||
.PHONY: test2 | ||
test2: | ||
python2 -m pytest -vv | ||
|
||
.PHONY: test3 | ||
test3: | ||
python3 -m pytest -vv | ||
|
||
.PHONY: wheel | ||
wheel: wheel2 wheel3 | ||
|
||
.PHONY: wheel2 | ||
wheel2: wheel2 | ||
-yes | pip2 uninstall pyrfc | ||
python2 setup.py bdist_wheel | ||
pip2 install --user dist/pyrfc-$(VERSION)-cp27-cp27mu-linux_x86_64.whl | ||
#pip2 install --user dist/pyrfc-$(VERSION)-cp35-cp35m-win_amd64.whl | ||
|
||
.PHONY: wheel3 | ||
wheel3: wheel3 | ||
-yes | pip3 uninstall pyrfc | ||
python3 setup.py bdist_wheel | ||
pip3 install --user dist/pyrfc-$(VERSION)-cp35-cp35m-linux_x86_64.whl | ||
#pip2 install --user dist/pyrfc-$(VERSION)-cp27-cp27m-win_amd64.whl | ||
|
||
.PHONY: egg | ||
egg: egg2 egg3 | ||
|
||
.PHONY: egg2 | ||
egg2: | ||
-yes | pip2 uninstall pyrfc | ||
python2 setup.py bdist_egg | ||
python2 setup.py install --user | ||
|
||
.PHONY: egg3 | ||
egg3: | ||
-yes | pip3 uninstall pyrfc | ||
python3 setup.py bdist_egg | ||
python3 setup.py install --user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.9.4 | ||
1.9.5 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
DSP = { | ||
"user" : "demo", | ||
"passwd" : "welcome", | ||
"ashost" : "10.68.104.164", | ||
"sysnr" : "00", | ||
"client" : "620", | ||
"lang" : "EN" | ||
} | ||
|
||
from platform import system, release | ||
from sys import version_info | ||
from pyrfc import * | ||
|
||
|
||
conn = Connection(**DSP) | ||
dates = conn.call('BAPI_USER_GET_DETAIL', USERNAME='demo')['LASTMODIFIED'] | ||
d = dates['MODDATE'] | ||
t = dates['MODTIME'] | ||
del conn | ||
|
||
conn = Connection(config={'dtime': True}, **DSP) | ||
dates = conn.call('BAPI_USER_GET_DETAIL', USERNAME='demo')['LASTMODIFIED'] | ||
dd = dates['MODDATE'] | ||
dt = dates['MODTIME'] | ||
|
File renamed without changes.
0
tests/test_issue13.py → material/test_issue13.py
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
testpaths = tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,88 @@ | ||
|
||
import os | ||
import sys | ||
from setuptools import setup, find_packages | ||
from distutils.extension import Extension | ||
# Cython import | ||
# 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.25.2' # fixed to assure conscious change of version. | ||
try: | ||
import Cython.Distutils | ||
except ImportError: | ||
sys.exit("Cython not installed. Please install version {}.".format(CYTHON_VERSION)) | ||
|
||
# SAP NW RFC SDK dependency | ||
SAPNWRFC_HOME = os.environ.get('SAPNWRFC_HOME') | ||
if not SAPNWRFC_HOME: | ||
sys.exit("Environment variable SAPNWRFC_HOME not set. Please specify this variable with the root directory of the SAP NW RFC Library.") | ||
# Python sources | ||
PYTHONSOURCE = os.environ.get('PYTHONSOURCE') | ||
if not PYTHONSOURCE: | ||
sys.exit("Environment variable PYTHONSOURCE not set. Please specify this variable with the root directory of the PYTHONSOURCE Library.") | ||
|
||
|
||
NAME = 'pyrfc' | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
def _read(name): | ||
f = open(os.path.join(here, name)) | ||
return f.read() | ||
|
||
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)] | ||
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), '-I{}\\Include'.format(PYTHONSOURCE), '-I{}\\Include\\PC'.format(PYTHONSOURCE)] | ||
#LINK_ARGS = ['-L{}\\lib'.format(SAPNWRFC_HOME)] # JK: Does not work with MS VS8.0 Linker, works with MinGW? | ||
LINK_ARGS = ['-LIBPATH:{}\\lib'.format(SAPNWRFC_HOME), '-LIBPATH:{}\\PCbuild'.format(PYTHONSOURCE)] | ||
|
||
pyrfc = Extension( '%s._%s' % (NAME, NAME) | ||
, ['%s/_%s.pyx' % (NAME, NAME)] | ||
, libraries=LIBS | ||
, define_macros=MACROS | ||
, extra_compile_args=COMPILE_ARGS | ||
, extra_link_args=LINK_ARGS | ||
) | ||
|
||
# cf. http://docs.python.org/distutils/setupscript.html#additional-meta-data | ||
setup(name=NAME, | ||
version=_read('VERSION').strip(), | ||
description='Python bindings for SAP NetWeaver RFC. Wraps SAP NW RFC Library (libsapnwrfc)', | ||
long_description=_read('README.md'), | ||
classifiers=[ # cf. http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Cython', | ||
'Programming Language :: Python :: 2.7', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
], | ||
keywords='%s sap' % NAME, | ||
author='Srdjan Boskovic', | ||
author_email='[email protected]', | ||
url='https://github.com/SAP/pyrfc', | ||
license='OSI Approved :: Apache Software License', | ||
packages=find_packages(), | ||
package_data={ | ||
# If any package contains *.py files, include them: | ||
'': ['*.py'] | ||
}, | ||
zip_safe=False, # http://packages.python.org/distribute/setuptools.html#setting-the-zip-safe-flag | ||
install_requires=['setuptools'], | ||
setup_requires=['setuptools-git', | ||
'Cython==' + CYTHON_VERSION, | ||
'Sphinx'], | ||
cmdclass={'build_ext': Cython.Distutils.build_ext}, | ||
ext_modules=[pyrfc], | ||
test_suite='pyrfc', | ||
) | ||
from codecs import open | ||
import os | ||
import sys | ||
from setuptools import setup, find_packages | ||
from distutils.extension import Extension | ||
|
||
CYTHON_VERSION = '0.25.2' # fixed to assure conscious change of version. | ||
try: | ||
import Cython.Distutils | ||
except ImportError: | ||
sys.exit('Cython not installed. Please install version {}.'.format(CYTHON_VERSION)) | ||
|
||
# SAP NW RFC SDK dependency | ||
SAPNWRFC_HOME = os.environ.get('SAPNWRFC_HOME') | ||
if not SAPNWRFC_HOME: | ||
sys.exit('Environment variable SAPNWRFC_HOME not set. Please specify this variable with the root directory of the SAP NW RFC Library.') | ||
# Python sources | ||
PYTHONSOURCE = os.environ.get('PYTHONSOURCE') | ||
if not PYTHONSOURCE: | ||
sys.exit('Environment variable PYTHONSOURCE not set. Please specify this variable with the root directory of the PYTHONSOURCE Library.') | ||
|
||
NAME = 'pyrfc' | ||
HERE = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
def _read(name): | ||
with open(os.path.join(HERE, name), 'rb', 'utf-8') as f: | ||
return f.read() | ||
|
||
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)] | ||
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), '-I{}\\Include'.format(PYTHONSOURCE), '-I{}\\Include\\PC'.format(PYTHONSOURCE)] | ||
LINK_ARGS = ['-LIBPATH:{}\\lib'.format(SAPNWRFC_HOME), '-LIBPATH:{}\\PCbuild'.format(PYTHONSOURCE)] | ||
else: | ||
sys.exit('Platform not supported: {}.'.format(sys.platform)) | ||
|
||
# https://docs.python.org/2/distutils/apiref.html | ||
PYRFC_EXT = Extension( | ||
name='%s._%s' % (NAME, NAME) | ||
, sources=['src/%s/_%s.pyx' % (NAME, NAME)] | ||
, libraries=LIBS | ||
, define_macros=MACROS | ||
, extra_compile_args=COMPILE_ARGS | ||
, extra_link_args=LINK_ARGS | ||
) | ||
|
||
# cf. http://docs.python.org/distutils/setupscript.html#additional-meta-data | ||
setup(name=NAME, | ||
version=_read('VERSION').strip(), | ||
description='Python bindings for SAP NetWeaver RFC Library (libsapnwrfc)', | ||
long_description=_read('README.rst'), | ||
classifiers=[ # cf. http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'Natural Language :: English', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Cython', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.5', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
], | ||
keywords='%s sap' % NAME, | ||
author='Srdjan Boskovic', | ||
author_email='[email protected]', | ||
url='https://github.com/SAP/pyrfc', | ||
license='OSI Approved :: Apache Software License', | ||
packages=find_packages('src'), | ||
package_dir={'': 'src'}, | ||
package_data={ | ||
# If any package contains *.py files, include them: | ||
'': ['*.py'] | ||
}, | ||
zip_safe=False, # http://packages.python.org/distribute/setuptools.html#setting-the-zip-safe-flag | ||
install_requires=['setuptools'], | ||
setup_requires=['setuptools-git', | ||
'Cython==' + CYTHON_VERSION, | ||
'Sphinx'], | ||
cmdclass={'build_ext': Cython.Distutils.build_ext}, | ||
ext_modules=[PYRFC_EXT], | ||
test_suite='pyrfc', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2013 SAP AG. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http: //www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an. | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied. See the License for the specific. | ||
# language governing permissions and limitations under the License. | ||
|
||
# import from internal modules that they could be directly imported from | ||
# the pyrfc package | ||
from pyrfc._exception import RFCError, RFCLibError,\ | ||
CommunicationError, LogonError,\ | ||
ABAPApplicationError, ABAPRuntimeError,\ | ||
ExternalAuthorizationError, ExternalApplicationError, ExternalRuntimeError | ||
|
||
from pyrfc._pyrfc import get_nwrfclib_version, Connection, TypeDescription, FunctionDescription, Server | ||
|
||
# TODO: define __all__ variable | ||
# | ||
|
Oops, something went wrong.