certbot/certbot-dns-route53
Adrien Ferrand 9e5bca4bbf Lint certbot code on Python 3, and update Pylint to the latest version (#7551)
Part of #7550

This PR makes appropriate corrections to run pylint on Python 3.

Why not keeping the dependencies unchanged and just run pylint on Python 3?
Because the old version of pylint breaks horribly on Python 3 because of unsupported version of astroid.

Why updating pylint + astroid to the latest version ?
Because this version only fixes some internal errors occuring during the lint of Certbot code, and is also ready to run gracefully on Python 3.8.

Why upgrading mypy ?
Because the old version does not support the new version of astroid required to run pylint correctly.

Why not upgrading mypy to its latest version ?
Because this latest version includes a new typshed version, that adds a lot of new type definitions, and brings dozens of new errors on the Certbot codebase. I would like to fix that in a future PR.

That said so, the work has been to find the correct set of new dependency versions, then configure pylint for sane configuration errors in our situation, disable irrelevant lintings errors, then fixing (or ignoring for good reason) the remaining mypy errors.

I also made PyLint and MyPy checks run correctly on Windows.

* Start configuration

* Reconfigure travis

* Suspend a check specific to python 3. Start fixing code.

* Repair call_args

* Fix return + elif lints

* Reconfigure development to run mainly on python3

* Remove incompatible Python 3.4 jobs

* Suspend pylint in some assertions

* Remove pylint in dev

* Take first mypy that supports typed-ast>=1.4.0 to limit the migration path

* Various return + else lint errors

* Find a set of deps that is working with current mypy version

* Update local oldest requirements

* Remove all current pylint errors

* Rebuild letsencrypt-auto

* Update mypy to fix pylint with new astroid version, and fix mypy issues

* Explain type: ignore

* Reconfigure tox, fix none path

* Simplify pinning

* Remove useless directive

* Remove debugging code

* Remove continue

* Update requirements

* Disable unsubscriptable-object check

* Disable one check, enabling two more

* Plug certbot dev version for oldest requirements

* Remove useless disable directives

* Remove useless no-member disable

* Remove no-else-* checks. Use elif in symetric branches.

* Add back assertion

* Add new line

* Remove unused pylint disable

* Remove other pylint disable
2019-12-10 14:12:50 -08:00
..
certbot_dns_route53 Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
docs Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
examples route53: rename to match other DNS plugins (#4747) 2017-06-06 15:41:04 -07:00
tests Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
.gitignore route53: rename to match other DNS plugins (#4747) 2017-06-06 15:41:04 -07:00
LICENSE.txt Unify license filename (LICENSE.txt) (#7239) 2019-07-12 22:53:43 +03:00
local-oldest-requirements.txt Lint certbot code on Python 3, and update Pylint to the latest version (#7551) 2019-12-10 14:12:50 -08:00
MANIFEST.in Refactor tests out of packaged module for dns plugins (#7599) 2019-11-26 15:25:28 -08:00
README.md route53: rename to match other DNS plugins (#4747) 2017-06-06 15:41:04 -07:00
readthedocs.org.requirements.txt Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544) 2019-11-25 14:28:05 -08:00
setup.cfg route53: rename to match other DNS plugins (#4747) 2017-06-06 15:41:04 -07:00
setup.py Lint certbot code on Python 3, and update Pylint to the latest version (#7551) 2019-12-10 14:12:50 -08:00

Route53 plugin for Let's Encrypt client

Before you start

It's expected that the root hosted zone for the domain in question already exists in your account.

Setup

  1. Create a virtual environment

  2. Update its pip and setuptools (VENV/bin/pip install -U setuptools pip) to avoid problems with cryptography's dependency on setuptools>=11.3.

  3. Make sure you have libssl-dev and libffi (or your regional equivalents) installed. You might have to set compiler flags to pick things up (I have to use CPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib on my macOS to pick up brew's openssl, for example).

  4. Install this package.

How to use it

Make sure you have access to AWS's Route53 service, either through IAM roles or via .aws/credentials. Check out sample-aws-policy.json for the necessary permissions.

To generate a certificate:

certbot certonly \
  -n --agree-tos --email DEVOPS@COMPANY.COM \
  --dns-route53 \
  -d MY.DOMAIN.NAME