mirror of
https://github.com/capnproto/pycapnp.git
synced 2025-03-04 00:14:45 +01:00
Prepare for v2.0.0b1 release
- Update CHANGELOG.md - Update to bundled capnproto-1.0.1 * Compiles with capnproto-0.8.0 and higher - *Breaking Change* Remove allow_cancellation (see https://capnproto.org/news/2023-07-28-capnproto-1.0.html) * This is tricky to handle for older versions of capnproto. Instead of dealing with lots of complication, removing it entirely. - Fix some documentation after the build backend support was added - Update tox.ini to support 3.8 to 3.12 - Update cibuildwheel to 2.16.1 * Adds Python 3.12 supports and implicitly deprecates EOL 3.7 (though it's still built)
This commit is contained in:
parent
e13a0c9254
commit
313d0d4c6d
9 changed files with 42 additions and 37 deletions
4
.github/workflows/wheels.yml
vendored
4
.github/workflows/wheels.yml
vendored
|
@ -48,10 +48,10 @@ jobs:
|
||||||
# Used to host cibuildwheel
|
# Used to host cibuildwheel
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.12'
|
||||||
|
|
||||||
- name: Install cibuildwheel
|
- name: Install cibuildwheel
|
||||||
run: python -m pip install cibuildwheel==2.12.0
|
run: python -m pip install cibuildwheel==2.16.1
|
||||||
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
run: python -m cibuildwheel --output-dir wheelhouse
|
run: python -m cibuildwheel --output-dir wheelhouse
|
||||||
|
|
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -1,3 +1,17 @@
|
||||||
|
## v2.0.0b1 (2023-10-03)
|
||||||
|
- Update to bundled capnproto-1.0.1
|
||||||
|
- Remove explicit support for Python 3.7 (though wheels are still built for now)
|
||||||
|
- Use custom build backend to support build args (#328)
|
||||||
|
- Update Cython version and Python to 3.12 (#320)
|
||||||
|
- Wrap all capnp code in a context-manager to avoid segfaults (#317)
|
||||||
|
- Schema loading from the wire (#307)
|
||||||
|
- Make pycapnp more GIL friendly (#308)
|
||||||
|
- Use cibuildwheel in ci (#309)
|
||||||
|
- Integrate the KJ event loop into Python's asyncio event loop (#310)
|
||||||
|
- Allow capability implementation methods to be `async` (#312)
|
||||||
|
- Allow reading and writing messages from sockets in `async` mode (#313)
|
||||||
|
- Remove the synchronous RPC mode (#315)
|
||||||
|
|
||||||
## v1.3.0 (2023-01-26)
|
## v1.3.0 (2023-01-26)
|
||||||
- Update to bundled capnproto-0.10.3
|
- Update to bundled capnproto-0.10.3
|
||||||
- Add Python 3.11 to Github Actions builds (#306)
|
- Add Python 3.11 to Github Actions builds (#306)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* cmake (needed for bundled capnproto)
|
* cmake (needed for bundled capnproto)
|
||||||
- ninja (macOS + Linux)
|
- ninja (macOS + Linux)
|
||||||
- Visual Studio 2017+
|
- Visual Studio 2017+
|
||||||
* capnproto-0.10 (>=0.7.0 will also work if linking to system libraries)
|
* capnproto-1.0 (>=0.8.0 will also work if linking to system libraries)
|
||||||
- Not necessary if using bundled capnproto
|
- Not necessary if using bundled capnproto
|
||||||
* Python development headers (i.e. Python.h)
|
* Python development headers (i.e. Python.h)
|
||||||
- Distributables from python.org include these, however they are usually in a separate package on Linux distributions
|
- Distributables from python.org include these, however they are usually in a separate package on Linux distributions
|
||||||
|
|
|
@ -26,7 +26,7 @@ pjoin = os.path.join
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
bundled_version = (0, 10, 3)
|
bundled_version = (1, 0, 1)
|
||||||
libcapnp_name = "capnproto-c++-%i.%i.%i.tar.gz" % (bundled_version)
|
libcapnp_name = "capnproto-c++-%i.%i.%i.tar.gz" % (bundled_version)
|
||||||
libcapnp_url = "https://capnproto.org/" + libcapnp_name
|
libcapnp_url = "https://capnproto.org/" + libcapnp_name
|
||||||
|
|
||||||
|
@ -50,8 +50,13 @@ def localpath(*args):
|
||||||
return os.path.abspath(pjoin(*plist))
|
return os.path.abspath(pjoin(*plist))
|
||||||
|
|
||||||
|
|
||||||
def fetch_archive(savedir, url, fname, force=False):
|
def fetch_archive(savedir, url, force=False):
|
||||||
"""download an archive to a specific location"""
|
"""download an archive to a specific location"""
|
||||||
|
req = urlopen(url)
|
||||||
|
# Lookup filename
|
||||||
|
fname = req.info().get_filename()
|
||||||
|
if not fname:
|
||||||
|
fname = os.path.basename(url)
|
||||||
dest = pjoin(savedir, fname)
|
dest = pjoin(savedir, fname)
|
||||||
if os.path.exists(dest) and not force:
|
if os.path.exists(dest) and not force:
|
||||||
print("already have %s" % fname)
|
print("already have %s" % fname)
|
||||||
|
@ -59,7 +64,6 @@ def fetch_archive(savedir, url, fname, force=False):
|
||||||
print("fetching %s into %s" % (url, savedir))
|
print("fetching %s into %s" % (url, savedir))
|
||||||
if not os.path.exists(savedir):
|
if not os.path.exists(savedir):
|
||||||
os.makedirs(savedir)
|
os.makedirs(savedir)
|
||||||
req = urlopen(url)
|
|
||||||
with open(dest, "wb") as f:
|
with open(dest, "wb") as f:
|
||||||
f.write(req.read())
|
f.write(req.read())
|
||||||
return dest
|
return dest
|
||||||
|
@ -80,7 +84,7 @@ def fetch_libcapnp(savedir, url=None):
|
||||||
if os.path.exists(dest):
|
if os.path.exists(dest):
|
||||||
print("already have %s" % dest)
|
print("already have %s" % dest)
|
||||||
return
|
return
|
||||||
fname = fetch_archive(savedir, url, libcapnp_name)
|
fname = fetch_archive(savedir, url)
|
||||||
tf = tarfile.open(fname)
|
tf = tarfile.open(fname)
|
||||||
with_version = pjoin(savedir, tf.firstmember.path)
|
with_version = pjoin(savedir, tf.firstmember.path)
|
||||||
tf.extractall(savedir)
|
tf.extractall(savedir)
|
||||||
|
|
|
@ -476,7 +476,6 @@ cdef extern from "capnp/capability.h" namespace " ::capnp":
|
||||||
# void adoptResults(Orphan<Results>&& value);
|
# void adoptResults(Orphan<Results>&& value);
|
||||||
# Orphanage getResultsOrphanage(uint firstSegmentWordSize = 0);
|
# Orphanage getResultsOrphanage(uint firstSegmentWordSize = 0);
|
||||||
VoidPromise tailCall(Request & tailRequest)
|
VoidPromise tailCall(Request & tailRequest)
|
||||||
void allowCancellation() except +reraise_kj_exception
|
|
||||||
|
|
||||||
cdef extern from "kj/async.h" namespace " ::kj":
|
cdef extern from "kj/async.h" namespace " ::kj":
|
||||||
cdef cppclass EventPort:
|
cdef cppclass EventPort:
|
||||||
|
|
|
@ -1912,9 +1912,6 @@ cdef class _CallContext:
|
||||||
cpdef release_params(self):
|
cpdef release_params(self):
|
||||||
self.thisptr.releaseParams()
|
self.thisptr.releaseParams()
|
||||||
|
|
||||||
cpdef allow_cancellation(self):
|
|
||||||
self.thisptr.allowCancellation()
|
|
||||||
|
|
||||||
cpdef tail_call(self, _Request tailRequest):
|
cpdef tail_call(self, _Request tailRequest):
|
||||||
return _voidpromise_to_asyncio(self.thisptr.tailCall(move(deref(tailRequest.thisptr_child))))
|
return _voidpromise_to_asyncio(self.thisptr.tailCall(move(deref(tailRequest.thisptr_child))))
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ To force rebuilding the pip package from source (you'll need requirments.txt or
|
||||||
|
|
||||||
pip install --no-binary :all: pycapnp
|
pip install --no-binary :all: pycapnp
|
||||||
|
|
||||||
To force bundling libcapnp (or force system libcapnp), just in case setup.py isn't doing the right thing::
|
To force bundling libcapnp (or force system libcapnp), just in case pip isn't doing the right thing::
|
||||||
|
|
||||||
pip install --no-binary :all: -C force-bundled-libcapnp=True
|
pip install --no-binary :all: -C force-bundled-libcapnp=True
|
||||||
pip install --no-binary :all: -C force-system-libcapnp=True
|
pip install --no-binary :all: -C force-system-libcapnp=True
|
||||||
|
@ -50,11 +50,6 @@ And install pycapnp with::
|
||||||
cd pycapnp
|
cd pycapnp
|
||||||
pip install .
|
pip install .
|
||||||
|
|
||||||
or::
|
|
||||||
|
|
||||||
cd pycapnp
|
|
||||||
python setup.py install
|
|
||||||
|
|
||||||
|
|
||||||
Development
|
Development
|
||||||
-----------
|
-----------
|
||||||
|
@ -72,21 +67,15 @@ Building::
|
||||||
cd pycapnp
|
cd pycapnp
|
||||||
pip install .
|
pip install .
|
||||||
|
|
||||||
or::
|
|
||||||
|
|
||||||
cd pycapnp
|
|
||||||
python setup.py install
|
|
||||||
|
|
||||||
Useful targets for setup.py::
|
Useful targets for setup.py::
|
||||||
|
|
||||||
python setup.py build
|
|
||||||
python setup.py clean
|
python setup.py clean
|
||||||
|
|
||||||
Useful command-line arguments are available for setup.py::
|
Useful command-line arguments are available for pip install::
|
||||||
|
|
||||||
--force-bundled-libcapnp
|
-C force-bundled-libcapnp=True
|
||||||
--force-system-libcapnp
|
-C force-system-libcapnp=True
|
||||||
--libcapnp-url
|
-C libcapnp-url="https://github.com/capnproto/capnproto/archive/master.tar.gz"
|
||||||
|
|
||||||
Testing is done through pytest::
|
Testing is done through pytest::
|
||||||
|
|
||||||
|
|
20
setup.py
20
setup.py
|
@ -22,10 +22,10 @@ from buildutils.build import build_libcapnp
|
||||||
from buildutils.bundle import fetch_libcapnp
|
from buildutils.bundle import fetch_libcapnp
|
||||||
|
|
||||||
|
|
||||||
MAJOR = 1
|
MAJOR = 2
|
||||||
MINOR = 3
|
MINOR = 0
|
||||||
MICRO = 0
|
MICRO = 0
|
||||||
TAG = ""
|
TAG = "b1"
|
||||||
VERSION = "%d.%d.%d%s" % (MAJOR, MINOR, MICRO, TAG)
|
VERSION = "%d.%d.%d%s" % (MAJOR, MINOR, MICRO, TAG)
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,15 +170,16 @@ class build_libcapnp_ext(build_ext_c):
|
||||||
else:
|
else:
|
||||||
print("capnproto already built at {}".format(build_dir))
|
print("capnproto already built at {}".format(build_dir))
|
||||||
|
|
||||||
self.include_dirs += [os.path.join(build_dir, "include")]
|
self.include_dirs = [os.path.join(build_dir, "include")] + self.include_dirs
|
||||||
self.library_dirs += [
|
self.library_dirs = [
|
||||||
os.path.join(build_dir, "lib{}".format(8 * struct.calcsize("P")))
|
os.path.join(build_dir, "lib{}".format(8 * struct.calcsize("P"))),
|
||||||
]
|
os.path.join(build_dir, "lib"),
|
||||||
self.library_dirs += [os.path.join(build_dir, "lib")]
|
] + self.library_dirs
|
||||||
|
|
||||||
# Copy .capnp files from source
|
# Copy .capnp files from source
|
||||||
src_glob = glob.glob(os.path.join(build_dir, "include", "capnp", "*.capnp"))
|
src_glob = glob.glob(os.path.join(build_dir, "include", "capnp", "*.capnp"))
|
||||||
dst_dir = os.path.join(self.build_lib, "capnp")
|
dst_dir = os.path.join(self.build_lib, "capnp")
|
||||||
|
os.makedirs(dst_dir, exist_ok=True)
|
||||||
for file in src_glob:
|
for file in src_glob:
|
||||||
print("copying {} -> {}".format(file, dst_dir))
|
print("copying {} -> {}".format(file, dst_dir))
|
||||||
shutil.copy(file, dst_dir)
|
shutil.copy(file, dst_dir)
|
||||||
|
@ -253,10 +254,11 @@ setup(
|
||||||
"Operating System :: POSIX",
|
"Operating System :: POSIX",
|
||||||
"Programming Language :: C++",
|
"Programming Language :: C++",
|
||||||
"Programming Language :: Cython",
|
"Programming Language :: Cython",
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
"Programming Language :: Python :: Implementation :: PyPy",
|
"Programming Language :: Python :: Implementation :: PyPy",
|
||||||
"Topic :: Communications",
|
"Topic :: Communications",
|
||||||
],
|
],
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -1,5 +1,5 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py37,py38,py39,py310,py311
|
envlist = py38,py39,py310,py311,py12
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
|
Loading…
Add table
Reference in a new issue