Skip to content
This repository was archived by the owner on Mar 3, 2024. It is now read-only.

Commit b3c56ed

Browse files
update pybind to 2.11.1; misc improvements (#16)
* fix * update to v2.11.1 * update * use material design * fix lint --------- Co-authored-by: TANG ZHIXIONG <[email protected]>
1 parent 2e20777 commit b3c56ed

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

Makefile

+18-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ build:
2121
.PHONY: build
2222

2323
docs_build:
24+
python3 -m pip install -r docs/requirements.txt
2425
mkdocs build
2526
docs_serve:
27+
python3 -m pip install -r docs/requirements.txt
2628
mkdocs serve -a 0.0.0.0:8088
2729

2830
DOCKER_TAG_WINDOWS ?= ghcr.io/cubao/build-env-windows-x64:v0.0.1
29-
DOCKER_TAG_LINUX ?= ghcr.io/cubao/build-env-manylinux2014-x64:v0.0.1
31+
DOCKER_TAG_LINUX ?= ghcr.io/cubao/build-env-manylinux2014-x64:v0.0.4
3032
DOCKER_TAG_MACOS ?= ghcr.io/cubao/build-env-macos-arm64:v0.0.1
3133

3234
test_in_win:
@@ -36,6 +38,15 @@ test_in_mac:
3638
test_in_linux:
3739
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/linux:`pwd`/build -it $(DOCKER_TAG_LINUX) bash
3840

41+
DEV_CONTAINER_NAME ?= $(USER)_$(subst /,_,$(PROJECT_NAME)____$(PROJECT_SOURCE_DIR))
42+
DEV_CONTAINER_IMAG ?= $(DOCKER_TAG_LINUX)
43+
test_in_dev_container:
44+
docker ps | grep $(DEV_CONTAINER_NAME) \
45+
&& docker exec -it $(DEV_CONTAINER_NAME) bash \
46+
|| docker run --rm --name $(DEV_CONTAINER_NAME) \
47+
--network host --security-opt seccomp=unconfined \
48+
-v `pwd`:`pwd` -w `pwd` -it $(DEV_CONTAINER_IMAG) bash
49+
3950
PYTHON ?= python3
4051
python_install:
4152
$(PYTHON) setup.py install
@@ -57,6 +68,7 @@ python_test:
5768
# conda create -y -n py38 python=3.8
5869
# conda create -y -n py39 python=3.9
5970
# conda create -y -n py310 python=3.10
71+
# conda create -y -n py311 python=3.11
6072
# conda env list
6173
python_build_py36:
6274
PYTHON=python conda run --no-capture-output -n py36 make python_build
@@ -68,10 +80,12 @@ python_build_py39:
6880
PYTHON=python conda run --no-capture-output -n py39 make python_build
6981
python_build_py310:
7082
PYTHON=python conda run --no-capture-output -n py310 make python_build
71-
python_build_all: python_build_py36 python_build_py37 python_build_py38 python_build_py39 python_build_py310
83+
python_build_py311:
84+
PYTHON=python conda run --no-capture-output -n py311 make python_build
85+
python_build_all: python_build_py36 python_build_py37 python_build_py38 python_build_py39 python_build_py310 python_build_py311
7286
python_build_all_in_linux:
73-
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/win:`pwd`/build -it $(DOCKER_TAG_LINUX) make python_build_all repair_wheels
74-
python_build_all_in_macos: python_build_py38 python_build_py39 python_build_py310
87+
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/linux:`pwd`/build -it $(DOCKER_TAG_LINUX) make python_build_all repair_wheels
88+
python_build_all_in_macos: python_build_py38 python_build_py39 python_build_py310 python_build_py311
7589
python_build_all_in_windows: python_build_all
7690

7791
repair_wheels:

docs/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
mkdocs==1.4.2
22
mkdocs-include-markdown-plugin==4.0.3
3+
mkdocs-material==9.1.21
4+
mkdocs-material-extensions==1.1.1

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ site_author: district10
66
repo_url: https://github.com/cubao/cmake_example
77
edit_uri: blob/master/docs/
88

9-
theme: readthedocs
9+
theme: material
1010
nav:
1111
- Home: index.md
1212
- Code: code.md

pybind11

Submodule pybind11 updated 82 files

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, name: str, sourcedir: str = "") -> None:
2828
class CMakeBuild(build_ext):
2929
def build_extension(self, ext: CMakeExtension) -> None:
3030
# Must be in this form due to bug in .resolve() only fixed in Python 3.10+
31-
ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) # type: ignore[no-untyped-call]
31+
ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name)
3232
extdir = ext_fullpath.parent.resolve()
3333

3434
# Using this requires trailing slash for auto-detection & inclusion of
@@ -56,7 +56,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
5656
cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item]
5757

5858
# In this example, we pass in the version to C++. You might not need to.
59-
cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] # type: ignore[attr-defined]
59+
cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"]
6060

6161
if self.compiler.compiler_type != "msvc":
6262
# Using Ninja-build since it a) is available as a wheel and b)

0 commit comments

Comments
 (0)