certbot/certbot-dns-dnsimple/setup.py

78 lines
2.2 KiB
Python
Raw Permalink Normal View History

import os
import sys
from setuptools import find_packages
from setuptools import setup
2023-10-03 14:22:04 -04:00
version = '2.8.0.dev0'
install_requires = [
# This version of lexicon is required to address the problem described in
# https://github.com/AnalogJ/lexicon/issues/387.
'dns-lexicon>=3.14.1',
'setuptools>=41.6.0',
]
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
else:
Don't include certbot deps when EXCLUDE_CERTBOT_DEPS is set in plugins (#8091) This will allow DNS plugin snaps to build if they rely on unreleased acme/certbot, and remove other copy of Certbot from externally snapped plugins. Fixes #8064 and fixes #7946. Implementation is based on the design [here](https://github.com/certbot/certbot/issues/8064#issuecomment-645513120). To test, see reverted commit 8632064. Steps taken: - added changes to setup.py and snapcraft.yaml - successfully snapped, connected, ran `sudo certbot plugins --prepare` - added temporary changes to have both certbot and certbot-dns-dnsimple use DNSAuthenticator2 - snapped and installed certbot, `certbot plugins` failed as expected. - snapped and installed certbot-dns-dnsimple, `sudo certbot plugins --prepare` succeeded - Inspected dns plugin's `bin` and `lib`; no `certbot` or `acme`, as expected. ``` $ ls /snap/certbot-dns-dnsimple/current/lib/python3.6/site-packages/ OpenSSL future-0.18.2.dist-info requests_file.py PyYAML-5.3.1.dist-info idna setuptools _cffi_backend.cpython-36m-x86_64-linux-gnu.so idna-2.9.dist-info setuptools-47.3.1.dist-info certbot_dns_dnsimple lexicon six-1.15.0.dist-info certbot_dns_dnsimple-1.6.0.dev0-py3.6.egg-info libfuturize six.py certifi libpasteurize tldextract certifi-2020.4.5.1.dist-info past tldextract-2.2.2.dist-info cffi pip urllib3 cffi-1.14.0.dist-info pip-20.1.1.dist-info urllib3-1.25.9.dist-info chardet pkg_resources wheel chardet-3.0.4.dist-info pyOpenSSL-19.1.0.dist-info wheel-0.34.2.dist-info cryptography pycparser yaml cryptography-2.8.dist-info pycparser-2.20.dist-info zope dns_lexicon-3.3.26.dist-info requests zope.interface-5.1.0-py3.6-nspkg.pth easy_install.py requests-2.23.0.dist-info zope.interface-5.1.0.dist-info future requests_file-1.5.1.dist-info $ ls /snap/certbot-dns-dnsimple/current/bin/ chardetect futurize lexicon pasteurize tldextract ``` - reset to HEAD^ - snapped and installed certbot to not have the DNSAuthenticator2 changes, `certbot plugins` failed as expected. * Don't include certbot deps when EXCLUDE_CERTBOT_DEPS is set * Set EXCLUDE_CERTBOT_DEPS in certbot-dns-dnsimple/snap/snapcraft.yaml
2020-06-18 18:24:10 -04:00
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}',
Don't include certbot deps when EXCLUDE_CERTBOT_DEPS is set in plugins (#8091) This will allow DNS plugin snaps to build if they rely on unreleased acme/certbot, and remove other copy of Certbot from externally snapped plugins. Fixes #8064 and fixes #7946. Implementation is based on the design [here](https://github.com/certbot/certbot/issues/8064#issuecomment-645513120). To test, see reverted commit 8632064. Steps taken: - added changes to setup.py and snapcraft.yaml - successfully snapped, connected, ran `sudo certbot plugins --prepare` - added temporary changes to have both certbot and certbot-dns-dnsimple use DNSAuthenticator2 - snapped and installed certbot, `certbot plugins` failed as expected. - snapped and installed certbot-dns-dnsimple, `sudo certbot plugins --prepare` succeeded - Inspected dns plugin's `bin` and `lib`; no `certbot` or `acme`, as expected. ``` $ ls /snap/certbot-dns-dnsimple/current/lib/python3.6/site-packages/ OpenSSL future-0.18.2.dist-info requests_file.py PyYAML-5.3.1.dist-info idna setuptools _cffi_backend.cpython-36m-x86_64-linux-gnu.so idna-2.9.dist-info setuptools-47.3.1.dist-info certbot_dns_dnsimple lexicon six-1.15.0.dist-info certbot_dns_dnsimple-1.6.0.dev0-py3.6.egg-info libfuturize six.py certifi libpasteurize tldextract certifi-2020.4.5.1.dist-info past tldextract-2.2.2.dist-info cffi pip urllib3 cffi-1.14.0.dist-info pip-20.1.1.dist-info urllib3-1.25.9.dist-info chardet pkg_resources wheel chardet-3.0.4.dist-info pyOpenSSL-19.1.0.dist-info wheel-0.34.2.dist-info cryptography pycparser yaml cryptography-2.8.dist-info pycparser-2.20.dist-info zope dns_lexicon-3.3.26.dist-info requests zope.interface-5.1.0-py3.6-nspkg.pth easy_install.py requests-2.23.0.dist-info zope.interface-5.1.0.dist-info future requests_file-1.5.1.dist-info $ ls /snap/certbot-dns-dnsimple/current/bin/ chardetect futurize lexicon pasteurize tldextract ``` - reset to HEAD^ - snapped and installed certbot to not have the DNSAuthenticator2 changes, `certbot plugins` failed as expected. * Don't include certbot deps when EXCLUDE_CERTBOT_DEPS is set * Set EXCLUDE_CERTBOT_DEPS in certbot-dns-dnsimple/snap/snapcraft.yaml
2020-06-18 18:24:10 -04:00
])
docs_extras = [
'Sphinx>=1.0', # autodoc_member_order = 'bysource', autodoc_default_flags
'sphinx_rtd_theme',
]
test_extras = [
'pytest',
]
setup(
name='certbot-dns-dnsimple',
version=version,
description="DNSimple 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.8',
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.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,
'test': test_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-dnsimple = certbot_dns_dnsimple._internal.dns_dnsimple:Authenticator',
],
},
)