diff --git a/certbot-dns-cloudflare/setup.py b/certbot-dns-cloudflare/setup.py index 60add8ae5..2791f423d 100644 --- a/certbot-dns-cloudflare/setup.py +++ b/certbot-dns-cloudflare/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.29.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-cloudflare/snap/hooks/post-refresh b/certbot-dns-cloudflare/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-cloudflare/snap/hooks/post-refresh +++ b/certbot-dns-cloudflare/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-cloudflare/snap/snapcraft.yaml b/certbot-dns-cloudflare/snap/snapcraft.yaml index 8697d6848..81fa2d5c7 100644 --- a/certbot-dns-cloudflare/snap/snapcraft.yaml +++ b/certbot-dns-cloudflare/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-cloudxns/setup.py b/certbot-dns-cloudxns/setup.py index 0e70800ce..7a5c7ff3d 100644 --- a/certbot-dns-cloudxns/setup.py +++ b/certbot-dns-cloudxns/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-cloudxns/snap/hooks/post-refresh b/certbot-dns-cloudxns/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-cloudxns/snap/hooks/post-refresh +++ b/certbot-dns-cloudxns/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-cloudxns/snap/snapcraft.yaml b/certbot-dns-cloudxns/snap/snapcraft.yaml index 34fef741a..1fcaef8b9 100644 --- a/certbot-dns-cloudxns/snap/snapcraft.yaml +++ b/certbot-dns-cloudxns/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-digitalocean/setup.py b/certbot-dns-digitalocean/setup.py index 4fe54b0f8..267999217 100644 --- a/certbot-dns-digitalocean/setup.py +++ b/certbot-dns-digitalocean/setup.py @@ -18,14 +18,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.29.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-digitalocean/snap/hooks/post-refresh b/certbot-dns-digitalocean/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-digitalocean/snap/hooks/post-refresh +++ b/certbot-dns-digitalocean/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-digitalocean/snap/snapcraft.yaml b/certbot-dns-digitalocean/snap/snapcraft.yaml index d8a950d58..b6f6506e2 100644 --- a/certbot-dns-digitalocean/snap/snapcraft.yaml +++ b/certbot-dns-digitalocean/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-dnsimple/setup.py b/certbot-dns-dnsimple/setup.py index f23c42521..acb951e83 100644 --- a/certbot-dns-dnsimple/setup.py +++ b/certbot-dns-dnsimple/setup.py @@ -16,14 +16,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-dnsimple/snap/snapcraft.yaml b/certbot-dns-dnsimple/snap/snapcraft.yaml index 1961c8afc..2d7a1d5d2 100644 --- a/certbot-dns-dnsimple/snap/snapcraft.yaml +++ b/certbot-dns-dnsimple/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-dnsmadeeasy/setup.py b/certbot-dns-dnsmadeeasy/setup.py index a0ba4ac28..7940e9fc6 100644 --- a/certbot-dns-dnsmadeeasy/setup.py +++ b/certbot-dns-dnsmadeeasy/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-dnsmadeeasy/snap/hooks/post-refresh b/certbot-dns-dnsmadeeasy/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-dnsmadeeasy/snap/hooks/post-refresh +++ b/certbot-dns-dnsmadeeasy/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-dnsmadeeasy/snap/snapcraft.yaml b/certbot-dns-dnsmadeeasy/snap/snapcraft.yaml index 565cabe0d..75f083732 100644 --- a/certbot-dns-dnsmadeeasy/snap/snapcraft.yaml +++ b/certbot-dns-dnsmadeeasy/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-gehirn/setup.py b/certbot-dns-gehirn/setup.py index a021bffce..d93acbe60 100644 --- a/certbot-dns-gehirn/setup.py +++ b/certbot-dns-gehirn/setup.py @@ -16,14 +16,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-gehirn/snap/hooks/post-refresh b/certbot-dns-gehirn/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-gehirn/snap/hooks/post-refresh +++ b/certbot-dns-gehirn/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-gehirn/snap/snapcraft.yaml b/certbot-dns-gehirn/snap/snapcraft.yaml index dbfef38fb..ea19f045b 100644 --- a/certbot-dns-gehirn/snap/snapcraft.yaml +++ b/certbot-dns-gehirn/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-google/setup.py b/certbot-dns-google/setup.py index 0c559585b..d9e508494 100644 --- a/certbot-dns-google/setup.py +++ b/certbot-dns-google/setup.py @@ -20,14 +20,16 @@ install_requires = [ 'httplib2' ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.29.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-google/snap/hooks/post-refresh b/certbot-dns-google/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-google/snap/hooks/post-refresh +++ b/certbot-dns-google/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-google/snap/snapcraft.yaml b/certbot-dns-google/snap/snapcraft.yaml index 7b31ac8f6..6a60a9426 100644 --- a/certbot-dns-google/snap/snapcraft.yaml +++ b/certbot-dns-google/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-linode/setup.py b/certbot-dns-linode/setup.py index 8e765bd8f..1a1e3f973 100644 --- a/certbot-dns-linode/setup.py +++ b/certbot-dns-linode/setup.py @@ -16,14 +16,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-linode/snap/hooks/post-refresh b/certbot-dns-linode/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-linode/snap/hooks/post-refresh +++ b/certbot-dns-linode/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-linode/snap/snapcraft.yaml b/certbot-dns-linode/snap/snapcraft.yaml index 0e8196130..c6a30c7f2 100644 --- a/certbot-dns-linode/snap/snapcraft.yaml +++ b/certbot-dns-linode/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-luadns/setup.py b/certbot-dns-luadns/setup.py index 57c5011eb..0ff9fb249 100644 --- a/certbot-dns-luadns/setup.py +++ b/certbot-dns-luadns/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-luadns/snap/hooks/post-refresh b/certbot-dns-luadns/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-luadns/snap/hooks/post-refresh +++ b/certbot-dns-luadns/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-luadns/snap/snapcraft.yaml b/certbot-dns-luadns/snap/snapcraft.yaml index 53c6dff2d..4cd90abae 100644 --- a/certbot-dns-luadns/snap/snapcraft.yaml +++ b/certbot-dns-luadns/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-nsone/setup.py b/certbot-dns-nsone/setup.py index b8d33bb60..2b37a4c18 100644 --- a/certbot-dns-nsone/setup.py +++ b/certbot-dns-nsone/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-nsone/snap/hooks/post-refresh b/certbot-dns-nsone/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-nsone/snap/hooks/post-refresh +++ b/certbot-dns-nsone/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-nsone/snap/snapcraft.yaml b/certbot-dns-nsone/snap/snapcraft.yaml index ba8ae03fd..88c29226a 100644 --- a/certbot-dns-nsone/snap/snapcraft.yaml +++ b/certbot-dns-nsone/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-ovh/setup.py b/certbot-dns-ovh/setup.py index e8b2ffd1e..a8baea0f1 100644 --- a/certbot-dns-ovh/setup.py +++ b/certbot-dns-ovh/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-ovh/snap/hooks/post-refresh b/certbot-dns-ovh/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-ovh/snap/hooks/post-refresh +++ b/certbot-dns-ovh/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-ovh/snap/snapcraft.yaml b/certbot-dns-ovh/snap/snapcraft.yaml index bf5801797..733737884 100644 --- a/certbot-dns-ovh/snap/snapcraft.yaml +++ b/certbot-dns-ovh/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-rfc2136/setup.py b/certbot-dns-rfc2136/setup.py index 83939f796..09cce6a21 100644 --- a/certbot-dns-rfc2136/setup.py +++ b/certbot-dns-rfc2136/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.29.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-rfc2136/snap/hooks/post-refresh b/certbot-dns-rfc2136/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-rfc2136/snap/hooks/post-refresh +++ b/certbot-dns-rfc2136/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-rfc2136/snap/snapcraft.yaml b/certbot-dns-rfc2136/snap/snapcraft.yaml index 7e60d067b..2726c2974 100644 --- a/certbot-dns-rfc2136/snap/snapcraft.yaml +++ b/certbot-dns-rfc2136/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-route53/setup.py b/certbot-dns-route53/setup.py index 893f40340..5d2b0494d 100644 --- a/certbot-dns-route53/setup.py +++ b/certbot-dns-route53/setup.py @@ -17,14 +17,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.29.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-route53/snap/hooks/post-refresh b/certbot-dns-route53/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-route53/snap/hooks/post-refresh +++ b/certbot-dns-route53/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-route53/snap/snapcraft.yaml b/certbot-dns-route53/snap/snapcraft.yaml index 9bb15229d..78602ff02 100644 --- a/certbot-dns-route53/snap/snapcraft.yaml +++ b/certbot-dns-route53/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/certbot-dns-sakuracloud/setup.py b/certbot-dns-sakuracloud/setup.py index cb6785ecd..812be34ba 100644 --- a/certbot-dns-sakuracloud/setup.py +++ b/certbot-dns-sakuracloud/setup.py @@ -16,14 +16,16 @@ install_requires = [ 'zope.interface', ] -if not os.environ.get('EXCLUDE_CERTBOT_DEPS'): +if not os.environ.get('SNAP_BUILD'): install_requires.extend([ 'acme>=0.31.0', 'certbot>=1.1.0', ]) elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels ' + raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') +if os.environ.get('SNAP_BUILD'): + install_requires.append('packaging') setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) if setuptools_known_environment_markers: diff --git a/certbot-dns-sakuracloud/snap/hooks/post-refresh b/certbot-dns-sakuracloud/snap/hooks/post-refresh index 9791704c0..c4688009c 100644 --- a/certbot-dns-sakuracloud/snap/hooks/post-refresh +++ b/certbot-dns-sakuracloud/snap/hooks/post-refresh @@ -13,7 +13,7 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? +/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? if [ "$exit_code" -eq 1 ]; then echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh." exit 1 diff --git a/certbot-dns-sakuracloud/snap/snapcraft.yaml b/certbot-dns-sakuracloud/snap/snapcraft.yaml index 2727afdcc..ebcf8bea7 100644 --- a/certbot-dns-sakuracloud/snap/snapcraft.yaml +++ b/certbot-dns-sakuracloud/snap/snapcraft.yaml @@ -16,7 +16,7 @@ parts: snapcraftctl pull snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: . diff --git a/tools/generate_dnsplugins_postrefreshhook.sh b/tools/generate_dnsplugins_postrefreshhook.sh index a691071fa..a9636cd41 100755 --- a/tools/generate_dnsplugins_postrefreshhook.sh +++ b/tools/generate_dnsplugins_postrefreshhook.sh @@ -24,7 +24,7 @@ cb_installed=\$(cat \$SNAP/certbot-shared/certbot-version.txt) cb_required=\$(grep -oP "version = '\K.*(?=')" \$SNAP/setup.py) -python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if\ +$SNAP/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if\ version.parse('\$cb_installed') < version.parse('\$cb_required') else sys.exit(0)" || exit_code=\$? if [ "\$exit_code" -eq 1 ]; then echo "Certbot is version \$cb_installed but needs to be at least \$cb_required before" \ diff --git a/tools/generate_dnsplugins_snapcraft.sh b/tools/generate_dnsplugins_snapcraft.sh index df199f808..96e79d681 100755 --- a/tools/generate_dnsplugins_snapcraft.sh +++ b/tools/generate_dnsplugins_snapcraft.sh @@ -28,7 +28,7 @@ parts: snapcraftctl pull snapcraftctl set-version \`grep ^version \$SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"\` build-environment: - - EXCLUDE_CERTBOT_DEPS: "True" + - SNAP_BUILD: "True" certbot-metadata: plugin: dump source: .