This section contain guides to building distributable .whl
files for the
purpose of distributing code on the
Python Package Index (PyPI
).
It is highly recommended to generate distributable files using the provided
Dockerfile.posix
file.
This also makes its easy to build from MacOS.
Requirements:
docker
(tested onv19.03.8
)
# Building Docker image
# Run this from the root directory of this repository
docker build --rm -t opencc -f python/Dockerfile.posix .
# Mount ./dist and build `.whl` files
mkdir -p dist
docker run --rm -it -v $PWD/dist:/opt/OpenCC/dist opencc \
bash bdist_array.bash /opt/conda/etc/profile.d/conda.sh
# It might be necessary to change the ownership of files
sudo chown -R $USER:$USER ./dist
As there are no MacOS docker images, distributable files have to be built locally.
Requirements:
# Ensure that miniconda is pre-installed
# Run this from the root directory of this repository
# replacing CONDA_INSTALL_DIR
bash ./bdist_array.bash $CONDA_INSTALL_DIR/etc/profile.d/conda.sh
Requirements:
- Microsoft Visual C++
CMakeTools
- An installation of conda (miniconda or anaconda)
The requirements can be installed using Visual Studio Community Edition
# Ensure that `cmake.exe` and `conda` can all be found in your PATH
.\bdist_array.cmd