From e6a85585d109ee8574a0444be5c210cdec7123cf Mon Sep 17 00:00:00 2001 From: Robin Adili <robin.adili@inria.fr> Date: Mon, 21 Sep 2020 17:39:10 +0200 Subject: [PATCH] explain installation with pip, wheel and sdist creation --- Readme.md | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/Readme.md b/Readme.md index 4038cd8..026bce4 100644 --- a/Readme.md +++ b/Readme.md @@ -1,37 +1,30 @@ # FBXSDK Python Bindings -This repository contains scripts to build the FBXSDK Python Bindings for various platforms -**Pre-built binaries are available on the [Releases page](https://gitlab.inria.fr/radili/fbxsdk_python/-/releases)** +This repository contains scripts to create a Source Distribution (sdist) for the FBXSDK Python Bindings and build wheels (package with binaries) for various platforms and versions from it +**Packages for the Source Distribution and wheels can be installed with pip (see Install)** ## Install -1. Download from the [Releases Page](https://gitlab.inria.fr/radili/fbxsdk_python/-/releases) the archive `fbxsdkpy-cpPYTHONVERSION-PLATFORM` corresponding to your `PYTHONVERSION` and `PLATFORM`. `PYTHONVERSION` 35 corresponds to any 3.5 version of Python for example. The version of Python can be found with `python --version` -2. Extract it -3. Move the content of the extracted directory (not the directory itself) in either the `sites-package` directory or directly in your project directory. The path of the `sites-package` directory is generally present in the Python path, which can be obtained using `python -c "import sys; print(sys.path)"` +1. Obtain a [Gitlab Token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) to authenticate to the project pypi repository +2. Run the following command, with `<Gitlab Token>` replaced with your personal token : +``` +pip install --extra-index-url https://__token__:<Gitlab Token>@gitlab.inria.fr/api/v4/projects/18034/packages/pypi/simple fbxsdkpy +``` +If there is no wheel available for your platform, pip will attempt to build from source using the Source Distribution -## Build +## Create a Source Distribution -The scripts can build the Python Bindings for Python versions >=3.5 on Windows and GNU/Linux and will only produce x64 binaries -Don't hesitate to ask me if you need support of other versions, platforms or architectures +The Source distribution is obtained by downloading the FBXSDK libraries and Python Bindings for Linux and Windows from Autodesk, then patching them to work with sip5 -### GNU/Linux +## Build wheels for package distribution -1. Install dependencies (for example with apt): -``` -sudo apt install make gcc python3-dev zlib1g-dev libxml2-dev -``` -2. Run the build script -``` -./build.sh -``` -3. Binaries are outputed to the `fbxsdkpy-cpPYTHONVERSION-gnu_linux_x64` directory. You can follow the Install instructions from step 3 with the files in this directory - -### Windows +### GNU/Linux -1. Execute the `build.bat` file, or run it as Administrator with "Right-Click > Run as Administrator" to skip the authorizations requests. Windows might prevent the execution of the script with a message "Windows protected your PC", to bypass it click "More Info", and then "Run Anyway" +Wheels need to be built inside a manylinux2014 environment, a Docker image is used for that purpose +1. `docker run -t -v .:/fbxsdkpy` -2. Binaries are outputed to the `fbxsdkpy-cpPYTHONVERSION-win_x64` directory. You can follow the Install instructions from step 3 with the files in this directory +### Windows +1. `build.bat` -There is no dependencies, installing Visual Studio is not necessary, the script will download and install the needed building tools and remove them once it's done -- GitLab