wepoll 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
wepoll-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: wepoll
3
+ Version: 0.1.0
4
+ Summary: Cython adaptation of the wepoll C Library providing epoll selectors to windows
5
+ Author-email: Vizonex <VizonexBusiness@gmail.com>
6
+ License: MIT License
7
+ Project-URL: homepage, https://github.com/Vizonex/pywepoll
8
+ Project-URL: repository, https://github.com/Vizonex/pywepoll.git
9
+ Requires-Python: >=3.9
wepoll-0.1.0/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # PyWepoll
2
+ A Python Port of the wepoll C Library meant to help give windows support for epoll objects in python. Code was based on CPython's implementation mixed with the old _epoll.pyx twisted source code. (If I can refind it I'll try to archive it for someone to look through.)
3
+
4
+ ## How this project came to be
5
+ Originally this was C Library was going to be utilized in [winloop](https://github.com/Vizonex/winloop) for dealing with `UVPoll` objects but the idea was scrapped when I didn't realize that the License was actually MIT LICENSE Friendly and I was still a bit of a noob at low-level coding. Knowing about this project for a couple of years I wanted to experiemnt with it using [cyares](https://github.com/Vizonex/cyares) to see if it would help with polling sockets if needed to be done manually without socket handles or event-threads to see if it would provide one of the slowest Operating Systems a little performance boost over the standard `select` function that python provides.
6
+
7
+ Currently as is the library is experimental and I wouldn't call it beta or production ready yet unlike cyares which is in it's beta phase and does a really good job performance-wise.
8
+ The Code is based off the old twisted module
9
+
@@ -0,0 +1,24 @@
1
+ [project]
2
+ name = "wepoll"
3
+ description = "Cython adaptation of the wepoll C Library providing epoll selectors to windows"
4
+ version = "0.1.0"
5
+ authors = [
6
+ { name = "Vizonex", email = "VizonexBusiness@gmail.com" }
7
+ ]
8
+ license = {text = "MIT License"}
9
+ requires-python = ">=3.9"
10
+ dependencies = []
11
+
12
+ [tool.cibuildwheel]
13
+ build-frontend = "build"
14
+
15
+ [build-system]
16
+ requires = ["setuptools", "cython", "wheel"]
17
+
18
+ [tool.setuptools]
19
+ zip-safe = false
20
+ packages = ['wepoll']
21
+
22
+ [project.urls]
23
+ homepage = "https://github.com/Vizonex/pywepoll"
24
+ repository = "https://github.com/Vizonex/pywepoll.git"
wepoll-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
wepoll-0.1.0/setup.py ADDED
@@ -0,0 +1,15 @@
1
+ from Cython.Build import cythonize
2
+ from setuptools import Extension, setup
3
+
4
+ setup(
5
+ ext_modules=cythonize(
6
+ [
7
+ Extension(
8
+ "wepoll._wepoll",
9
+ ["wepoll/_wepoll.pyx", "vendor/wepoll/wepoll.c"],
10
+ include_dirs=["vendor/wepoll"],
11
+ libraries=["advapi32", "iphlpapi", "psapi", "ws2_32"],
12
+ )
13
+ ]
14
+ )
15
+ )
@@ -0,0 +1,19 @@
1
+ from wepoll import WepollEventLoop
2
+ from cyares.aio import DNSResolver
3
+ import pytest
4
+
5
+ import anyio
6
+
7
+
8
+ @pytest.fixture(
9
+ params=[pytest.param(("asyncio", {"loop_factory": WepollEventLoop}), id="asyncio[WepollEventLoop]")]
10
+ )
11
+ def anyio_backend(request: pytest.FixtureRequest):
12
+ return request.param
13
+
14
+ @pytest.mark.anyio
15
+ async def test_dns_resolver_over_wepoll(anyio_backend):
16
+ async with DNSResolver(["8.8.8.8", "8.8.4.4"], event_thread=False) as dns:
17
+ assert await dns.query("google.com", "A")
18
+
19
+
@@ -0,0 +1,25 @@
1
+ import selectors
2
+ import tempfile
3
+ import unittest
4
+ from test.test_selectors import ScalableSelectorMixIn, BaseSelectorTestCase
5
+ from wepoll import EpollSelector
6
+
7
+ # Code is borrowed from python's testsuite ensure wepoll matches up with unix epolls
8
+
9
+ class EpollSelectorTestCase(BaseSelectorTestCase, ScalableSelectorMixIn,
10
+ unittest.TestCase):
11
+
12
+ SELECTOR = EpollSelector
13
+ def test_modify_unregister(self):
14
+ raise self.skipTest("")
15
+
16
+ def test_register_file(self):
17
+ # epoll(7) returns EPERM when given a file to watch
18
+ s = self.SELECTOR()
19
+ with tempfile.NamedTemporaryFile() as f:
20
+ with self.assertRaises(IOError):
21
+ s.register(f, selectors.EVENT_READ)
22
+ # the SelectorKey has been removed
23
+ with self.assertRaises(KeyError):
24
+ s.get_key(f)
25
+