Skip to content

Commit

Permalink
version 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lekma committed Sep 13, 2021
1 parent 4becd6a commit 9139210
Show file tree
Hide file tree
Showing 18 changed files with 726 additions and 373 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# General information about the project.
project = 'mood.event'
copyright = '2020, lekma'
copyright = '2021, lekma'
author = 'lekma'

# The version info for the project you're documenting, acts as replacement for
Expand Down
2 changes: 1 addition & 1 deletion mood/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

#
# Copyright © 2020 Malek Hadj-Ali
# Copyright © 2021 Malek Hadj-Ali
# All rights reserved.
#
# This file is part of mood.
Expand Down
131 changes: 68 additions & 63 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

#
# Copyright © 2020 Malek Hadj-Ali
# Copyright © 2021 Malek Hadj-Ali
# All rights reserved.
#
# This file is part of mood.
Expand Down Expand Up @@ -33,16 +33,18 @@

# pkg
pkg_name = "mood.event"
pkg_version = "1.5.0"
pkg_version = "1.5.1"
pkg_desc = "Python libev interface"

PKG_VERSION = ("PKG_VERSION", "\"{0}\"".format(pkg_version))

err_msg = "Aborted: {0}-{1} requires {{0}} >= {{1}}".format(pkg_name, pkg_version)

def check_version(current_version, minimum_version, name):
if (not current_version or
(LooseVersion(current_version) < LooseVersion(minimum_version))):
if (
not current_version or
(LooseVersion(current_version) < LooseVersion(minimum_version))
):
raise SystemExit(err_msg.format(name, minimum_version))


Expand All @@ -54,71 +56,74 @@ def libev_version():
libev_dll_name = find_library(libev_name)
if libev_dll_name:
libev_dll = cdll.LoadLibrary(libev_dll_name)
return "{0}.{1}".format(libev_dll.ev_version_major(),
libev_dll.ev_version_minor())
return "{0}.{1}".format(
libev_dll.ev_version_major(), libev_dll.ev_version_minor()
)


# setup
if "sdist" not in argv:
check_version(libev_version(), libev_min_version, "libev")

setup(
name=pkg_name,
version=pkg_version,
description=pkg_desc,
long_description=open(abspath("README.txt"), encoding="utf-8").read(),
long_description_content_type="text",

url="https://github.com/lekma/mood.event",
download_url="https://github.com/lekma/mood.event/releases",
project_urls={
"Documentation": "https://mood.readthedocs.io/projects/event/",
"Bug Tracker": "https://github.com/lekma/mood.event/issues"
},
author="Malek Hadj-Ali",
author_email="lekmalek@gmail.com",
license="GNU General Public License v3 (GPLv3)",
platforms=["POSIX"],
keywords="libev event",

setup_requires = ["setuptools>=24.2.0"],
python_requires="~=3.8",
packages=find_packages(),
namespace_packages=["mood"],
zip_safe=False,

ext_package="mood",
ext_modules=[
Extension("event",
[
"src/helpers/helpers.c",
"src/Loop.c",
"src/Watcher.c",
"src/Io.c",
"src/Timer.c",
"src/Periodic.c",
"src/Signal.c",
"src/Child.c",
"src/Idle.c",
"src/Prepare.c",
"src/Check.c",
"src/Embed.c",
"src/Fork.c",
"src/Async.c",
"src/event.c",
],
define_macros=[PKG_VERSION],
libraries=[libev_name])
],

classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: CPython"
]
name=pkg_name,
version=pkg_version,
description=pkg_desc,
long_description=open(abspath("README.txt"), encoding="utf-8").read(),
long_description_content_type="text",

url="https://github.com/lekma/mood.event",
download_url="https://github.com/lekma/mood.event/releases",
project_urls={
"Documentation": "https://mood.readthedocs.io/projects/event/",
"Bug Tracker": "https://github.com/lekma/mood.event/issues"
},
author="Malek Hadj-Ali",
author_email="lekmalek@gmail.com",
license="GNU General Public License v3 (GPLv3)",
platforms=["POSIX"],
keywords="libev event",

setup_requires = ["setuptools>=24.2.0"],
python_requires="~=3.8",
packages=find_packages(),
namespace_packages=["mood"],
zip_safe=False,

ext_package="mood",
ext_modules=[
Extension(
"event",
[
"src/helpers/helpers.c",
"src/Loop.c",
"src/Watcher.c",
"src/Io.c",
"src/Timer.c",
"src/Periodic.c",
"src/Signal.c",
"src/Child.c",
"src/Idle.c",
"src/Prepare.c",
"src/Check.c",
"src/Embed.c",
"src/Fork.c",
"src/Async.c",
"src/event.c",
],
define_macros=[PKG_VERSION],
libraries=[libev_name]
)
],

classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: CPython"
]
)

28 changes: 19 additions & 9 deletions src/Async.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
#
# Copyright © 2020 Malek Hadj-Ali
# Copyright © 2021 Malek Hadj-Ali
# All rights reserved.
#
# This file is part of mood.
Expand Down Expand Up @@ -58,8 +58,10 @@ Async_send(Watcher *self)

/* Async_Type.tp_methods */
static PyMethodDef Async_tp_methods[] = {
{"send", (PyCFunction)Async_send, METH_NOARGS,
"send()"},
{
"send", (PyCFunction)Async_send,
METH_NOARGS, "send()"
},
{NULL} /* Sentinel */
};

Expand All @@ -74,8 +76,10 @@ Async_sent_getter(Watcher *self, void *closure)

/* Async_Type.tp_getsets */
static PyGetSetDef Async_tp_getsets[] = {
{"sent", (getter)Async_sent_getter,
_Py_READONLY_ATTRIBUTE, NULL, NULL},
{
"sent", (getter)Async_sent_getter,
_Py_READONLY_ATTRIBUTE, NULL, NULL
},
{NULL} /* Sentinel */
};

Expand All @@ -97,16 +101,22 @@ PyTypeObject Async_Type = {
Watcher *
Async_New(Loop *loop, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = {"callback", "data", "priority", NULL};
static char *kwlist[] = {
"callback", "data", "priority", NULL
};

PyObject *callback = NULL, *data = Py_None;
int priority = 0;
Watcher *self = NULL;

if (PyArg_ParseTupleAndKeywords(args, kwargs, "O|Oi:async", kwlist,
&callback, &data, &priority) &&
if (
PyArg_ParseTupleAndKeywords(
args, kwargs, "O|Oi:async", kwlist,
&callback, &data, &priority
) &&
(self = __Async_New(&Async_Type)) &&
Watcher_Init(self, loop, callback, data, priority)) {
Watcher_Init(self, loop, callback, data, priority)
) {
Py_CLEAR(self);
}
return self;
Expand Down
16 changes: 11 additions & 5 deletions src/Check.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
#
# Copyright © 2020 Malek Hadj-Ali
# Copyright © 2021 Malek Hadj-Ali
# All rights reserved.
#
# This file is part of mood.
Expand Down Expand Up @@ -62,16 +62,22 @@ PyTypeObject Check_Type = {
Watcher *
Check_New(Loop *loop, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = {"callback", "data", "priority", NULL};
static char *kwlist[] = {
"callback", "data", "priority", NULL
};

PyObject *callback = NULL, *data = Py_None;
int priority = 0;
Watcher *self = NULL;

if (PyArg_ParseTupleAndKeywords(args, kwargs, "O|Oi:check", kwlist,
&callback, &data, &priority) &&
if (
PyArg_ParseTupleAndKeywords(
args, kwargs, "O|Oi:check", kwlist,
&callback, &data, &priority
) &&
(self = __Check_New(&Check_Type)) &&
Watcher_Init(self, loop, callback, data, priority)) {
Watcher_Init(self, loop, callback, data, priority)
) {
Py_CLEAR(self);
}
return self;
Expand Down
Loading

0 comments on commit 9139210

Please sign in to comment.