PyPI setup

This commit is contained in:
Mario Fink
2021-03-02 17:13:33 +01:00
parent c10fd1c488
commit 145392108b
8 changed files with 156 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ main.o : src/main.cpp lib/$(SRC).hpp $(HPP)
$(SRC).o : lib/$(SRC).cpp lib/$(SRC).hpp $(HPP)
$(CC) -c $(OPT) -I $(LIB) $< -o $@
clean-cpp :
cpp-clean :
rm -f $(EXE) *.o src/main.cpp.cpp
# --------------------------------------------------------------------------- #
@@ -87,7 +87,7 @@ cython-build : cython/setup.py cython/tdm_termite.pxd cython/py_tdm_termite.pyx
cython-install : cython/setup.py cython/tdm_termite.pxd cython/py_tdm_termite.pyx $(HPP) lib/tdm_termite.cpp
python3 $< install
clean-cython :
cython-clean :
rm -vf cython/py_tdm_termite.cpp
rm -vf tdm_termite.cpython-*.so python/tdm_termite.cpython-*.so
rm -rf build
@@ -102,8 +102,50 @@ docker-run:
mkdir -pv data/{input,output}
docker run -it --rm --volume $(CWD)/data:/home/data tdmtermite:latest /bin/bash
# --------------------------------------------------------------------------- #
clean : clean-cpp clean-cython
docker-clean:
rm -rv data
docker image remove tdmtermite
# --------------------------------------------------------------------------- #
# pip
pip-setup:
apt-get install -y python3-setuptools \
python3-pip \
python3-venv
python3 -m pip install --upgrade build
python3 -m pip install twine wheel auditwheel cython
python3 -m pip install --user --upgrade twine
pip-build:
#python3 -m build
# python3 setup.py sdist bdist_wheel
python3 setup.py bdist_wheel
# actually it seems we have to use CentOS container
# docker run -i -t -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /bin/bash
# see https://github.com/neuronsimulator/nrn/issues/329 for setup of the container
pip-audit:
auditwheel repair $(shell find dist/ -name "*-cp38-cp38-linux_x86_64.whl")
# username: __token__
# password: API-token including "pypi-"
# !! RUN AS ROOT!!
pip-upload:
python3 -m twine upload --repository testpypi dist/*
pip-test-install:
python3 -m pip install --index-url https://test.pypi.org/simple --no-deps TDMtermite-RecordEvolution
# python3 -m pip install -i https://test.pypi.org/simple/ TDMtermite-RecordEvolution==0.5
pip-clean:
rm -rvf dist/
rm -rvf *.egg-info
rm -rvf build/ wheelhouse/
# --------------------------------------------------------------------------- #
clean : cpp-clean cython-clean pip-clean
# --------------------------------------------------------------------------- #