Skip to content

Commit

Permalink
Remove dependency on python-six
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Feb 28, 2019
1 parent 031984e commit dbeb02b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 34 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ matrix:
- gcc-mingw-w64-x86-64
- binutils-mingw-w64-i686
- g++-multilib
- python-six
# debian packaging
- cmake
- debhelper
Expand Down Expand Up @@ -60,7 +59,6 @@ matrix:
packages:
- gcc-8
- gcc-8-multilib
- python-six
# doc
- python-sphinx
- graphviz
Expand All @@ -85,7 +83,6 @@ matrix:
packages:
- clang-6.0
- clang-tidy-6.0
- python-six
# doc
- python-sphinx
- graphviz
Expand All @@ -110,7 +107,6 @@ matrix:
packages:
- clang-6.0
- clang-tidy-6.0
- python3-six
# doc
- python3-sphinx
- graphviz
Expand All @@ -132,7 +128,6 @@ matrix:
addons:
apt:
packages:
- python-six
# doc
- python-sphinx
- graphviz
Expand All @@ -156,7 +151,6 @@ matrix:
packages:
- clang-6.0
- clang-tidy-6.0
- python3-six
env:
- INSTALL=true
- PYTHON=python3
Expand Down Expand Up @@ -212,7 +206,6 @@ matrix:
- clang-6.0
- clang-tidy-6.0
- libfuzzer-6.0-dev
- python-six
env:
- FUZZER=true
#
Expand Down
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake")
find_package(PythonInterp REQUIRED)
# Verify that the six python module is correctly installed
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import six"
RESULT_VARIABLE import_six_return OUTPUT_QUIET ERROR_QUIET)
if(NOT ${import_six_return} EQUAL 0)
message(FATAL_ERROR "Python interpreter found, but required six python module is not installed.")
endif()
find_package(Git)
include(AssignSourceGroup)

Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM alpine:3.5
RUN apk add --no-cache cmake gcc g++ musl-dev python py-pip py-six make && rm -rf /var/cache/apk/*
RUN apk add --no-cache cmake gcc g++ musl-dev python py-pip make && rm -rf /var/cache/apk/*
ADD . /tmp/open62541
WORKDIR /tmp/open62541/build
RUN pip install six
RUN cmake -DUA_ENABLE_AMALGAMATION=true \
-DBUILD_SHARED_LIBS=true \
/tmp/open62541
Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Build-Depends: debhelper (>= 7.0.50~),
git,
graphviz,
python (>= 2.7),
python-six
Standards-Version: 4.1.2
Section: libs
Homepage: https://open62541.org/
Expand Down
4 changes: 1 addition & 3 deletions doc/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Building with CMake on Ubuntu or Debian

.. code-block:: bash
sudo apt-get install git build-essential gcc pkg-config cmake python python-six
sudo apt-get install git build-essential gcc pkg-config cmake python
# enable additional features
sudo apt-get install cmake-curses-gui # for the ccmake graphical interface
Expand Down Expand Up @@ -54,7 +54,6 @@ with MinGW, just replace the compiler selection in the call to CMake.
- Download and install

- Python 2.7.x (Python 3.x works as well): https://python.org/downloads
- Install python-six with the pip package manager (``pip install six``)
- CMake: http://www.cmake.org/cmake/resources/software.html
- Microsoft Visual Studio: https://www.visualstudio.com/products/visual-studio-community-vs

Expand Down Expand Up @@ -85,7 +84,6 @@ Building on OS X
.. code-block:: bash
brew install cmake
pip install six # python 2/3 compatibility workarounds
pip install sphinx # for documentation generation
pip install sphinx_rtd_theme # documentation style
brew install graphviz # for graphics in the documentation
Expand Down
2 changes: 1 addition & 1 deletion open62541.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: MPLv2.0
URL: http://open62541.org
Source0: https://github.com/open62541/open62541/archive/%{name}-%{version}.tar.gz

BuildRequires: cmake3, python, python-six
BuildRequires: cmake3, python

%description
open62541 is a C-based library (linking with C++ projects is possible)
Expand Down
15 changes: 7 additions & 8 deletions tools/nodeset_compiler/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import sys
import logging
from datetime import datetime

import xml.dom.minidom as dom
from base64 import *

__all__ = ['valueIsInternalType', 'Value', 'Boolean', 'Number', 'Integer',
'UInteger', 'Byte', 'SByte',
Expand All @@ -29,17 +30,15 @@
'DiagnosticInfo', 'Guid']

logger = logging.getLogger(__name__)
import xml.dom.minidom as dom

from base64 import *

import six

if sys.version_info[0] >= 3:
# strings are already parsed to unicode
def unicode(s):
return s

string_types = str
else:
string_types = basestring

def getNextElementNode(xmlvalue):
if xmlvalue is None:
Expand Down Expand Up @@ -187,7 +186,7 @@ def __parseXMLSingleValue(self, xmlvalue, parentDataTypeNode, parent, namespaceM
if len(enc) == 1:
# 0: ['BuiltinType'] either builtin type
# 1: [ [ 'Alias', [...], n] ] or single alias for possible multipart
if isinstance(enc[0], six.string_types):
if isinstance(enc[0], string_types):
# 0: 'BuiltinType'
if alias is not None:
if not xmlvalue.localName == alias and not xmlvalue.localName == enc[0]:
Expand Down Expand Up @@ -224,7 +223,7 @@ def __parseXMLSingleValue(self, xmlvalue, parentDataTypeNode, parent, namespaceM
return self.__parseXMLSingleValue(xmlvalue, parentDataTypeNode, parent,
namespaceMapping=namespaceMapping,
alias=alias, encodingPart=enc[0], valueRank=enc[2] if len(enc)>2 else None)
elif len(enc) == 3 and isinstance(enc[0], six.string_types):
elif len(enc) == 3 and isinstance(enc[0], string_types):
# [ 'Alias', [...], 0 ] aliased multipart
if alias is None:
alias = enc[0]
Expand Down
13 changes: 7 additions & 6 deletions tools/nodeset_compiler/nodeset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@
import logging
import codecs
import re
import six
from datatypes import *
from nodes import *
from opaque_type_mapping import opaque_type_mapping

__all__ = ['NodeSet', 'getSubTypesOf']

logger = logging.getLogger(__name__)

from datatypes import *
from nodes import *
from opaque_type_mapping import opaque_type_mapping

if sys.version_info[0] >= 3:
# strings are already parsed to unicode
def unicode(s):
return s
string_types = str
else:
string_types = basestring

####################
# Helper Functions #
Expand Down Expand Up @@ -317,7 +318,7 @@ def getBaseDataType(self, node):
return node

def getDataTypeNode(self, dataType):
if isinstance(dataType, six.string_types):
if isinstance(dataType, string_types):
if not valueIsInternalType(dataType):
logger.error("Not a valid dataType string: " + dataType)
return None
Expand Down

0 comments on commit dbeb02b

Please sign in to comment.