mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61d7a3f41d | ||
|
|
3ae24529f8 | ||
|
|
6f0a05adb4 | ||
|
|
e798a57099 | ||
|
|
c5bac1c8cf |
+14
-2
@@ -101,8 +101,12 @@ jobs:
|
||||
- name: lxd
|
||||
channel: stable
|
||||
env:
|
||||
- SNAPCRAFT_IMAGE_INFO: '{"build_url": "$TRAVIS_BUILD_URL"}'
|
||||
- SNAPCRAFT_IMAGE_INFO: |
|
||||
'{"build_url": "$TRAVIS_JOB_WEB_URL"}'
|
||||
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
|
||||
- SNAPCRAFT_BUILD_INFO: 1 # https://snapcraft.io/blog/introducing-developer-notifications-for-snap-security-updates
|
||||
install:
|
||||
- sudo usermod --append --groups lxd $USER
|
||||
- sudo /snap/bin/lxd.migrate -yes
|
||||
- sudo /snap/bin/lxd waitready
|
||||
- sudo /snap/bin/lxd init --auto
|
||||
@@ -156,6 +160,14 @@ deploy:
|
||||
script: "(echo $SNAP_TOKEN | snapcraft login --with -) && timeout 600 snapcraft push dvc_*.snap --release $SNAP_CHANNEL || echo timed out"
|
||||
on:
|
||||
all_branches: true
|
||||
condition: "$(./scripts/ci/deploy_condition.sh dvc_*.snap) && ($TRAVIS_BRANCH = master || -n $TRAVIS_TAG)"
|
||||
condition: "$(./scripts/ci/deploy_condition.sh dvc_*.snap) && ($TRAVIS_BRANCH = master || -n $TRAVIS_TAG) && -n $SNAP_CHANNEL"
|
||||
repo: iterative/dvc
|
||||
stage: build
|
||||
- provider: script
|
||||
skip_cleanup: true
|
||||
script: "(echo $SNAP_TOKEN | snapcraft login --with -) && timeout 600 snapcraft push nowarn_update_dvc_*.snap --release $SNAP_CHANNEL_MAJOR || echo timed out"
|
||||
on:
|
||||
all_branches: true
|
||||
condition: "$(./scripts/ci/deploy_condition.sh nowarn_update_dvc_*.snap) && ($TRAVIS_BRANCH = master || -n $TRAVIS_TAG) && -n $SNAP_CHANNEL_MAJOR"
|
||||
repo: iterative/dvc
|
||||
stage: build
|
||||
|
||||
+20
-1
@@ -48,7 +48,15 @@ class Updater(object): # pragma: no cover
|
||||
logger.debug(msg.format(self.lock.lockfile, action))
|
||||
|
||||
def check(self):
|
||||
if os.getenv("CI") or env2bool("DVC_TEST") or PKG == "snap":
|
||||
if os.getenv("CI") or env2bool("DVC_TEST"):
|
||||
return
|
||||
|
||||
if PKG == "snap":
|
||||
# hardcoded transition message
|
||||
version_major = version.parse(self.current).major
|
||||
self.current = "v{}".format(version_major)
|
||||
self.latest = "v{}".format(version_major + 1)
|
||||
self._notify()
|
||||
return
|
||||
|
||||
self._with_lock(self._check, "checking")
|
||||
@@ -138,6 +146,17 @@ class Updater(object): # pragma: no cover
|
||||
),
|
||||
"conda": "Run `{yellow}conda{reset} update dvc`",
|
||||
"choco": "Run `{yellow}choco{reset} upgrade dvc`",
|
||||
"snap": (
|
||||
"To upgrade to the latest major release,\n"
|
||||
"run `{yellow}snap{reset} refresh --channel=latest/beta`, or\n"
|
||||
"to stay on the current major release track,\n"
|
||||
"run `{yellow}snap{reset} refresh --channel={current}/stable`"
|
||||
"\n\n"
|
||||
"{red}WARNING{reset}: ignoring this message will result in\n"
|
||||
"snap automatically performing an upgrade soon.\n"
|
||||
"More information can be found at\n"
|
||||
"{blue}https://github.com/iterative/dvc/issues/3872{reset}"
|
||||
),
|
||||
None: (
|
||||
"Find the latest release at\n"
|
||||
"{blue}https://github.com/iterative/dvc/releases/latest{reset}"
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import os
|
||||
import subprocess
|
||||
|
||||
|
||||
_BASE_VERSION = "0.93.0"
|
||||
_BASE_VERSION = "0.94.1"
|
||||
|
||||
|
||||
def _generate_version(base_version):
|
||||
|
||||
@@ -7,7 +7,14 @@ if [ ! -d "dvc" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo snapcraft --use-lxd
|
||||
sg lxd -c snapcraft
|
||||
original_snap_name="$(ls dvc_*.snap)"
|
||||
mv "$original_snap_name" original.snap
|
||||
|
||||
git apply scripts/remove_update_warning.patch
|
||||
sg lxd -c snapcraft
|
||||
mv dvc_*.snap nowarn_update_"$original_snap_name".snap
|
||||
mv original.snap "$original_snap_name"
|
||||
|
||||
pip uninstall -y dvc
|
||||
if which dvc; then
|
||||
|
||||
@@ -15,7 +15,7 @@ fi
|
||||
|
||||
echo >env.sh
|
||||
|
||||
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]]; then
|
||||
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "test" ]]; then
|
||||
if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
|
||||
# NOTE: ssh keys for ssh test to be able to ssh to the localhost
|
||||
ssh-keygen -t rsa -N "" -f mykey
|
||||
@@ -51,8 +51,27 @@ elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||
ln -s -f /usr/local/bin/pip3 /usr/local/bin/pip
|
||||
fi
|
||||
|
||||
if [[ -n "$TRAVIS_TAG" ]]; then
|
||||
echo "export SNAP_CHANNEL=stable" >>env.sh
|
||||
else
|
||||
echo "export SNAP_CHANNEL=edge" >>env.sh
|
||||
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
||||
# fetch tags for `git-describe`, since
|
||||
# - can't rely on $TRAVIS_TAG for snapcraft `edge` (master) releases, and
|
||||
# - `snapcraft` also uses `git-describe` for version detection
|
||||
git fetch --tags
|
||||
TAG_MAJOR="$(git describe --tags | sed -r 's/^v?([0-9]+)\.[0-9]+\.[0-9]+.*/\1/')"
|
||||
[[ -n "$TAG_MAJOR" ]] || exit 1 # failed to detect major version
|
||||
|
||||
if [[ -n "$TRAVIS_TAG" ]]; then
|
||||
if [[ $(echo "$TRAVIS_TAG" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$') ]]; then
|
||||
echo "export SNAP_CHANNEL=stable" >>env.sh
|
||||
echo "export SNAP_CHANNEL_MAJOR=v$TAG_MAJOR/stable" >>env.sh
|
||||
else
|
||||
echo "export SNAP_CHANNEL=beta" >>env.sh
|
||||
echo "export SNAP_CHANNEL_MAJOR=v$TAG_MAJOR/beta" >>env.sh
|
||||
fi
|
||||
else
|
||||
echo "export SNAP_CHANNEL=edge" >>env.sh
|
||||
echo "export SNAP_CHANNEL_MAJOR=v$TAG_MAJOR/edge" >>env.sh
|
||||
fi
|
||||
|
||||
# NOTE: after deprecating this branch, uncomment this line
|
||||
# echo "unset SNAP_CHANNEL" >>env.sh
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
diff --git a/dvc/updater.py b/dvc/updater.py
|
||||
index d6dc372..cfa416f 100644
|
||||
--- a/dvc/updater.py
|
||||
+++ b/dvc/updater.py
|
||||
@@ -48,15 +48,7 @@ class Updater(object): # pragma: no cover
|
||||
logger.debug(msg.format(self.lock.lockfile, action))
|
||||
|
||||
def check(self):
|
||||
- if os.getenv("CI") or env2bool("DVC_TEST"):
|
||||
- return
|
||||
-
|
||||
- if PKG == "snap":
|
||||
- # hardcoded transition message
|
||||
- version_major = version.parse(self.current).major
|
||||
- self.current = "v{}".format(version_major)
|
||||
- self.latest = "v{}".format(version_major + 1)
|
||||
- self._notify()
|
||||
+ if os.getenv("CI") or env2bool("DVC_TEST") or PKG == "snap":
|
||||
return
|
||||
|
||||
self._with_lock(self._check, "checking")
|
||||
@@ -146,17 +138,6 @@ class Updater(object): # pragma: no cover
|
||||
),
|
||||
"conda": "Run `{yellow}conda{reset} update dvc`",
|
||||
"choco": "Run `{yellow}choco{reset} upgrade dvc`",
|
||||
- "snap": (
|
||||
- "To upgrade to the latest major release,\n"
|
||||
- "run `{yellow}snap{reset} refresh --channel=latest/beta`, or\n"
|
||||
- "to stay on the current major release track,\n"
|
||||
- "run `{yellow}snap{reset} refresh --channel={current}/stable`"
|
||||
- "\n\n"
|
||||
- "{red}WARNING{reset}: ignoring this message will result in\n"
|
||||
- "snap automatically performing an upgrade soon.\n"
|
||||
- "More information can be found at\n"
|
||||
- "{blue}https://github.com/iterative/dvc/issues/3872{reset}"
|
||||
- ),
|
||||
None: (
|
||||
"Find the latest release at\n"
|
||||
"{blue}https://github.com/iterative/dvc/releases/latest{reset}"
|
||||
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
|
||||
index 75d0f7d..996db8c 100644
|
||||
--- a/snap/snapcraft.yaml
|
||||
+++ b/snap/snapcraft.yaml
|
||||
@@ -30,7 +30,6 @@ parts:
|
||||
override-pull: |
|
||||
snapcraftctl pull
|
||||
snapcraftctl set-version $(cd $SNAPCRAFT_PART_SRC && git describe --tags)
|
||||
- git diff --quiet || error_dirty_build
|
||||
echo 'PKG = "snap"' > $SNAPCRAFT_PART_SRC/dvc/utils/build.py
|
||||
# install all optional extras
|
||||
sed -ri 's/(=install_requires)/\1+all_remotes+hdfs/' $SNAPCRAFT_PART_SRC/setup.py
|
||||
+4
-1
@@ -29,7 +29,7 @@ parts:
|
||||
- git
|
||||
override-pull: |
|
||||
snapcraftctl pull
|
||||
snapcraftctl set-version `cd $SNAPCRAFT_PART_SRC && git describe --tags`
|
||||
snapcraftctl set-version $(cd $SNAPCRAFT_PART_SRC && git describe --tags)
|
||||
git diff --quiet || error_dirty_build
|
||||
echo 'PKG = "snap"' > $SNAPCRAFT_PART_SRC/dvc/utils/build.py
|
||||
# install all optional extras
|
||||
@@ -38,6 +38,9 @@ parts:
|
||||
sed -rin 's/.*git.*diff.*--quiet.*//' $SNAPCRAFT_PART_SRC/dvc/version.py
|
||||
override-build: |
|
||||
snapcraftctl build
|
||||
# prevent user site packages interfering with this snap - reference:
|
||||
# https://github.com/snapcore/snapcraft/blob/19393ef36cd773a28131cec10cc0bfb3bf9c7e77/tools/snapcraft-override-build.sh#L18
|
||||
sed -ri 's/^(ENABLE_USER_SITE = )None$/\1False/' $SNAPCRAFT_PART_INSTALL/usr/lib/python*/site.py
|
||||
cp $SNAPCRAFT_PART_BUILD/scripts/completion/dvc.bash $SNAPCRAFT_PART_INSTALL/completion.sh
|
||||
apps:
|
||||
dvc:
|
||||
|
||||
Reference in New Issue
Block a user