Closed Benjamin-Lee closed 3 years ago
@Benjamin-Lee thanks for reaching out!
Couple things:
python3
on any platform: use python
command instead since the Python setup action sets up the right aliases and links automatically"pebaz"
in the python -c
call. This is my username which is probably why it's not working for you. Try changing it to your username and rerunLet me know how it goes! :)
Thanks for the advice @Pebaz. Your Windows suggestion worked perfectly but Linux was a tough nut to crack. I ended up spending the day working on packaging and found a way to compile true manylinux wheels for all modern Python version. To do so, I had to run the build in a Docker container provided by PyPA:
jobs:
build-linux:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- run: |
curl -O https://nim-lang.org/choosenim/init.sh
sh init.sh -y
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
export PATH=/github/home/.nimble/bin:$PATH
cd $GITHUB_WORKSPACE
choosenim 1.4.0
nim -v
cd librtd
nimble install -Y
cd ../librtd-py/librtdpy
nimble install -Y
cd ../
for PYBIN in /opt/python/*/bin/; do
if ! test $PYBIN -ef /opt/python/cp35-cp35m/bin/; then
"${PYBIN}/pip" install setuptools wheel twine nimporter>=1.0.2
"${PYBIN}/pip" wheel . --no-deps -w wheelhouse/
fi
done
mkdir repaired
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w repaired
done
/opt/python/cp39-cp39/bin/twine upload repaired/*
Similarly, I added Python 3.5-3.9 builds for Windows and Mac. The full build script is here. Feel free to take anything from it for the example build script.
Fantastic! Glad to hear it 👏 Thank you for sharing this!
Closing due to issue being resolved! 😁
I'm a bit stumped as to what's going wrong since Windows and Linux give different errors. On Mac, it seems to be working.
Here's the GH action. The parts that I modified are the installation steps in which I first install my package and then the dependencies for the CLI package.
The errors I'm getting can be seen here for Linux and here for Windows. Briefly, on Linux, I'm getting this:
On Windows, I'm not able to use the
python3
function:Do you have any suggestions? I'm so happy that librtd is finally close to release!