File: build

package info (click to toggle)
python-duet 0.2.9-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: python: 1,423; sh: 30; makefile: 7
file content (31 lines) | stat: -rwxr-xr-x 688 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env sh

if [ -d "dist" ]; then
  rm -rf dist/
fi

for arg in "$@"; do
  case $arg in
    --pre)
      SRC_VERSION_LINE=$(cat "duet/_version.py" | tail -n 1)
      SRC_VERSION=$(echo $SRC_VERSION_LINE | cut -d'"' -f 2)
      if [[ ${SRC_VERSION} != *"dev" ]]; then
        echo "Version doesn't end in dev: ${SRC_VERSION_LINE}" >&2
        exit 1
      fi
      export DUET_PRE_RELEASE_VERSION="${SRC_VERSION}$(date "+%Y%m%d%H%M%S")"
      echo "pre-release version: ${DUET_PRE_RELEASE_VERSION}"
      ;;

    --upload)
      export UPLOAD="yes"
      ;;
  esac
done

python setup.py sdist bdist_wheel

if [ -n "${UPLOAD}" ]; then
  echo "uploading..."
  twine upload dist/*
fi