diff options
| author | Stefan Boberg <[email protected]> | 2025-11-07 14:49:13 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-11-07 14:49:13 +0100 |
| commit | 24e43a913f29ac3b314354e8ce5175f135bcc64f (patch) | |
| tree | ca442937ceeb63461012b33a4576e9835099f106 /thirdparty/ryml/api/python/Makefile | |
| parent | get oplog attachments (#622) (diff) | |
| download | zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.tar.xz zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.zip | |
switch to xmake for package management (#611)
This change removes our dependency on vcpkg for package management, in favour of bringing some code in-tree in the `thirdparty` folder as well as using the xmake build-in package management feature. For the latter, all the package definitions are maintained in the zen repo itself, in the `repo` folder.
It should now also be easier to build the project as it will no longer depend on having the right version of vcpkg installed, which has been a common problem for new people coming in to the codebase. Now you should only need xmake to build.
* Bumps xmake requirement on github runners to 2.9.9 to resolve an issue where xmake on Windows invokes cmake with `v144` toolchain which does not exist
* BLAKE3 is now in-tree at `thirdparty/blake3`
* cpr is now in-tree at `thirdparty/cpr`
* cxxopts is now in-tree at `thirdparty/cxxopts`
* fmt is now in-tree at `thirdparty/fmt`
* robin-map is now in-tree at `thirdparty/robin-map`
* ryml is now in-tree at `thirdparty/ryml`
* sol2 is now in-tree at `thirdparty/sol2`
* spdlog is now in-tree at `thirdparty/spdlog`
* utfcpp is now in-tree at `thirdparty/utfcpp`
* xmake package repo definitions is in `repo`
* implemented support for sanitizers. ASAN is supported on windows, TSAN, UBSAN, MSAN etc are supported on Linux/MacOS though I have not yet tested it extensively on MacOS
* the zencore encryption implementation also now supports using mbedTLS which is used on MacOS, though for now we still use openssl on Linux
* crashpad
* bumps libcurl to 8.11.0 (from 8.8.0) which should address a rare build upload bug
Diffstat (limited to 'thirdparty/ryml/api/python/Makefile')
| -rw-r--r-- | thirdparty/ryml/api/python/Makefile | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/thirdparty/ryml/api/python/Makefile b/thirdparty/ryml/api/python/Makefile new file mode 100644 index 000000000..bdb5a6ffd --- /dev/null +++ b/thirdparty/ryml/api/python/Makefile @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +# SPDX-License-Identifier: MIT + +# Use bash even on Windows +SHELL := /bin/bash + +# On Windows the activate script is stored in a different location. +ACTIVATE_SCRIPT := venv/bin/activate +ifeq ($(OS),Windows_NT) +ACTIVATE_SCRIPT := venv/Scripts/activate +endif + +# How to invoke python +PYTHON := python +# How to invoke pytest +PYTEST := $(PYTHON) -m pytest -vvv + +ACTIVATE=[[ -e $(ACTIVATE_SCRIPT) ]] && source $(ACTIVATE_SCRIPT); + +.PHONY: clean +clean: + rm -rf dist *.egg-info + rm -rf ../../build ../../.egg* + rm -rf ryml/*.so ryml/ryml.py ryml/include ryml/lib + +.PHONY: venv-clean +venv-clean: + rm -rf venv + + +$(ACTIVATE_SCRIPT): requirements.txt Makefile + make venv + @touch $(ACTIVATE_SCRIPT) + +.PHONY: venv +venv: + virtualenv --python=python3 --always-copy venv + # Packaging tooling. + ${ACTIVATE} pip install -U pip + # Setup requirements. + ${ACTIVATE} pip install -v -r requirements.txt + ${ACTIVATE} pip install -v -e ../.. + @${ACTIVATE} $(PYTHON) -c "from ryml.version import version as v; print('Installed version:', v)" + +.PHONY: build-sdist +build-sdist: | $(ACTIVATE_SCRIPT) + ${ACTIVATE} (cd ../..; $(PYTHON) -m build --sdist --outdir $(PWD)/dist) + + +.PHONY: build-wheel +build-wheel: | $(ACTIVATE_SCRIPT) + rm -rf dist + $(MAKE) build-sdist + @ls -l dist/*.tar.gz + ${ACTIVATE} pip wheel -v dist/*.tar.gz --wheel-dir $(PWD)/dist + +.PHONY: build +build: + rm -rf build dist + $(MAKE) build-sdist + $(MAKE) build-wheel + +# PYPI_TEST = --repository-url https://test.pypi.org/legacy/ +PYPI_TEST = --repository testpypi + +.PHONY: upload-test +upload-test: | $(ACTIVATE_SCRIPT) + make clean + make build-sdist + ${ACTIVATE} twine upload ${PYPI_TEST} dist/* + +.PHONY: upload +upload: | $(ACTIVATE_SCRIPT) + make clean + make build-sdist + ${ACTIVATE} twine upload --verbose dist/* + +.PHONY: check +check: | $(ACTIVATE_SCRIPT) + make clean + make build-wheel + ${ACTIVATE} twine check dist/*.whl + +.PHONY: install +install: | $(ACTIVATE_SCRIPT) + ${ACTIVATE} $(PYTHON) setup.py install + +.PHONY: test +test: | $(ACTIVATE_SCRIPT) + ${ACTIVATE} $(PYTEST) tests + +.PHONY: version +version: | $(ACTIVATE_SCRIPT) + ${ACTIVATE} $(PYTHON) setup.py --version |