summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2018-06-29 16:37:47 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2018-06-29 16:37:47 +0200
commit1b09b5fff78f705dfb42458726ff9789c26f6f21 (patch)
treea97e3621cfc6160bca7a327c9f7f4d294a092c2f
parent05066d9744f0b981f612c71eecace817a2ba7a08 (diff)
downloadpsutil-1b09b5fff78f705dfb42458726ff9789c26f6f21.tar.gz
revert file renaming of macos files; get them back to 'osx' prefix
-rw-r--r--MANIFEST.in14
-rw-r--r--Makefile2
-rw-r--r--psutil/__init__.py2
-rw-r--r--psutil/_psosx.py (renamed from psutil/_psmacos.py)2
-rw-r--r--psutil/_psutil_osx.c (renamed from psutil/_psutil_macos.c)26
-rw-r--r--psutil/_psutil_posix.c16
-rw-r--r--psutil/arch/osx/process_info.c (renamed from psutil/arch/macos/process_info.c)6
-rw-r--r--psutil/arch/osx/process_info.h (renamed from psutil/arch/macos/process_info.h)0
-rw-r--r--psutil/arch/osx/smc.c (renamed from psutil/arch/macos/smc.c)0
-rw-r--r--psutil/arch/osx/smc.h (renamed from psutil/arch/macos/smc.h)0
-rw-r--r--psutil/tests/__init__.py2
-rwxr-xr-xpsutil/tests/test_osx.py (renamed from psutil/tests/test_macos.py)0
-rwxr-xr-xsetup.py10
13 files changed, 40 insertions, 40 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index c6d8c550..146cd92d 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -28,7 +28,7 @@ include psutil/_exceptions.py
include psutil/_psaix.py
include psutil/_psbsd.py
include psutil/_pslinux.py
-include psutil/_psmacos.py
+include psutil/_psosx.py
include psutil/_psposix.py
include psutil/_pssunos.py
include psutil/_psutil_aix.c
@@ -36,7 +36,7 @@ include psutil/_psutil_bsd.c
include psutil/_psutil_common.c
include psutil/_psutil_common.h
include psutil/_psutil_linux.c
-include psutil/_psutil_macos.c
+include psutil/_psutil_osx.c
include psutil/_psutil_posix.c
include psutil/_psutil_posix.h
include psutil/_psutil_sunos.c
@@ -55,16 +55,16 @@ include psutil/arch/freebsd/specific.c
include psutil/arch/freebsd/specific.h
include psutil/arch/freebsd/sys_socks.c
include psutil/arch/freebsd/sys_socks.h
-include psutil/arch/macos/process_info.c
-include psutil/arch/macos/process_info.h
-include psutil/arch/macos/smc.c
-include psutil/arch/macos/smc.h
include psutil/arch/netbsd/socks.c
include psutil/arch/netbsd/socks.h
include psutil/arch/netbsd/specific.c
include psutil/arch/netbsd/specific.h
include psutil/arch/openbsd/specific.c
include psutil/arch/openbsd/specific.h
+include psutil/arch/osx/process_info.c
+include psutil/arch/osx/process_info.h
+include psutil/arch/osx/smc.c
+include psutil/arch/osx/smc.h
include psutil/arch/solaris/environ.c
include psutil/arch/solaris/environ.h
include psutil/arch/solaris/v10/ifaddrs.c
@@ -88,7 +88,7 @@ include psutil/tests/test_bsd.py
include psutil/tests/test_connections.py
include psutil/tests/test_contracts.py
include psutil/tests/test_linux.py
-include psutil/tests/test_macos.py
+include psutil/tests/test_osx.py
include psutil/tests/test_memory_leaks.py
include psutil/tests/test_misc.py
include psutil/tests/test_posix.py
diff --git a/Makefile b/Makefile
index 58c0d396..51047383 100644
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,7 @@ test-posix: ## POSIX specific tests.
test-platform: ## Run specific platform tests only.
${MAKE} install
- $(TEST_PREFIX) $(PYTHON) psutil/tests/test_`$(PYTHON) -c 'import psutil; print([x.lower() for x in ("LINUX", "BSD", "MACOS", "SUNOS", "WINDOWS", "AIX") if getattr(psutil, x)][0])'`.py
+ $(TEST_PREFIX) $(PYTHON) psutil/tests/test_`$(PYTHON) -c 'import psutil; print([x.lower() for x in ("LINUX", "BSD", "OSX", "SUNOS", "WINDOWS", "AIX") if getattr(psutil, x)][0])'`.py
test-memleaks: ## Memory leak tests.
${MAKE} install
diff --git a/psutil/__init__.py b/psutil/__init__.py
index affc5c8c..43e9aa7e 100644
--- a/psutil/__init__.py
+++ b/psutil/__init__.py
@@ -153,7 +153,7 @@ elif WINDOWS:
from ._pswindows import CONN_DELETE_TCB # NOQA
elif MACOS:
- from . import _psmacos as _psplatform
+ from . import _psosx as _psplatform
elif BSD:
from . import _psbsd as _psplatform
diff --git a/psutil/_psmacos.py b/psutil/_psosx.py
index a719beda..6c77dc69 100644
--- a/psutil/_psmacos.py
+++ b/psutil/_psosx.py
@@ -14,7 +14,7 @@ from collections import namedtuple
from . import _common
from . import _psposix
-from . import _psutil_macos as cext
+from . import _psutil_osx as cext
from . import _psutil_posix as cext_posix
from ._common import AF_INET6
from ._common import conn_tmap
diff --git a/psutil/_psutil_macos.c b/psutil/_psutil_osx.c
index 8fc3140f..e3250cab 100644
--- a/psutil/_psutil_macos.c
+++ b/psutil/_psutil_osx.c
@@ -43,8 +43,8 @@
#include "_psutil_common.h"
#include "_psutil_posix.h"
-#include "arch/macos/process_info.h"
-#include "arch/macos/smc.h"
+#include "arch/osx/process_info.h"
+#include "arch/osx/smc.h"
#define PSUTIL_TV2DOUBLE(t) ((t).tv_sec + (t).tv_usec / 1000000.0)
@@ -342,7 +342,7 @@ psutil_proc_cmdline(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- // get the commandline, defined in arch/macos/process_info.c
+ // get the commandline, defined in arch/osx/process_info.c
py_retlist = psutil_get_cmdline(pid);
return py_retlist;
}
@@ -359,7 +359,7 @@ psutil_proc_environ(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- // get the environment block, defined in arch/macos/process_info.c
+ // get the environment block, defined in arch/osx/process_info.c
py_retdict = psutil_get_environ(pid);
return py_retdict;
}
@@ -2066,13 +2066,13 @@ struct module_state {
#if PY_MAJOR_VERSION >= 3
static int
-psutil_macos_traverse(PyObject *m, visitproc visit, void *arg) {
+psutil_osx_traverse(PyObject *m, visitproc visit, void *arg) {
Py_VISIT(GETSTATE(m)->error);
return 0;
}
static int
-psutil_macos_clear(PyObject *m) {
+psutil_osx_clear(PyObject *m) {
Py_CLEAR(GETSTATE(m)->error);
return 0;
}
@@ -2080,31 +2080,31 @@ psutil_macos_clear(PyObject *m) {
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
- "psutil_macos",
+ "psutil_osx",
NULL,
sizeof(struct module_state),
PsutilMethods,
NULL,
- psutil_macos_traverse,
- psutil_macos_clear,
+ psutil_osx_traverse,
+ psutil_osx_clear,
NULL
};
#define INITERROR return NULL
-PyMODINIT_FUNC PyInit__psutil_macos(void)
+PyMODINIT_FUNC PyInit__psutil_osx(void)
#else
#define INITERROR return
void
-init_psutil_macos(void)
+init_psutil_osx(void)
#endif
{
#if PY_MAJOR_VERSION >= 3
PyObject *module = PyModule_Create(&moduledef);
#else
- PyObject *module = Py_InitModule("_psutil_macos", PsutilMethods);
+ PyObject *module = Py_InitModule("_psutil_osx", PsutilMethods);
#endif
PyModule_AddIntConstant(module, "version", PSUTIL_VERSION);
// process status constants, defined in:
@@ -2130,7 +2130,7 @@ init_psutil_macos(void)
// Exception.
ZombieProcessError = PyErr_NewException(
- "_psutil_macos.ZombieProcessError", NULL, NULL);
+ "_psutil_osx.ZombieProcessError", NULL, NULL);
Py_INCREF(ZombieProcessError);
PyModule_AddObject(module, "ZombieProcessError", ZombieProcessError);
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c
index e9a8f2d9..c851abbc 100644
--- a/psutil/_psutil_posix.c
+++ b/psutil/_psutil_posix.c
@@ -28,7 +28,7 @@
#include <netdb.h>
#include <linux/types.h>
#include <linux/if_packet.h>
-#elif defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#elif defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
#include <netdb.h>
#include <netinet/in.h>
#include <net/if_dl.h>
@@ -71,7 +71,7 @@ psutil_pid_exists(long pid) {
#endif
}
-#if defined(PSUTIL_MACOS)
+#if defined(PSUTIL_OSX)
ret = kill((pid_t)pid , 0);
#else
ret = kill(pid , 0);
@@ -143,7 +143,7 @@ psutil_posix_getpriority(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
-#ifdef PSUTIL_MACOS
+#ifdef PSUTIL_OSX
priority = getpriority(PRIO_PROCESS, (id_t)pid);
#else
priority = getpriority(PRIO_PROCESS, pid);
@@ -166,7 +166,7 @@ psutil_posix_setpriority(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "li", &pid, &priority))
return NULL;
-#ifdef PSUTIL_MACOS
+#ifdef PSUTIL_OSX
retval = setpriority(PRIO_PROCESS, (id_t)pid, priority);
#else
retval = setpriority(PRIO_PROCESS, pid, priority);
@@ -221,7 +221,7 @@ psutil_convert_ipaddr(struct sockaddr *addr, int family) {
len = lladdr->sll_halen;
data = (const char *)lladdr->sll_addr;
}
-#elif defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#elif defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
else if (addr->sa_family == AF_LINK) {
// Note: prior to Python 3.4 socket module does not expose
// AF_LINK so we'll do.
@@ -433,7 +433,7 @@ error:
/*
* net_if_stats() macOS/BSD implementation.
*/
-#if defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#if defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
int psutil_get_nic_speed(int ifm_active) {
// Determine NIC speed. Taken from:
@@ -638,7 +638,7 @@ PsutilMethods[] = {
"Retrieve NIC MTU"},
{"net_if_flags", psutil_net_if_flags, METH_VARARGS,
"Retrieve NIC flags"},
-#if defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#if defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
{"net_if_duplex_speed", psutil_net_if_duplex_speed, METH_VARARGS,
"Return NIC stats."},
#endif
@@ -698,7 +698,7 @@ void init_psutil_posix(void)
PyObject *module = Py_InitModule("_psutil_posix", PsutilMethods);
#endif
-#if defined(PSUTIL_BSD) || defined(PSUTIL_MACOS) || defined(PSUTIL_SUNOS) || defined(PSUTIL_AIX)
+#if defined(PSUTIL_BSD) || defined(PSUTIL_OSX) || defined(PSUTIL_SUNOS) || defined(PSUTIL_AIX)
PyModule_AddIntConstant(module, "AF_LINK", AF_LINK);
#endif
diff --git a/psutil/arch/macos/process_info.c b/psutil/arch/osx/process_info.c
index de007de4..40c79a2c 100644
--- a/psutil/arch/macos/process_info.c
+++ b/psutil/arch/osx/process_info.c
@@ -4,7 +4,7 @@
* found in the LICENSE file.
*
* Helper functions related to fetching process information.
- * Used by _psutil_macos module methods.
+ * Used by _psutil_osx module methods.
*/
@@ -142,7 +142,7 @@ psutil_get_cmdline(long pid) {
mib[2] = (pid_t)pid;
if (sysctl(mib, 3, procargs, &argmax, NULL, 0) < 0) {
// In case of zombie process we'll get EINVAL. We translate it
- // to NSP and _psmacos.py will translate it to ZP.
+ // to NSP and _psosx.py will translate it to ZP.
if ((errno == EINVAL) && (psutil_pid_exists(pid)))
NoSuchProcess("");
else
@@ -236,7 +236,7 @@ psutil_get_environ(long pid) {
mib[2] = (pid_t)pid;
if (sysctl(mib, 3, procargs, &argmax, NULL, 0) < 0) {
// In case of zombie process we'll get EINVAL. We translate it
- // to NSP and _psmacos.py will translate it to ZP.
+ // to NSP and _psosx.py will translate it to ZP.
if ((errno == EINVAL) && (psutil_pid_exists(pid)))
NoSuchProcess("");
else
diff --git a/psutil/arch/macos/process_info.h b/psutil/arch/osx/process_info.h
index bd2eef86..bd2eef86 100644
--- a/psutil/arch/macos/process_info.h
+++ b/psutil/arch/osx/process_info.h
diff --git a/psutil/arch/macos/smc.c b/psutil/arch/osx/smc.c
index 00de0a37..00de0a37 100644
--- a/psutil/arch/macos/smc.c
+++ b/psutil/arch/osx/smc.c
diff --git a/psutil/arch/macos/smc.h b/psutil/arch/osx/smc.h
index acd399c2..acd399c2 100644
--- a/psutil/arch/macos/smc.h
+++ b/psutil/arch/osx/smc.h
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 2b00d426..d293498e 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -810,7 +810,7 @@ def get_suite():
x.startswith('test_memory_leaks')]
if "WHEELHOUSE_UPLOADER_USERNAME" in os.environ:
testmods = [x for x in testmods if not x.endswith((
- "macos", "posix", "linux"))]
+ "osx", "posix", "linux"))]
suite = unittest.TestSuite()
for tm in testmods:
# ...so that the full test paths are printed on screen
diff --git a/psutil/tests/test_macos.py b/psutil/tests/test_osx.py
index 557af9f9..557af9f9 100755
--- a/psutil/tests/test_macos.py
+++ b/psutil/tests/test_osx.py
diff --git a/setup.py b/setup.py
index 03e315b5..adc7a0e2 100755
--- a/setup.py
+++ b/setup.py
@@ -146,13 +146,13 @@ if WINDOWS:
)
elif MACOS:
- macros.append(("PSUTIL_MACOS", 1))
+ macros.append(("PSUTIL_OSX", 1))
ext = Extension(
- 'psutil._psutil_macos',
+ 'psutil._psutil_osx',
sources=sources + [
- 'psutil/_psutil_macos.c',
- 'psutil/arch/macos/process_info.c',
- 'psutil/arch/macos/smc.c',
+ 'psutil/_psutil_osx.c',
+ 'psutil/arch/osx/process_info.c',
+ 'psutil/arch/osx/smc.c',
],
define_macros=macros,
extra_link_args=[