[Python-modules-commits] [python-setproctitle] 11/13: Import python-setproctitle_1.1.10.orig.tar.gz
Orestis Ioannou
oorestisime-guest at moszumanska.debian.org
Sun Sep 18 12:02:52 UTC 2016
This is an automated email from the git hooks/post-receive script.
oorestisime-guest pushed a commit to branch master
in repository python-setproctitle.
commit 5cc1ee774d43ff48fe578f2349423d3b4f3dea2b
Author: Orestis Ioannou <orestis at oioannou.com>
Date: Wed Sep 14 00:47:38 2016 +0200
Import python-setproctitle_1.1.10.orig.tar.gz
---
COPYRIGHT | 2 +-
HISTORY.rst | 20 ++++++++-
MANIFEST.in | 9 ++++
Makefile | 17 +++----
PKG-INFO | 72 +++++++++++++++++-------------
README.rst | 48 +++++++++-----------
PKG-INFO => setproctitle.egg-info/PKG-INFO | 72 +++++++++++++++++-------------
setproctitle.egg-info/SOURCES.txt | 23 ++++++++++
setproctitle.egg-info/dependency_links.txt | 1 +
setproctitle.egg-info/top_level.txt | 1 +
setup.cfg | 5 +++
setup.py | 54 ++++++++++++----------
src/c.h | 9 +++-
src/setproctitle.c | 2 +-
src/spt.h | 2 +-
src/spt_debug.c | 2 +-
src/spt_python.h | 2 +-
src/spt_setup.c | 2 +-
src/spt_setup.h | 2 +-
src/spt_status.c | 8 +++-
tests/pyrun.c | 2 +-
tests/setproctitle_test.py | 17 +++----
22 files changed, 226 insertions(+), 146 deletions(-)
diff --git a/COPYRIGHT b/COPYRIGHT
index ed84316..f3c56df 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,4 +1,4 @@
-Copyright (c) 2009-2012, Daniele Varrazzo <daniele.varrazzo at gmail.com>
+Copyright (c) 2009-2016, Daniele Varrazzo <daniele.varrazzo at gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/HISTORY.rst b/HISTORY.rst
index a532b0d..9dad712 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,17 +1,33 @@
Releases history
----------------
+Version 1.1.10
+~~~~~~~~~~~~~~
+
+- Fixed building with certain ``prctl.h`` implementations (issue #44).
+- Use ``setuptools`` if available (issue #48).
+
+
+Version 1.1.9
+~~~~~~~~~~~~~
+
+- Fixed build on VC (issues #20, #33).
+- Added ``MANIFEST.in`` to the source distribution to help with RPM building
+ (issue #30).
+
+
Version 1.1.8
~~~~~~~~~~~~~
-- Added support for Python "diehard" 2.4.
+- Added support for Python "diehard" 2.4 (pull request #3).
- Fixed build on Mac OS X 10.9 Maverick (issue #27).
Version 1.1.7
~~~~~~~~~~~~~
-- Added PyPy support, courtesy of Ozan Turksever (http://www.logsign.net).
+- Added PyPy support, courtesy of Ozan Turksever - http://www.logsign.net
+ (pull request #2).
Version 1.1.6
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..ef496b2
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,9 @@
+include HISTORY.rst
+include README.rst
+include COPYRIGHT
+include MANIFEST.in
+include Makefile
+include src/*.c
+include src/*.h
+include tests/*.py
+include tests/*.c
diff --git a/Makefile b/Makefile
index 755de55..517286f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Oh, makefile, help me with the python3 craze :D
#
-# Copyright (c) 2010-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+# Copyright (c) 2010-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
MKDIR = mkdir -p
RM = rm -f
@@ -44,11 +44,11 @@ check: build tests/pyrun3
ROOT_PATH=$(ROOT_PATH) \
$(PYTHON) py3/tests/setproctitle_test.py -v
-py3: MANIFEST
+py3:
$(MKDIR) py3
$(MKDIR) py3/src
$(MKDIR) py3/tests
- for f in `grep -v "#" MANIFEST`; do cp -v $$f py3/$$f; done
+ for f in *.rst setup.py COPYRIGHT MANIFEST.in src/*.c src/*.h tests/*.py tests/*.c; do cp -v $$f py3/$$f; done
# setup.py should be executable with python3 as distribute
# currenlty doesn't seem to try to convert it
$(PY2TO3) -w --no-diffs py3/tests
@@ -58,15 +58,8 @@ tests/pyrun3: tests/pyrun.c
endif
-sdist: MANIFEST
+sdist:
$(PYTHON) setup.py sdist --formats=gztar,zip
-MANIFEST:
- # Must run twice because the manifest contains the manifest itself.
- $(PYTHON) setup.py sdist --manifest-only
- $(PYTHON) setup.py sdist --manifest-only
-
clean:
- $(RM) -r MANIFEST py3 build dist tests/pyrun2 tests/pyrun3
-
-
+ $(RM) -r py3 build dist tests/pyrun2 tests/pyrun3 setproctitle.egg-info
diff --git a/PKG-INFO b/PKG-INFO
index 157a03e..cdc66fa 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,19 +1,19 @@
Metadata-Version: 1.1
Name: setproctitle
-Version: 1.1.8
-Summary: A library to allow customization of the process title.
-Home-page: http://code.google.com/p/py-setproctitle/
+Version: 1.1.10
+Summary: A Python module to customize the process title
+Home-page: https://github.com/dvarrazzo/py-setproctitle
Author: Daniele Varrazzo
Author-email: daniele.varrazzo at gmail.com
License: BSD
Download-URL: http://pypi.python.org/pypi/setproctitle/
-Description: A ``setproctitle`` implementation for Python
- ============================================
+Description: A Python module to customize the process title
+ ==============================================
:author: Daniele Varrazzo
- The library allows a process to change its title (as displayed by system tools
- such as ``ps`` and ``top``).
+ The ``setproctitle`` module allows a process to change its title (as displayed
+ by system tools such as ``ps`` and ``top``).
Changing the title is mostly useful in multi-process systems, for example
when a master process is forked: changing the children's title allows to
@@ -24,10 +24,9 @@ Description: A ``setproctitle`` implementation for Python
a good `multi-platform implementation`__: this module is a Python wrapper
around PostgreSQL code.
- - `Homepage <http://code.google.com/p/py-setproctitle/>`__
+ - `Homepage <https://github.com/dvarrazzo/py-setproctitle>`__
- `Download <http://pypi.python.org/pypi/setproctitle/>`__
- - `Source repository <https://github.com/dvarrazzo/py-setproctitle>`__
- - `Bug tracker <http://code.google.com/p/py-setproctitle/issues/list>`__
+ - `Bug tracker <https://github.com/dvarrazzo/py-setproctitle/issues>`__
.. _PostgreSQL: http://www.postgresql.org
@@ -38,30 +37,30 @@ Description: A ``setproctitle`` implementation for Python
Installation
------------
- You can use ``easy_install`` to install the module: to perform a system-wide
- installation use::
+ ``setproctitle`` is a C extension: in order to build it you will need a C
+ compiler and the Python development support (the ``python-dev`` package in
+ most Linux distributions). No further external dependencies are required.
- sudo easy_install setproctitle
+ You can use ``pip`` to install the module::
- If you are an unprivileged user or you want to limit installation to a local
- environment, you can use the command::
+ pip install setproctitle
- easy_install -d /target/path setproctitle
+ You can use ``pip -t`` or ``virtualenv`` for local installations, ``sudo pip``
+ for a system-wide one... the usual stuff. Read pip_ or virtualenv_ docs for
+ all the details.
- Note that ``easy_install`` requires ``/target/path`` to be in your
- ``PYTHONPATH``.
+ .. _pip: https://pip.readthedocs.org/
+ .. _virtualenv: https://virtualenv.readthedocs.org/
Python 3 support
~~~~~~~~~~~~~~~~
- As of version 1.1 the module works with Python 3. In order to install the
- module, you can use the `distribute`_ replacemente for ``easy_install``.
+ As of version 1.1 the module works with Python 3. Just use
+ ``pip``/``virtualenv`` for Python 3.
- In order to build and test the module under Python 3, the ``Makefile``
- contains some helper targets.
-
- .. _distribute: http://pypi.python.org/pypi/distribute
+ In order to build from the source package and test the module under Python 3,
+ the ``Makefile`` contains some helper targets.
Usage
@@ -126,7 +125,7 @@ Description: A ``setproctitle`` implementation for Python
Other known implementations and discussions
-------------------------------------------
- - `procname`_: a module exposing the same functionality, but less portable
+ - `procname`_: a module exposing the same functionality, but less portable
and not well packaged.
- `Issue 5672`_: where the introduction of such functionality into the stdlib
is being discussed.
@@ -134,25 +133,36 @@ Description: A ``setproctitle`` implementation for Python
.. _procname: http://code.google.com/p/procname/
.. _Issue 5672: http://bugs.python.org/issue5672
+ Releases history
+ ----------------
- ..
- vim: set filetype=rst:
+ Version 1.1.10
+ ~~~~~~~~~~~~~~
+ - Fixed building with certain ``prctl.h`` implementations (issue #44).
+ - Use ``setuptools`` if available (issue #48).
+
+
+ Version 1.1.9
+ ~~~~~~~~~~~~~
+
+ - Fixed build on VC (issues #20, #33).
+ - Added ``MANIFEST.in`` to the source distribution to help with RPM building
+ (issue #30).
- Releases history
- ----------------
Version 1.1.8
~~~~~~~~~~~~~
- - Added support for Python "diehard" 2.4.
+ - Added support for Python "diehard" 2.4 (pull request #3).
- Fixed build on Mac OS X 10.9 Maverick (issue #27).
Version 1.1.7
~~~~~~~~~~~~~
- - Added PyPy support, courtesy of Ozan Turksever (http://www.logsign.net).
+ - Added PyPy support, courtesy of Ozan Turksever - http://www.logsign.net
+ (pull request #2).
Version 1.1.6
diff --git a/README.rst b/README.rst
index 4bd78a7..26215ca 100644
--- a/README.rst
+++ b/README.rst
@@ -1,10 +1,10 @@
-A ``setproctitle`` implementation for Python
-============================================
+A Python module to customize the process title
+==============================================
:author: Daniele Varrazzo
-The library allows a process to change its title (as displayed by system tools
-such as ``ps`` and ``top``).
+The ``setproctitle`` module allows a process to change its title (as displayed
+by system tools such as ``ps`` and ``top``).
Changing the title is mostly useful in multi-process systems, for example
when a master process is forked: changing the children's title allows to
@@ -15,10 +15,9 @@ The procedure is hardly portable across different systems. PostgreSQL provides
a good `multi-platform implementation`__: this module is a Python wrapper
around PostgreSQL code.
-- `Homepage <http://code.google.com/p/py-setproctitle/>`__
+- `Homepage <https://github.com/dvarrazzo/py-setproctitle>`__
- `Download <http://pypi.python.org/pypi/setproctitle/>`__
-- `Source repository <https://github.com/dvarrazzo/py-setproctitle>`__
-- `Bug tracker <http://code.google.com/p/py-setproctitle/issues/list>`__
+- `Bug tracker <https://github.com/dvarrazzo/py-setproctitle/issues>`__
.. _PostgreSQL: http://www.postgresql.org
@@ -29,30 +28,30 @@ around PostgreSQL code.
Installation
------------
-You can use ``easy_install`` to install the module: to perform a system-wide
-installation use::
+``setproctitle`` is a C extension: in order to build it you will need a C
+compiler and the Python development support (the ``python-dev`` package in
+most Linux distributions). No further external dependencies are required.
- sudo easy_install setproctitle
+You can use ``pip`` to install the module::
-If you are an unprivileged user or you want to limit installation to a local
-environment, you can use the command::
+ pip install setproctitle
- easy_install -d /target/path setproctitle
+You can use ``pip -t`` or ``virtualenv`` for local installations, ``sudo pip``
+for a system-wide one... the usual stuff. Read pip_ or virtualenv_ docs for
+all the details.
-Note that ``easy_install`` requires ``/target/path`` to be in your
-``PYTHONPATH``.
+.. _pip: https://pip.readthedocs.org/
+.. _virtualenv: https://virtualenv.readthedocs.org/
Python 3 support
~~~~~~~~~~~~~~~~
-As of version 1.1 the module works with Python 3. In order to install the
-module, you can use the `distribute`_ replacemente for ``easy_install``.
+As of version 1.1 the module works with Python 3. Just use
+``pip``/``virtualenv`` for Python 3.
-In order to build and test the module under Python 3, the ``Makefile``
-contains some helper targets.
-
-.. _distribute: http://pypi.python.org/pypi/distribute
+In order to build from the source package and test the module under Python 3,
+the ``Makefile`` contains some helper targets.
Usage
@@ -117,15 +116,10 @@ It is unlikely that it can work on Solaris instead.
Other known implementations and discussions
-------------------------------------------
-- `procname`_: a module exposing the same functionality, but less portable
+- `procname`_: a module exposing the same functionality, but less portable
and not well packaged.
- `Issue 5672`_: where the introduction of such functionality into the stdlib
is being discussed.
.. _procname: http://code.google.com/p/procname/
.. _Issue 5672: http://bugs.python.org/issue5672
-
-
-..
- vim: set filetype=rst:
-
diff --git a/PKG-INFO b/setproctitle.egg-info/PKG-INFO
similarity index 78%
copy from PKG-INFO
copy to setproctitle.egg-info/PKG-INFO
index 157a03e..cdc66fa 100644
--- a/PKG-INFO
+++ b/setproctitle.egg-info/PKG-INFO
@@ -1,19 +1,19 @@
Metadata-Version: 1.1
Name: setproctitle
-Version: 1.1.8
-Summary: A library to allow customization of the process title.
-Home-page: http://code.google.com/p/py-setproctitle/
+Version: 1.1.10
+Summary: A Python module to customize the process title
+Home-page: https://github.com/dvarrazzo/py-setproctitle
Author: Daniele Varrazzo
Author-email: daniele.varrazzo at gmail.com
License: BSD
Download-URL: http://pypi.python.org/pypi/setproctitle/
-Description: A ``setproctitle`` implementation for Python
- ============================================
+Description: A Python module to customize the process title
+ ==============================================
:author: Daniele Varrazzo
- The library allows a process to change its title (as displayed by system tools
- such as ``ps`` and ``top``).
+ The ``setproctitle`` module allows a process to change its title (as displayed
+ by system tools such as ``ps`` and ``top``).
Changing the title is mostly useful in multi-process systems, for example
when a master process is forked: changing the children's title allows to
@@ -24,10 +24,9 @@ Description: A ``setproctitle`` implementation for Python
a good `multi-platform implementation`__: this module is a Python wrapper
around PostgreSQL code.
- - `Homepage <http://code.google.com/p/py-setproctitle/>`__
+ - `Homepage <https://github.com/dvarrazzo/py-setproctitle>`__
- `Download <http://pypi.python.org/pypi/setproctitle/>`__
- - `Source repository <https://github.com/dvarrazzo/py-setproctitle>`__
- - `Bug tracker <http://code.google.com/p/py-setproctitle/issues/list>`__
+ - `Bug tracker <https://github.com/dvarrazzo/py-setproctitle/issues>`__
.. _PostgreSQL: http://www.postgresql.org
@@ -38,30 +37,30 @@ Description: A ``setproctitle`` implementation for Python
Installation
------------
- You can use ``easy_install`` to install the module: to perform a system-wide
- installation use::
+ ``setproctitle`` is a C extension: in order to build it you will need a C
+ compiler and the Python development support (the ``python-dev`` package in
+ most Linux distributions). No further external dependencies are required.
- sudo easy_install setproctitle
+ You can use ``pip`` to install the module::
- If you are an unprivileged user or you want to limit installation to a local
- environment, you can use the command::
+ pip install setproctitle
- easy_install -d /target/path setproctitle
+ You can use ``pip -t`` or ``virtualenv`` for local installations, ``sudo pip``
+ for a system-wide one... the usual stuff. Read pip_ or virtualenv_ docs for
+ all the details.
- Note that ``easy_install`` requires ``/target/path`` to be in your
- ``PYTHONPATH``.
+ .. _pip: https://pip.readthedocs.org/
+ .. _virtualenv: https://virtualenv.readthedocs.org/
Python 3 support
~~~~~~~~~~~~~~~~
- As of version 1.1 the module works with Python 3. In order to install the
- module, you can use the `distribute`_ replacemente for ``easy_install``.
+ As of version 1.1 the module works with Python 3. Just use
+ ``pip``/``virtualenv`` for Python 3.
- In order to build and test the module under Python 3, the ``Makefile``
- contains some helper targets.
-
- .. _distribute: http://pypi.python.org/pypi/distribute
+ In order to build from the source package and test the module under Python 3,
+ the ``Makefile`` contains some helper targets.
Usage
@@ -126,7 +125,7 @@ Description: A ``setproctitle`` implementation for Python
Other known implementations and discussions
-------------------------------------------
- - `procname`_: a module exposing the same functionality, but less portable
+ - `procname`_: a module exposing the same functionality, but less portable
and not well packaged.
- `Issue 5672`_: where the introduction of such functionality into the stdlib
is being discussed.
@@ -134,25 +133,36 @@ Description: A ``setproctitle`` implementation for Python
.. _procname: http://code.google.com/p/procname/
.. _Issue 5672: http://bugs.python.org/issue5672
+ Releases history
+ ----------------
- ..
- vim: set filetype=rst:
+ Version 1.1.10
+ ~~~~~~~~~~~~~~
+ - Fixed building with certain ``prctl.h`` implementations (issue #44).
+ - Use ``setuptools`` if available (issue #48).
+
+
+ Version 1.1.9
+ ~~~~~~~~~~~~~
+
+ - Fixed build on VC (issues #20, #33).
+ - Added ``MANIFEST.in`` to the source distribution to help with RPM building
+ (issue #30).
- Releases history
- ----------------
Version 1.1.8
~~~~~~~~~~~~~
- - Added support for Python "diehard" 2.4.
+ - Added support for Python "diehard" 2.4 (pull request #3).
- Fixed build on Mac OS X 10.9 Maverick (issue #27).
Version 1.1.7
~~~~~~~~~~~~~
- - Added PyPy support, courtesy of Ozan Turksever (http://www.logsign.net).
+ - Added PyPy support, courtesy of Ozan Turksever - http://www.logsign.net
+ (pull request #2).
Version 1.1.6
diff --git a/setproctitle.egg-info/SOURCES.txt b/setproctitle.egg-info/SOURCES.txt
new file mode 100644
index 0000000..371e452
--- /dev/null
+++ b/setproctitle.egg-info/SOURCES.txt
@@ -0,0 +1,23 @@
+COPYRIGHT
+HISTORY.rst
+MANIFEST.in
+Makefile
+README.rst
+setup.py
+setproctitle.egg-info/PKG-INFO
+setproctitle.egg-info/SOURCES.txt
+setproctitle.egg-info/dependency_links.txt
+setproctitle.egg-info/top_level.txt
+src/c.h
+src/setproctitle.c
+src/spt.h
+src/spt_config.h
+src/spt_debug.c
+src/spt_python.h
+src/spt_setup.c
+src/spt_setup.h
+src/spt_status.c
+src/spt_status.h
+src/spt_strlcpy.c
+tests/pyrun.c
+tests/setproctitle_test.py
\ No newline at end of file
diff --git a/setproctitle.egg-info/dependency_links.txt b/setproctitle.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/setproctitle.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/setproctitle.egg-info/top_level.txt b/setproctitle.egg-info/top_level.txt
new file mode 100644
index 0000000..2d5c293
--- /dev/null
+++ b/setproctitle.egg-info/top_level.txt
@@ -0,0 +1 @@
+setproctitle
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..861a9f5
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
index ebf4e7e..1ba489c 100644
--- a/setup.py
+++ b/setup.py
@@ -2,17 +2,23 @@
"""
setproctitle setup script.
-Copyright (c) 2009-2013 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
"""
-VERSION = '1.1.8'
-
import os
import re
import sys
-from distutils.core import setup, Extension
-define_macros={}
+try:
+ from setuptools import setup, Extension
+except ImportError:
+ from distutils.core import setup, Extension
+
+
+VERSION = '1.1.10'
+
+
+define_macros = {}
define_macros['SPT_VERSION'] = VERSION
@@ -20,7 +26,7 @@ if sys.platform.startswith('linux'):
try:
linux_version = list(map(int,
re.search("[.0-9]+", os.popen("uname -r").read())
- .group().split(".")[:3]))
+ .group().split(".")[:3]))
except:
pass
else:
@@ -31,7 +37,7 @@ elif sys.platform == 'darwin':
# __darwin__ symbol is not defined; __APPLE__ is instead.
define_macros['__darwin__'] = 1
-elif 'bsd' in sys.platform: # OMG, how many of them are?
+elif 'bsd' in sys.platform: # OMG, how many of them are?
# Old BSD versions don't have setproctitle
# TODO: not tested on an "old BSD"
if 0 == os.spawnlp(os.P_WAIT, 'grep',
@@ -40,20 +46,20 @@ elif 'bsd' in sys.platform: # OMG, how many of them are?
else:
define_macros['HAVE_PS_STRING'] = 1
-# NOTE: the library may work on HP-UX using pstat
+# NOTE: the module may work on HP-UX using pstat
# thus setting define_macros['HAVE_SYS_PSTAT_H']
# see http://www.noc.utoronto.ca/~mikep/unix/HPTRICKS
# But I have none handy to test with.
mod_spt = Extension('setproctitle',
define_macros=list(define_macros.items()),
- sources = [
+ sources=[
'src/setproctitle.c',
'src/spt_debug.c',
'src/spt_setup.c',
'src/spt_status.c',
'src/spt_strlcpy.c',
- ])
+ ])
# patch distutils if it can't cope with the "classifiers" or
# "download_url" keywords
@@ -66,23 +72,23 @@ if sys.version < '2.2.3':
kwargs = {}
try:
kwargs['long_description'] = (
- open('README.rst').read()
- + '\n'
- +open('HISTORY.rst').read())
+ open('README.rst').read() +
+ '\n' +
+ open('HISTORY.rst').read())
except:
pass
setup(
- name = 'setproctitle',
- description = 'A library to allow customization of the process title.',
- version = VERSION,
- author = 'Daniele Varrazzo',
- author_email = 'daniele.varrazzo at gmail.com',
- url = 'http://code.google.com/p/py-setproctitle/',
- download_url = 'http://pypi.python.org/pypi/setproctitle/',
- license = 'BSD',
- platforms = ['GNU/Linux', 'BSD', 'MacOS X', 'Windows'],
- classifiers = [ r for r in map(str.strip, """
+ name='setproctitle',
+ description='A Python module to customize the process title',
+ version=VERSION,
+ author='Daniele Varrazzo',
+ author_email='daniele.varrazzo at gmail.com',
+ url='https://github.com/dvarrazzo/py-setproctitle',
+ download_url='http://pypi.python.org/pypi/setproctitle/',
+ license='BSD',
+ platforms=['GNU/Linux', 'BSD', 'MacOS X', 'Windows'],
+ classifiers=[r for r in map(str.strip, """
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: BSD License
@@ -95,5 +101,5 @@ setup(
Operating System :: Microsoft :: Windows
Topic :: Software Development
""".splitlines()) if r],
- ext_modules = [mod_spt],
+ ext_modules=[mod_spt],
**kwargs)
diff --git a/src/c.h b/src/c.h
index b2addbc..9c93fa5 100644
--- a/src/c.h
+++ b/src/c.h
@@ -3,7 +3,7 @@
* c.h
* A few fundamental C definitions.
*
- * Copyright (c) 2009-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*-------------------------------------------------------------------------
*/
@@ -32,6 +32,13 @@ typedef char bool;
/* Let's use our version of strlcpy to avoid portability problems */
size_t spt_strlcpy(char *dst, const char *src, size_t siz);
+/* VC defines _WIN32, not WIN32 */
+#ifdef _WIN32
+#ifndef WIN32
+#define WIN32 _WIN32
+#endif
+#endif
+
#ifdef WIN32
#include <Windows.h>
#endif
diff --git a/src/setproctitle.c b/src/setproctitle.c
index 0ae6436..ea3e418 100644
--- a/src/setproctitle.c
+++ b/src/setproctitle.c
@@ -3,7 +3,7 @@
* setproctitle.c
* Python extension module to update and read the process title.
*
- * Copyright (c) 2009-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*
* The module allows Python code to access the functions get_ps_display()
* and set_ps_display().
diff --git a/src/spt.h b/src/spt.h
index a7ebd62..0522779 100644
--- a/src/spt.h
+++ b/src/spt.h
@@ -3,7 +3,7 @@
* spt.h
* Definitions useful throughout all the extension.
*
- * Copyright (c) 2010-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2010-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*
*-------------------------------------------------------------------------
*/
diff --git a/src/spt_debug.c b/src/spt_debug.c
index 96b1122..e610521 100644
--- a/src/spt_debug.c
+++ b/src/spt_debug.c
@@ -3,7 +3,7 @@
* spt_python.c
* A simple function for the module debugging.
*
- * Copyright (c) 2009-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*
* Debug logging is enabled if the environment variable SPT_DEBUG is set to a
* non-empty value at runtime.
diff --git a/src/spt_python.h b/src/spt_python.h
index 2d7ae1f..68c7774 100644
--- a/src/spt_python.h
+++ b/src/spt_python.h
@@ -3,7 +3,7 @@
* spt_python.h
* Include and customize Python definitions.
*
- * Copyright (c) 2010-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2010-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*
*-------------------------------------------------------------------------
*/
diff --git a/src/spt_setup.c b/src/spt_setup.c
index 8942a20..908698e 100644
--- a/src/spt_setup.c
+++ b/src/spt_setup.c
@@ -3,7 +3,7 @@
* spt_setup.c
* Initalization code for the spt_status.c module functions.
*
- * Copyright (c) 2009-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*
*-------------------------------------------------------------------------
*/
diff --git a/src/spt_setup.h b/src/spt_setup.h
index c395a7c..9a8bb2e 100644
--- a/src/spt_setup.h
+++ b/src/spt_setup.h
@@ -3,7 +3,7 @@
* spt_setup.h
* Initalization code for the spt_status.c module functions.
*
- * Copyright (c) 2009-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*
*-------------------------------------------------------------------------
*/
diff --git a/src/spt_status.c b/src/spt_status.c
index 18f860c..b0d6055 100644
--- a/src/spt_status.c
+++ b/src/spt_status.c
@@ -5,7 +5,7 @@
* Mechanism differs wildly across platforms.
*
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
- * Copyright (C) 2009-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
* various details abducted from various places
*
* This file was taken from PostgreSQL. The PostgreSQL copyright terms follow.
@@ -40,7 +40,12 @@
#include "spt_config.h"
+/* note: VC doesn't have this, but it was working on mingw instead
+ * so check on _WIN32 (defined by VC) instead of WIN32 */
+#ifndef _WIN32
#include <unistd.h>
+#endif
+
#ifdef HAVE_SYS_PSTAT_H
#include <sys/pstat.h> /* for HP-UX */
#endif
@@ -50,7 +55,6 @@
#endif
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h> /* for Linux >= 2.6.9 */
-#include <linux/prctl.h>
#endif
#if defined(__darwin__)
#include <crt_externs.h>
diff --git a/tests/pyrun.c b/tests/pyrun.c
index 9ec8267..3bb2e7a 100644
--- a/tests/pyrun.c
+++ b/tests/pyrun.c
@@ -5,7 +5,7 @@
*
* Run a Python program read from stdin. In case of error return 1.
*
- * Copyright (c) 2011-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+ * Copyright (c) 2011-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
*
*-------------------------------------------------------------------------
*/
diff --git a/tests/setproctitle_test.py b/tests/setproctitle_test.py
index a71b02d..d077167 100644
--- a/tests/setproctitle_test.py
+++ b/tests/setproctitle_test.py
@@ -2,7 +2,7 @@
Use nosetests to run this test suite.
-Copyright (c) 2009-2012 Daniele Varrazzo <daniele.varrazzo at gmail.com>
+Copyright (c) 2009-2016 Daniele Varrazzo <daniele.varrazzo at gmail.com>
"""
import os
@@ -30,6 +30,7 @@ if unittest.TestCase.assert_ is not unittest.TestCase.assertTrue:
# Vaffanculo, Wolf
unittest.TestCase.assert_ = unittest.TestCase.assertTrue
+
class SetproctitleTestCase(unittest.TestCase):
"""Test the module works as expected.
@@ -77,7 +78,7 @@ class SetproctitleTestCase(unittest.TestCase):
def test_prctl(self):
"""Check that prctl is called on supported platforms."""
linux_version = []
- if sys.platform == 'linux2':
+ if sys.platform in ('linux', 'linux2'):
try:
f = os.popen("uname -r")
name = f.read()
@@ -86,10 +87,9 @@ class SetproctitleTestCase(unittest.TestCase):
pass
else:
linux_version = map(int,
- re.search("[.0-9]+", name)
- .group().split(".")[:3])
+ re.search("[.0-9]+", name).group().split(".")[:3])
- if linux_version < [2,6,9]:
+ if linux_version < [2, 6, 9]:
raise SkipTest("syscall not supported")
rv = self.run_script(r"""
@@ -384,6 +384,7 @@ class SetproctitleTestCase(unittest.TestCase):
"title (len %s) not limited to argv (len %s)"
% (title_len, cmdline_len))
+ # Support functions
def run_script(self, script=None, args=None, executable=None, env=None):
"""run a script in a separate process.
@@ -460,12 +461,12 @@ class SetproctitleTestCase(unittest.TestCase):
if not script:
raise ValueError("empty script")
- line1 = script[0]
spaces = script[0][:-len(script[0].lstrip())]
assert spaces.isspace()
for i, line in enumerate(script):
- if line.isspace(): continue
+ if line.isspace():
+ continue
if line.find(spaces) != 0:
raise ValueError("inconsistent spaces at line %d (%s)"
% (i + 1, line.strip()))
@@ -485,7 +486,7 @@ class SetproctitleTestCase(unittest.TestCase):
if 'bsd' in sys.platform:
procname = os.path.basename(sys.executable)
title = ' '.join([t for t in title.split(' ')
- if procname not in t])
+ if procname not in t])
return title
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-setproctitle.git
More information about the Python-modules-commits
mailing list