From 601629aab5aa163e5af33b17c8ca5a26b04e2692 Mon Sep 17 00:00:00 2001 From: Ian Lin <4056670+ianlini@users.noreply.github.com> Date: Sun, 29 Jan 2023 16:18:25 +0800 Subject: [PATCH 1/2] Implement PEP-518 configuration --- README.md | 3 ++- create_wheels.sh | 5 ++--- pyproject.toml | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 pyproject.toml diff --git a/README.md b/README.md index 382db67..0eb7ab4 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ webpage, so you need an Internet connection and all OpenFst dependencies. Essentially, you will need: - A C++ compiler supporting C++11 (tested with GCC 4.9). +- [Automake](https://www.gnu.org/software/automake/) - [PatchELF](https://nixos.org/patchelf.html). - [Zlib development](https://zlib.net/). - [Python Requests](http://docs.python-requests.org). @@ -36,7 +37,7 @@ pip install openfst-python Alternatively, if you are installing from sources, you can simply do: ```bash -python setup.py install +pip install . ``` Notice that this downloads the appropriate version of OpenFst directly from diff --git a/create_wheels.sh b/create_wheels.sh index 85866c2..01d403e 100755 --- a/create_wheels.sh +++ b/create_wheels.sh @@ -36,10 +36,9 @@ for py in cp27-cp27mu cp35-cp35m cp36-cp36m cp37-cp37m; do export PYTHON=/opt/python/$py/bin/python; echo "=== Installing dependencies for $py ==="; $PYTHON -m pip install -U pip; - $PYTHON -m pip install -U requests wheel setuptools; + $PYTHON -m pip install -U wheel setuptools build; echo "=== Building for $py ===" - $PYTHON setup.py clean; - $PYTHON setup.py bdist_wheel; + $PYTHON -m build --wheel; echo "=== Installing for $py ==="; cd /tmp; $PYTHON -m pip uninstall -y openfst_python; diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..64207fa --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "Cython", "requests"] +build-backend = "setuptools.build_meta" From 2099b72f36908c5801d33a4797ea17cb47b668a7 Mon Sep 17 00:00:00 2001 From: Ian Lin <4056670+ianlini@users.noreply.github.com> Date: Wed, 1 Feb 2023 13:52:51 +0800 Subject: [PATCH 2/2] clean previous build --- create_wheels.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/create_wheels.sh b/create_wheels.sh index 01d403e..aabae15 100755 --- a/create_wheels.sh +++ b/create_wheels.sh @@ -38,6 +38,7 @@ for py in cp27-cp27mu cp35-cp35m cp36-cp36m cp37-cp37m; do $PYTHON -m pip install -U pip; $PYTHON -m pip install -U wheel setuptools build; echo "=== Building for $py ===" + rm -rf build dist *.egg-info $PYTHON -m build --wheel; echo "=== Installing for $py ==="; cd /tmp;