certbot/certbot-dns-google/setup.py

78 lines
2.4 KiB
Python
Raw Permalink Normal View History

import os
import sys
from setuptools import find_packages
from setuptools import setup
2022-10-04 14:17:29 -04:00
version = '2.0.0.dev0'
install_requires = [
'google-api-python-client>=1.5.5',
'oauth2client>=4.0',
'setuptools>=41.6.0',
# already a dependency of google-api-python-client, but added for consistency
'httplib2'
]
Make externally snapped plugin updates more stable (#8145) Fixes #7863. Connect command is `sudo snap connect certbot-dns-dnsimple:certbot-metadata certbot:certbot-metadata` Logs are `cat /var/snap/certbot-dns-dnsimple/current/debuglog` Echos in hook are only printed to terminal when it exits 0; otherwise, check logs in `debuglog` mentioned above. Manual tests include all iterations of connected, unconnected, installed for the first, second time, etc, with passing and failing version checks. * Make dnsimple not update if certbot is too old * create an interface to read cb version * add missing newline * fix syntax * trying to figure out the consumer syntax * trying to figure out the consumer syntax, again * only check post first install * valid setting name * test for first install differently * snapctl doesn't error if it fails I guess * time to do some print debugging * continue playing with syntax * once again, fooled by bash int vs string comparisons! * debugging * if we use post and pre together we can do this * is this how content interface syntax works * it's a directory? * more debug * what's that error message again? * try other syntax * if it's not documented just guess at syntax * actually, I think this is the syntax * oops didn't set for new hook * test passing information along connection * interface attributes can only be set during the execution of prepare hooks * just do it with main connection * undo last few test changes * Add some printing to make sure we understand what's going on * create empty directory to bind to * put mkdir in the correct part * let's inspect the environment * it can't run bash directly. * perhaps only directories can be shared via the contente interface * update name of folder * echo to debug log to understand what's going on exactly. we have file access though! * update grep for new file * more printing * echo to the debug log * ok NOW all print statements are going to the log * why does echo need two >s * remove unnecessary extra check, just check if the init file is available * check if certbot version will be available post-refresh after all * pre-refresh hook is not necessary to get certbot version * update mkdir so we don't have to clean each time * try comparing version numbers in python * it's python3 * we need different prints for if we succeed or if we fail. * improve bash syntax * remove some debugging code * Remove debug script * remove spaces for clarity * consolidate parts and remove more test code * s/certbot-version/certbot-metadata/g * use sys.exit instead of exit * find and save certbot version on the certbot side * change presence test to new file * switch to using packaging.version.parse instead of LooseVersion * switch to requiring certbot version >= plugin version * add plugin snap changes to generate script * Add comment to generation file saying not to edit generated files manually * Create post-refresh hook for all plugins with script * generate files using new script * update snapcraft.yaml files for plugins * bin/sh comes first * Add packaging to install_requires * Check that refresh is allowed in integration test * switch plug and slot names in integration test * Update tools/generate_dnsplugins_postrefreshhook.sh Co-authored-by: Brad Warren <bmw@users.noreply.github.com> * small bash fixes * Update snap readme with new instructions * Run tools/generate_dnsplugins_postrefreshhook.sh * Update tools/snap/generate_dnsplugins_postrefreshhook.sh Co-authored-by: Brad Warren <bmw@users.noreply.github.com> Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2020-07-22 20:07:07 -04:00
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
# We specify the minimum acme and certbot version as the current plugin
# version for simplicity. See
# https://github.com/certbot/certbot/issues/8761 for more info.
f'acme>={version}',
f'certbot>={version}',
])
elif 'bdist_wheel' in sys.argv[1:]:
Make externally snapped plugin updates more stable (#8145) Fixes #7863. Connect command is `sudo snap connect certbot-dns-dnsimple:certbot-metadata certbot:certbot-metadata` Logs are `cat /var/snap/certbot-dns-dnsimple/current/debuglog` Echos in hook are only printed to terminal when it exits 0; otherwise, check logs in `debuglog` mentioned above. Manual tests include all iterations of connected, unconnected, installed for the first, second time, etc, with passing and failing version checks. * Make dnsimple not update if certbot is too old * create an interface to read cb version * add missing newline * fix syntax * trying to figure out the consumer syntax * trying to figure out the consumer syntax, again * only check post first install * valid setting name * test for first install differently * snapctl doesn't error if it fails I guess * time to do some print debugging * continue playing with syntax * once again, fooled by bash int vs string comparisons! * debugging * if we use post and pre together we can do this * is this how content interface syntax works * it's a directory? * more debug * what's that error message again? * try other syntax * if it's not documented just guess at syntax * actually, I think this is the syntax * oops didn't set for new hook * test passing information along connection * interface attributes can only be set during the execution of prepare hooks * just do it with main connection * undo last few test changes * Add some printing to make sure we understand what's going on * create empty directory to bind to * put mkdir in the correct part * let's inspect the environment * it can't run bash directly. * perhaps only directories can be shared via the contente interface * update name of folder * echo to debug log to understand what's going on exactly. we have file access though! * update grep for new file * more printing * echo to the debug log * ok NOW all print statements are going to the log * why does echo need two >s * remove unnecessary extra check, just check if the init file is available * check if certbot version will be available post-refresh after all * pre-refresh hook is not necessary to get certbot version * update mkdir so we don't have to clean each time * try comparing version numbers in python * it's python3 * we need different prints for if we succeed or if we fail. * improve bash syntax * remove some debugging code * Remove debug script * remove spaces for clarity * consolidate parts and remove more test code * s/certbot-version/certbot-metadata/g * use sys.exit instead of exit * find and save certbot version on the certbot side * change presence test to new file * switch to using packaging.version.parse instead of LooseVersion * switch to requiring certbot version >= plugin version * add plugin snap changes to generate script * Add comment to generation file saying not to edit generated files manually * Create post-refresh hook for all plugins with script * generate files using new script * update snapcraft.yaml files for plugins * bin/sh comes first * Add packaging to install_requires * Check that refresh is allowed in integration test * switch plug and slot names in integration test * Update tools/generate_dnsplugins_postrefreshhook.sh Co-authored-by: Brad Warren <bmw@users.noreply.github.com> * small bash fixes * Update snap readme with new instructions * Run tools/generate_dnsplugins_postrefreshhook.sh * Update tools/snap/generate_dnsplugins_postrefreshhook.sh Co-authored-by: Brad Warren <bmw@users.noreply.github.com> Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2020-07-22 20:07:07 -04:00
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
Make externally snapped plugin updates more stable (#8145) Fixes #7863. Connect command is `sudo snap connect certbot-dns-dnsimple:certbot-metadata certbot:certbot-metadata` Logs are `cat /var/snap/certbot-dns-dnsimple/current/debuglog` Echos in hook are only printed to terminal when it exits 0; otherwise, check logs in `debuglog` mentioned above. Manual tests include all iterations of connected, unconnected, installed for the first, second time, etc, with passing and failing version checks. * Make dnsimple not update if certbot is too old * create an interface to read cb version * add missing newline * fix syntax * trying to figure out the consumer syntax * trying to figure out the consumer syntax, again * only check post first install * valid setting name * test for first install differently * snapctl doesn't error if it fails I guess * time to do some print debugging * continue playing with syntax * once again, fooled by bash int vs string comparisons! * debugging * if we use post and pre together we can do this * is this how content interface syntax works * it's a directory? * more debug * what's that error message again? * try other syntax * if it's not documented just guess at syntax * actually, I think this is the syntax * oops didn't set for new hook * test passing information along connection * interface attributes can only be set during the execution of prepare hooks * just do it with main connection * undo last few test changes * Add some printing to make sure we understand what's going on * create empty directory to bind to * put mkdir in the correct part * let's inspect the environment * it can't run bash directly. * perhaps only directories can be shared via the contente interface * update name of folder * echo to debug log to understand what's going on exactly. we have file access though! * update grep for new file * more printing * echo to the debug log * ok NOW all print statements are going to the log * why does echo need two >s * remove unnecessary extra check, just check if the init file is available * check if certbot version will be available post-refresh after all * pre-refresh hook is not necessary to get certbot version * update mkdir so we don't have to clean each time * try comparing version numbers in python * it's python3 * we need different prints for if we succeed or if we fail. * improve bash syntax * remove some debugging code * Remove debug script * remove spaces for clarity * consolidate parts and remove more test code * s/certbot-version/certbot-metadata/g * use sys.exit instead of exit * find and save certbot version on the certbot side * change presence test to new file * switch to using packaging.version.parse instead of LooseVersion * switch to requiring certbot version >= plugin version * add plugin snap changes to generate script * Add comment to generation file saying not to edit generated files manually * Create post-refresh hook for all plugins with script * generate files using new script * update snapcraft.yaml files for plugins * bin/sh comes first * Add packaging to install_requires * Check that refresh is allowed in integration test * switch plug and slot names in integration test * Update tools/generate_dnsplugins_postrefreshhook.sh Co-authored-by: Brad Warren <bmw@users.noreply.github.com> * small bash fixes * Update snap readme with new instructions * Run tools/generate_dnsplugins_postrefreshhook.sh * Update tools/snap/generate_dnsplugins_postrefreshhook.sh Co-authored-by: Brad Warren <bmw@users.noreply.github.com> Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2020-07-22 20:07:07 -04:00
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
docs_extras = [
'Sphinx>=1.0', # autodoc_member_order = 'bysource', autodoc_default_flags
'sphinx_rtd_theme',
]
setup(
name='certbot-dns-google',
version=version,
description="Google Cloud DNS Authenticator plugin for Certbot",
url='https://github.com/certbot/certbot',
author="Certbot Project",
author_email='certbot-dev@eff.org',
license='Apache License 2.0',
python_requires='>=3.7',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Security',
'Topic :: System :: Installation/Setup',
'Topic :: System :: Networking',
'Topic :: System :: Systems Administration',
'Topic :: Utilities',
],
packages=find_packages(),
include_package_data=True,
install_requires=install_requires,
extras_require={
'docs': docs_extras,
},
entry_points={
'certbot.plugins': [
Make the contents of the DNS plugins private (#7580) Part of #5775. ``` modify_item () { mkdir certbot-dns-$1/certbot_dns_$1/_internal git grep -l "from certbot_dns_$1 import dns_$1" | xargs sed -i "s/from certbot_dns_$1 import dns_$1/from certbot_dns_$1._internal import dns_$1/g" git grep -l "certbot_dns_$1\.dns_$1" | xargs sed -i "s/certbot_dns_$1\.dns_$1/certbot_dns_$1._internal.dns_$1/g" git checkout -- certbot-dns-$1/certbot_dns_$1/__init__.py echo '"""Internal implementation of \`~certbot_dns_$1.dns_$1\` plugin."""' > certbot-dns-$1/certbot_dns_$1/_internal/__init__.py mv certbot-dns-$1/certbot_dns_$1/dns_$1.py certbot-dns-$1/certbot_dns_$1/_internal git checkout -- CHANGELOG.md git status git add -A git commit -m "Move certbot-dns-$1 to _internal structure" } ``` Structure now looks like this: ``` certbot-dns-cloudflare/ ├── certbot_dns_cloudflare │   ├── dns_cloudflare_test.py │   ├── __init__.py │   └── _internal │   ├── dns_cloudflare.py │   └── __init__.py ``` * Move certbot-dns-cloudflare to _internal structure * Move certbot-dns-cloudxns to _internal structure * Move certbot-dns-digitalocean to _internal structure * Move certbot-dns-dnsimple to _internal structure * Move certbot-dns-dnsmadeeasy to _internal structure * Move certbot-dns-gehirn to _internal structure * Move certbot-dns-google to _internal structure * Move certbot-dns-linode to _internal structure * Move certbot-dns-luadns to _internal structure * Move certbot-dns-nsone to _internal structure * Move certbot-dns-ovh to _internal structure * Move certbot-dns-rfc2136 to _internal structure * Move certbot-dns-sakuracloud to _internal structure * Init file comments need to be comments * Move certbot-dns-route53 to _internal structure * Fix comment in route53 init
2019-11-25 13:26:05 -05:00
'dns-google = certbot_dns_google._internal.dns_google:Authenticator',
],
},
)