summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2017-05-17 15:02:14 -0700
committerMark Spruiell <mes@zeroc.com>2017-05-17 15:02:14 -0700
commitb535c699af8cb0dada006470fe9cb4cb749585ff (patch)
tree57c612fee30483697cfac8873b7da319f9a94891 /python
parentFixed ICE-7880 - renamed HeartbeatOnInvocation to HeartbeatOnDispatch (diff)
downloadice-b535c699af8cb0dada006470fe9cb4cb749585ff.tar.bz2
ice-b535c699af8cb0dada006470fe9cb4cb749585ff.tar.xz
ice-b535c699af8cb0dada006470fe9cb4cb749585ff.zip
ICE-7442 - reorganizing Python installation
Diffstat (limited to 'python')
-rw-r--r--python/BuildInstructionsWindows.md2
-rw-r--r--python/config/Make.rules10
-rw-r--r--python/config/install_dir2
-rw-r--r--python/config/zeroc-ice.pth1
-rw-r--r--python/python/.gitignore1
-rw-r--r--python/python/Glacier2/__init__.py (renamed from python/python/Glacier2.py)10
-rw-r--r--python/python/Ice/IceFuture.py (renamed from python/python/IceFuture.py)0
-rw-r--r--python/python/Ice/__init__.py (renamed from python/python/Ice.py)67
-rw-r--r--python/python/Makefile20
-rwxr-xr-xpython/test/Slice/escape/Client.py2
-rwxr-xr-xpython/test/Slice/import/Client.py2
-rwxr-xr-xpython/test/Slice/macros/Client.py2
-rwxr-xr-xpython/test/Slice/structure/Client.py2
13 files changed, 59 insertions, 62 deletions
diff --git a/python/BuildInstructionsWindows.md b/python/BuildInstructionsWindows.md
index e4c100ed60d..a41d1a5a091 100644
--- a/python/BuildInstructionsWindows.md
+++ b/python/BuildInstructionsWindows.md
@@ -36,7 +36,7 @@ can open one of:
- VS2015 x64 Native Tools Command Prompt
Using the first Command Prompt produces `Win32` binaries by default, while
-the second Command Promt produces `x64` binaries by default.
+the second Command Prompt produces `x64` binaries by default.
In the Command Prompt, change to the `python` subdirectory:
diff --git a/python/config/Make.rules b/python/config/Make.rules
index 549a0d6f2cc..140c64e4590 100644
--- a/python/config/Make.rules
+++ b/python/config/Make.rules
@@ -75,11 +75,11 @@ distclean clean::
$(E) "Cleaning package $3"
$(Q)$(RM) -r $2/$3/.depend
$(Q)$(if $(findstring --no-package,$4),,$(RM) $2/$3/__init__.py)
- $(Q)$(RM) $(patsubst $1/$3/%.ice,$2/$3_%_ice.py,$(wildcard $1/$3/*.ice))
+ $(Q)$(RM) $(patsubst $1/$3/%.ice,$2/$3/%_ice.py,$(wildcard $1/$3/*.ice))
-generate-srcs srcs all:: $(patsubst $1/$3/%.ice,$2/$3_%_ice.py,$(wildcard $1/$3/*.ice))
+generate-srcs srcs all:: $(patsubst $1/$3/%.ice,$2/$3/%_ice.py,$(wildcard $1/$3/*.ice))
-$$(eval $$(call install-data-files,$(patsubst $1/$3/%.ice,$2/$3_%_ice.py,$(wildcard $1/$3/*.ice)),$2,$(install_pythondir),install))
+$$(eval $$(call install-data-files,$(patsubst $1/$3/%.ice,$2/$3/%_ice.py,$(wildcard $1/$3/*.ice)),$2,$(install_pythondir),install))
# If we also generate a package directory with an __init__.py, install it.
ifeq ($(findstring --no-package,$4),)
@@ -93,9 +93,9 @@ endef
#
define make-python-slice
-$2/$3_$(or $4,%)_ice.py: $1/$3/$(or $4,%).ice $2/$3/.depend/$(or $4,%).ice.d $(slice2py_path)
+$2/$3/$(or $4,%)_ice.py: $1/$3/$(or $4,%).ice $2/$3/.depend/$(or $4,%).ice.d $(slice2py_path)
$(E) "Compiling $$<"
$(Q)$(slice2py_path) -I$1 --output-dir $2 $5 --depend $$< > $2/$3/.depend/$(or $4,$$(*F)).ice.d
- $(Q)$(slice2py_path) -I$1 --output-dir $2 --prefix $3_ --checksum $5 $$<
+ $(Q)$(slice2py_path) -I$1 --output-dir $2 --checksum $5 $$<
endef
diff --git a/python/config/install_dir b/python/config/install_dir
index 30da8f10749..435ffd62ab4 100644
--- a/python/config/install_dir
+++ b/python/config/install_dir
@@ -33,4 +33,4 @@ except distutils.errors.DistutilsError:
pass
# Place the source files and the extension in a subdirectory of the installation directory.
-print(os.path.join(e.install_dir, "zeroc-ice"))
+print(e.install_dir)
diff --git a/python/config/zeroc-ice.pth b/python/config/zeroc-ice.pth
deleted file mode 100644
index 78c57de7dca..00000000000
--- a/python/config/zeroc-ice.pth
+++ /dev/null
@@ -1 +0,0 @@
-zeroc-ice
diff --git a/python/python/.gitignore b/python/python/.gitignore
index 3e3f00b9453..685ea725586 100644
--- a/python/python/.gitignore
+++ b/python/python/.gitignore
@@ -1,4 +1,3 @@
-Glacier2/*
IceBox/*
IceGrid/*
IceMX/*
diff --git a/python/python/Glacier2.py b/python/python/Glacier2/__init__.py
index 3b04a4cfd75..6958b89a7d0 100644
--- a/python/python/Glacier2.py
+++ b/python/python/Glacier2/__init__.py
@@ -19,11 +19,11 @@ import threading, traceback, copy
import Ice
Ice.updateModule("Glacier2")
-import Glacier2_Router_ice
-import Glacier2_Session_ice
-import Glacier2_PermissionsVerifier_ice
-import Glacier2_SSLInfo_ice
-import Glacier2_Metrics_ice
+import Glacier2.Router_ice
+import Glacier2.Session_ice
+import Glacier2.PermissionsVerifier_ice
+import Glacier2.SSLInfo_ice
+import Glacier2.Metrics_ice
class SessionNotExistException(Exception):
def __init__(self):
diff --git a/python/python/IceFuture.py b/python/python/Ice/IceFuture.py
index df5eff76c83..df5eff76c83 100644
--- a/python/python/IceFuture.py
+++ b/python/python/Ice/IceFuture.py
diff --git a/python/python/Ice.py b/python/python/Ice/__init__.py
index 96654a8fcc0..a167f54dde5 100644
--- a/python/python/Ice.py
+++ b/python/python/Ice/__init__.py
@@ -80,7 +80,7 @@ def Python35():
return sys.version_info[:2] >= (3, 5)
if Python35():
- from IceFuture import FutureBase, wrap_future
+ from Ice.IceFuture import FutureBase, wrap_future
else:
FutureBase = object
@@ -572,31 +572,32 @@ def getSliceDir():
'''Convenience function for locating the directory containing the Slice files.'''
#
- # Detect setup.py installation in site-packages. The slice
- # files live along side Ice.py
+ # Get the parent of the directory containing this file (__init__.py).
#
- dir = os.path.join(os.path.dirname(__file__), "slice")
- if os.path.isdir(dir):
- return dir
+ pyHome = os.path.join(os.path.dirname(__file__), "..")
#
- # Get the parent of the directory containing this file (Ice.py).
+ # Detect setup.py installation in site-packages. The slice
+ # files live one level above this file.
#
- pyHome = os.path.join(os.path.dirname(__file__), "..")
+ dir = os.path.join(pyHome, "slice")
+ if os.path.isdir(dir):
+ return dir
#
# For an installation from a source distribution, a binary tarball, or a
# Windows installer, the "slice" directory is a sibling of the "python"
# directory.
#
- dir = os.path.join(pyHome, "slice")
+ dir = os.path.join(pyHome, "..", "slice")
if os.path.exists(dir):
return os.path.normpath(dir)
#
- # In a source distribution, the "slice" directory is one level higher.
+ # In a source distribution, the "slice" directory is an extra level higher.
+ # directory.
#
- dir = os.path.join(pyHome, "..", "slice")
+ dir = os.path.join(pyHome, "..", "..", "slice")
if os.path.exists(dir):
return os.path.normpath(dir)
@@ -711,28 +712,28 @@ sliceChecksums = {}
#
# Import generated Ice modules.
#
-import Ice_BuiltinSequences_ice
-import Ice_Current_ice
-import Ice_Communicator_ice
-import Ice_ImplicitContext_ice
-import Ice_Endpoint_ice
-import Ice_EndpointTypes_ice
-import Ice_Identity_ice
-import Ice_LocalException_ice
-import Ice_Locator_ice
-import Ice_Logger_ice
-import Ice_ObjectAdapter_ice
-import Ice_ObjectFactory_ice
-import Ice_ValueFactory_ice
-import Ice_Process_ice
-import Ice_Properties_ice
-import Ice_RemoteLogger_ice
-import Ice_Router_ice
-import Ice_ServantLocator_ice
-import Ice_Connection_ice
-import Ice_Version_ice
-import Ice_Instrumentation_ice
-import Ice_Metrics_ice
+import Ice.BuiltinSequences_ice
+import Ice.Current_ice
+import Ice.Communicator_ice
+import Ice.ImplicitContext_ice
+import Ice.Endpoint_ice
+import Ice.EndpointTypes_ice
+import Ice.Identity_ice
+import Ice.LocalException_ice
+import Ice.Locator_ice
+import Ice.Logger_ice
+import Ice.ObjectAdapter_ice
+import Ice.ObjectFactory_ice
+import Ice.ValueFactory_ice
+import Ice.Process_ice
+import Ice.Properties_ice
+import Ice.RemoteLogger_ice
+import Ice.Router_ice
+import Ice.ServantLocator_ice
+import Ice.Connection_ice
+import Ice.Version_ice
+import Ice.Instrumentation_ice
+import Ice.Metrics_ice
#
# Replace EndpointInfo with our implementation.
diff --git a/python/python/Makefile b/python/python/Makefile
index 53346ffef2f..bd5cd9b43dd 100644
--- a/python/python/Makefile
+++ b/python/python/Makefile
@@ -20,16 +20,6 @@ $(eval $(call load-translator-dependencies,$(top_srcdir)/cpp/src/slice2py))
.NOTPARALLEL:
-install:: | $(DESTDIR)$(install_pythondir)
- $(E) "Installing generated code"
- $(Q)$(INSTALL) *.py $(DESTDIR)$(install_pythondir)
-
-ifneq ($(usr_dir_install),)
-install:: | $(DESTDIR)$(install_pythondir)
- $(E) "Installing .pth file"
- $(Q)$(INSTALL) ../config/zeroc-ice.pth $(DESTDIR)$(install_pythondir)/..
-endif
-
$(eval $(call make-python-package,$(slicedir),$(lang_srcdir)/python,Ice,--no-package))
$(eval $(call make-python-package,$(slicedir),$(lang_srcdir)/python,Glacier2,--no-package))
$(eval $(call make-python-package,$(slicedir),$(lang_srcdir)/python,IceBox))
@@ -38,7 +28,15 @@ $(eval $(call make-python-package,$(slicedir),$(lang_srcdir)/python,IceGrid))
$(eval $(call make-python-package,$(slicedir),$(lang_srcdir)/python,IcePatch2))
$(eval $(call make-python-package,$(slicedir),$(lang_srcdir)/python,IceStorm))
-# Generate this two files individually without the --no-package option to ensure the
+# Generate these two files individually without the --no-package option to ensure the
# IceMX package is updated.
$(eval $(call make-python-slice,$(slicedir),$(lang_srcdir)/python,Ice,Metrics))
$(eval $(call make-python-slice,$(slicedir),$(lang_srcdir)/python,Glacier2,Metrics))
+
+install:: | $(DESTDIR)$(install_pythondir)/Ice
+ $(E) "Installing generated code"
+ $(Q)$(INSTALL) Ice/__init__.py $(DESTDIR)$(install_pythondir)/Ice
+ $(Q)$(INSTALL) Ice/IceFuture.py $(DESTDIR)$(install_pythondir)/Ice
+
+install:: | $(DESTDIR)$(install_pythondir)/Glacier2
+ $(Q)$(INSTALL) Glacier2/__init__.py $(DESTDIR)$(install_pythondir)/Glacier2
diff --git a/python/test/Slice/escape/Client.py b/python/test/Slice/escape/Client.py
index 126d2810482..1946d09fc94 100755
--- a/python/test/Slice/escape/Client.py
+++ b/python/test/Slice/escape/Client.py
@@ -12,7 +12,7 @@ import os, sys, traceback
for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
+ if os.path.exists(os.path.join(toplevel, "python", "Ice", "__init__.py")):
break
else:
raise RuntimeError("can't find toplevel directory!")
diff --git a/python/test/Slice/import/Client.py b/python/test/Slice/import/Client.py
index 94a35d45582..c27f67795ac 100755
--- a/python/test/Slice/import/Client.py
+++ b/python/test/Slice/import/Client.py
@@ -12,7 +12,7 @@ import os, sys, traceback
for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
+ if os.path.exists(os.path.join(toplevel, "python", "Ice", "__init__.py")):
break
else:
raise RuntimeError("can't find toplevel directory!")
diff --git a/python/test/Slice/macros/Client.py b/python/test/Slice/macros/Client.py
index ae60009a31b..5fa054dde5a 100755
--- a/python/test/Slice/macros/Client.py
+++ b/python/test/Slice/macros/Client.py
@@ -12,7 +12,7 @@ import os, sys, traceback
for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
+ if os.path.exists(os.path.join(toplevel, "python", "Ice", "__init__.py")):
break
else:
raise RuntimeError("can't find toplevel directory!")
diff --git a/python/test/Slice/structure/Client.py b/python/test/Slice/structure/Client.py
index 2a9e23246db..19fb2c8a98e 100755
--- a/python/test/Slice/structure/Client.py
+++ b/python/test/Slice/structure/Client.py
@@ -12,7 +12,7 @@ import os, sys, traceback
for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
+ if os.path.exists(os.path.join(toplevel, "python", "Ice", "__init__.py")):
break
else:
raise RuntimeError("can't find toplevel directory!")