Comments (8)
Wow, great work! Yes, I would like to integrate it, of course! I think we should do as follows:
- Have the main pycares module, and then a _core and _cfficore modules
- By default build the cffi core on PyPy, and the regular one elsewhere
- If an env var is set or an option is passed to setup.py, we could build the cffi version too on CPython
How does it sound? If this something you'd like to work on? If so, feel free to send a Pull Request when you are ready for review!
from pycares.
Does _cfficore dpends on _core, or _cfficore contain C cares library iteself ? Use simple python init.py to wrap standard _core module?
from pycares.
So, I think _core would be the current pycares, that is, embedding c-ares. Then _cfficore would be what you wrote, and in __init__.py
we'd try-import one or the other.
from pycares.
On python, should build two or only build one? If only build one, I think no need to rename current pycares.pyd to _core.pyd .
If build both on python , should usage cffi version like below ?
import pycares.cffi as pycares
And normal usage is
import pycares
from pycares.
We would build one or the other, depending on the environment. The reason to use _core and _cfficore is so users can import pycares and not care about it.
Here is a similar approach: https://github.com/saghul/python-fibers in one case I use a C extension, on the other a PyPy builtin.
from pycares.
Done in #29.
from pycares.
This doesn't work as expected. I get this error for pip install pycares from a pypy virtualenv:
File "/usr/lib/pypy/lib_pypy/cffi/setuptools_ext.py", line 128, in run
ext.sources[0] = make_mod(self.build_temp, pre_run)
File "/usr/lib/pypy/lib_pypy/cffi/setuptools_ext.py", line 114, in make_mod
updated = recompiler.make_c_source(ffi, module_name, source, c_file)
File "/usr/lib/pypy/lib_pypy/cffi/recompiler.py", line 1365, in make_c_source
verbose)
File "/usr/lib/pypy/lib_pypy/cffi/recompiler.py", line 1340, in _make_c_or_py_source
recompiler.collect_step_tables()
File "/usr/lib/pypy/lib_pypy/cffi/recompiler.py", line 233, in collect_step_tables
self._generate("ctx")
File "/usr/lib/pypy/lib_pypy/cffi/recompiler.py", line 218, in _generate
method(tp, realname)
File "/usr/lib/pypy/lib_pypy/cffi/recompiler.py", line 962, in _generate_cpy_struct_ctx
self._struct_ctx(tp, *self._struct_names(tp))
File "/usr/lib/pypy/lib_pypy/cffi/recompiler.py", line 866, in _struct_ctx
"field '%s.%s'" % (tp.name, fldname))
File "/usr/lib/pypy/lib_pypy/cffi/recompiler.py", line 921, in _check_not_opaque
"%s is of an opaque type (not declared in cdef())" % location)
TypeError: struct sockaddr_in6: field 'sockaddr_in6.sin6_addr' is of an opaque type (not declared in cdef())
Complete output from command /root/venv_smtpout_pypy30/bin/pypy -c "import setuptools, tokenize;__file__='/root/venv_smtpout_pypy30/build/pycares/setup.py';exec(compile(getattr(tokenize, 'open',:
running install
I don't get this when i'm running boytm's fork from github.
from pycares.
Can you please open a new issue? Please mention what platform you're running, since the CFFI port works fine in the CI, but might still need some tweaking. Thanks!
from pycares.
Related Issues (20)
- gethostbyname() does not appear to work with lookups="f"
- python3 setup.py build failed in [email protected] on centos8_aarch64 HOT 2
- CNAME answers to A request HOT 6
- pytest failed in [email protected] on centos8_aarch64 HOT 1
- Error FileNotFound when installing pycares==4.1.1 HOT 8
- 4.1.2: pytest is failing HOT 5
- `pycares.reverse_address` Import Error HOT 2
- Security vulnerability HOT 2
- 4.2.0: sphinx warnings `reference target not found` HOT 2
- 3.11 wheels HOT 2
- Can't build from sources on EL8 HOT 3
- 4.2.2: pytest is failing in two units HOT 8
- Fail to install on centos docker HOT 4
- 4.3.0: pytest is failing in `tests/test_all.py::DNSTest::test_custom_resolvconf` unit HOT 5
- test_query_class_chaos started failing
- TLSA record HOT 1
- pycares fails to install in arm8 android device HOT 16
- Update c-ares to 1.24 HOT 1
- [NOT_CRITICAL] Missing Flags: ARES_FLAG_EDNS, ARES_FLAG_NO_DFLT_SVR HOT 1
- Intermittent freeze: Channel.query() call never returning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycares.