From 3f7b8d74971a0ee009347ceb5ae6780023861e62 Mon Sep 17 00:00:00 2001 From: Marcin Wojdyr Date: Thu, 25 May 2023 14:36:37 +0200 Subject: [PATCH] change version to 0.6.2, tweak build scripts --- .github/workflows/wheels2.yml | 2 +- docs/gemmi-help.txt | 2 +- include/gemmi/version.hpp | 2 +- run-tests.sh | 26 ++++++++++++++++++-------- tools/release.txt | 7 ++++--- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/wheels2.yml b/.github/workflows/wheels2.yml index 9ea1b4933..3dde823d1 100644 --- a/.github/workflows/wheels2.yml +++ b/.github/workflows/wheels2.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v3 - name: Build wheels - uses: pypa/cibuildwheel@v2.12.2 + uses: pypa/cibuildwheel@v2.12.3 env: CIBW_BUILD: ${{ github.event.inputs.cibw_build }} CIBW_SKIP: ${{ github.event.inputs.cibw_skip }} diff --git a/docs/gemmi-help.txt b/docs/gemmi-help.txt index fe3ec0cef..4852e869f 100644 --- a/docs/gemmi-help.txt +++ b/docs/gemmi-help.txt @@ -1,5 +1,5 @@ $ gemmi -h -gemmi 0.6.2-dev +gemmi 0.6.2 Command-line utility that accompanies the GEMMI library, which is a joint project of CCP4 and Global Phasing Ltd. Licence: Mozilla Public License 2.0. Copyright Global Phasing Ltd. diff --git a/include/gemmi/version.hpp b/include/gemmi/version.hpp index c8ee8ab07..bfc77eaf5 100644 --- a/include/gemmi/version.hpp +++ b/include/gemmi/version.hpp @@ -5,6 +5,6 @@ #ifndef GEMMI_VERSION_HPP_ #define GEMMI_VERSION_HPP_ -#define GEMMI_VERSION "0.6.2-dev" +#define GEMMI_VERSION "0.6.2" #endif diff --git a/run-tests.sh b/run-tests.sh index d271e6af3..680190ea0 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -13,7 +13,9 @@ set -eu cd "$(dirname "$0")" BUILD_DIR="$(pwd)" [ -e build ] && BUILD_DIR="$(pwd)/build" -PYTHON=`grep ^_Python_EXECUTABLE: $BUILD_DIR/CMakeCache.txt | cut -d= -f2` +if [ -z "${PYTHON-}" ]; then + PYTHON=`grep ^_Python_EXECUTABLE: $BUILD_DIR/CMakeCache.txt | cut -d= -f2` +fi # Build all, except when we called with an option to avoid full compilation: # G - only build the program, @@ -27,7 +29,9 @@ if [ $# = 1 ] && [ $1 = P ]; then (cd $BUILD_DIR && make -j4 gemmi_py) exit fi -if [ $# = 0 ] || [ $1 != n ]; then +if [ $# != 0 ] && [ $1 = n ]; then + shift +else (cd $BUILD_DIR && make -j4 all check) ./tools/cmp-size.py build/gemmi build/gemmi.*.so ./tools/docs-help.sh @@ -35,23 +39,29 @@ fi (cd docs && make -j4 html SPHINXOPTS="-q -n") # Run tests and checks. -export PYTHONPATH=$BUILD_DIR -export PATH="$BUILD_DIR:$PATH" +if [ $# = 0 ] || [ $1 != i ]; then + export PYTHONPATH=$BUILD_DIR + export PATH="$BUILD_DIR:$PATH" +fi $PYTHON -m unittest discover -s tests ./tools/header-list.py >docs/headers.rst -# Where python 2 and 3 output differ, the docs have output from v3. -# So 'make doctest' works only if sphinx-build was installed for python3. -(cd docs && make doctest SPHINXOPTS="-q -n -E") + +if [ -z "${NO_DOCTEST-}" ]; then + # 'make doctest' works only if sphinx-build was installed for python3. + (cd docs && make doctest SPHINXOPTS="-q -n -E") +fi + flake8 docs/ examples/ tests/ tools/ setup.py # We want to avoid having '::' in pydoc from pybind11. $PYTHON -m pydoc gemmi | grep :: ||: + # Usually, we stop here. Below are more extensive checks below that are run # before making a release. They are run when this script is called with 'a' # or with an option corresponding to the check. [ $# = 0 ] && exit; -if [ $1 = a ]; then +if [ $1 = i ]; then echo 'Check if gemmi package is found by setuptools pkg_resources...' $PYTHON -c '__requires__ = ["gemmi"]; import pkg_resources' echo 'OK' diff --git a/tools/release.txt b/tools/release.txt index 94a1bcaa7..426db06a7 100644 --- a/tools/release.txt +++ b/tools/release.txt @@ -8,11 +8,12 @@ - bash ./run-tests.sh a - VERSION=$(grep -Po '\d\.\d\.\d' include/gemmi/version.hpp) -- make, test and upload source package to PyPI: +- make and test source package for PyPI: python3 setup.py sdist twine check dist/gemmi-$VERSION.tar.gz - python3 -m pip uninstall gemmi - python3 -m pip install dist/gemmi-$VERSION.tar.gz + python3.11 -m pip uninstall gemmi + python3.11 -m pip install dist/gemmi-$VERSION.tar.gz + PYTHON=python3.11 NO_DOCTEST=1 ./run-tests.sh n i - git commit -a -m "change version number to $VERSION" git push