certbot/certbot-dns-linode/setup.py

75 lines
2.3 KiB
Python
Raw Normal View History

import os
import sys
from setuptools import find_packages
from setuptools import setup
2021-12-07 17:03:51 -05:00
version = '1.23.0.dev0'
install_requires = [
'dns-lexicon>=3.2.1',
Switch oldest tests to Python 3 (#8590) Fixes https://github.com/certbot/certbot/issues/8580. With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track. You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results. I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here. To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it. * remove py27 from oldest name * update min cryptography version * remove run_oldest_tests.sh * upgrade setuptools and pyopenssl * update cffi, pyparsing, and idna * expand oldest_constraints comments * clarify oldest comment * update min configobj version * update min parsedatetime version * quote tox env name * use Python 3.6 in the oldest tests * use Python 3.6 for oldest integration tests * properly pin asn1crypto * update min six version * set basepython for a nicer error message * remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
'setuptools>=39.0.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
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-linode',
version=version,
description="Linode 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.6',
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.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'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-linode = certbot_dns_linode._internal.dns_linode:Authenticator',
],
},
)