335 questions
1
vote
1
answer
46
views
Trying to build Python extension (module) with Dlang and pyd with dub + ldc2
I am trying to build a Python extension (module) with D and the pyd (https://github.com/ariovistus/pyd) and dub and ldc2 compiler on Windows.
I have the following dub.sdl:
name "hello"
...
1
vote
0
answers
61
views
How to programmatically set a default Jupyter kernel in VSCode integration tests?
We're developing a VSCode extension that works with Jupyter notebooks and need to run integration tests in CI/CD. The main issue is that when running integration tests, VSCode prompts the user to ...
0
votes
0
answers
82
views
Rendering special characters with Weasyprint
I have an MkDocs site with the pymdownx.keys plugin. The plugin includes formatting for a number of keys along with unicode characters:
When I try to convert the page to PDF using Weasyprint, the ...
0
votes
1
answer
218
views
Compilation Error installing pyo on mac os x on m3
I'm puzzled by the following issue. I have a Mac M3 with the following characteristics.
I have Python 3.12.6. I have been trying to install pyo (https://pypi.org/project/pyo/1.0.1/). After many ...
0
votes
0
answers
73
views
Right way to avoid multiple definition error when building Python C++ extension with MSVC BuildTools
A python C++ extension has the following structure:
/myextension
|_____basecode
| |__header.h
| |__functions.cpp
|
|_____utilities
| |______utilities.h
| |...
1
vote
0
answers
243
views
How to wrap a PyDict in PyO3 with a constructor that takes a new parameter?
I am using PyO3 (v0.22.2) / Rust to write something a little similar to defaultdict, but with an integer default rather than a callback:
>>> from my_package.pyo3_ext import PyDefaultDict
>...
0
votes
0
answers
32
views
Gecode Attribute Not Available In Phonenumbers Geocoder Library
I am working on PYCharm IDE application for getting address from latitude and longitude and I have also installed phonenumber and geocoder library to the project in PYCharm IDE but unfortunately ...
1
vote
0
answers
35
views
Python C++ extension DLL is not imported in python interpreter
I have written a Python extension in C/C++ to wrap my code for Python.
I followed CPython documentation in the parts of C/C++ functions each module should provide
For example, my module contains:
/* ...
2
votes
0
answers
47
views
Python C Extension When to Free Internal Free List?
Some Python objects - for example, instances of int, float and dict - use a free list to speed up allocations. The C API provides methods to clear such free lists.
By hardcoding PyXXX_ClearFreeList ...
0
votes
0
answers
263
views
Python C Extension - Access to PyInterpreterState Internal Data Structure
I recently found that I could get the Python interpreter state by PyInterpreterState_Get() C-API. However, when I tried to access its members defined by struct _is in the extension code, during the ...
0
votes
1
answer
85
views
How to properly deepcopy linked objects in C Extension
In Python, I have a pair of classes like
class Internal:
def __init__(self, ref):
self.ref = ref
class External:
def __init__(self):
self.storage = [1,2,3]
self.int = ...
2
votes
1
answer
152
views
Understanding memory leak with C++ extension for python
I have been struggling to understand what I am doing wrong with the memory management of this this C++ function for a python module, but I don't have much experience in this regard.
Every time I run ...
3
votes
0
answers
529
views
How do you tell setuptools to build an extension for --debug when using pyproject.toml / PEP 518
I have created a Python project with a C++ extension using pyproject.toml (PEP 518, PEP 517, PEP 621, PEP 660, etc.). I'm sure I could be doing some things better, but generally speaking it's working ...
1
vote
1
answer
440
views
No module named 'pybind11' when using poetry
Used pybind11 in the past without issue pulled in as a submodule and used via cmake. Now working on another project that uses poetry, and so wanted to make everything poetry-centric.
Trying to build ...
2
votes
2
answers
10k
views
"The Pylance server crashed 5 times in the last 3 minutes"? (circa v2023.10.40 of the Pylance VS Code extension)
Every time I launch VS code, the Pylance server crashes 5 times in in 3 minutes, or so the output terminal says. The server stops trying to relaunch and I lose out on a handful of features as a result....