diff --git a/Dockerfile b/Dockerfile index 479aa4e85..a045cf2ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,11 @@ COPY letsencrypt_nginx /opt/letsencrypt/src/letsencrypt_nginx/ # requirements.txt not installed! RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \ - /opt/letsencrypt/venv/bin/pip install -e /opt/letsencrypt/src + /opt/letsencrypt/venv/bin/pip install \ + -e /opt/letsencrypt/src/acme \ + -e /opt/letsencrypt/src \ + -e /opt/letsencrypt/src/letsencrypt_apache \ + -e /opt/letsencrypt/src/letsencrypt_nginx # install in editable mode (-e) to save space: it's not possible to # "rm -rf /opt/letsencrypt/src" (it's stays in the underlaying image); diff --git a/MANIFEST.in b/MANIFEST.in index 900a7ab80..08b67ef7a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,12 +4,3 @@ include CONTRIBUTING.md include linter_plugin.py include letsencrypt/EULA recursive-include letsencrypt/tests/testdata * - -recursive-include acme/schemata *.json -recursive-include acme/testdata * - -recursive-include letsencrypt_apache/tests/testdata * -include letsencrypt_apache/options-ssl-apache.conf - -recursive-include letsencrypt_nginx/tests/testdata * -include letsencrypt_nginx/options-ssl-nginx.conf diff --git a/Vagrantfile b/Vagrantfile index 1d3b48f06..0659e1ee2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -10,7 +10,7 @@ cd /vagrant sudo ./bootstrap/ubuntu.sh if [ ! -d "venv" ]; then virtualenv --no-site-packages -p python2 venv - ./venv/bin/pip install -r requirements.txt -e .[dev,docs,testing] + ./venv/bin/pip install -r requirements.txt -e acme -e .[dev,docs,testing] -e letsencrypt_apache -e letsencrypt_nginx fi SETUP_SCRIPT diff --git a/acme/MANIFEST.in b/acme/MANIFEST.in new file mode 100644 index 000000000..f3444f746 --- /dev/null +++ b/acme/MANIFEST.in @@ -0,0 +1 @@ +recursive-include acme/testdata * diff --git a/acme/setup.py b/acme/setup.py new file mode 100644 index 000000000..d83131d2a --- /dev/null +++ b/acme/setup.py @@ -0,0 +1,29 @@ +from setuptools import setup +from setuptools import find_packages + + +install_requires = [ + 'argparse', + # load_pem_private/public_key (>=0.6) + # rsa_recover_prime_factors (>=0.8) + 'cryptography>=0.8', + 'mock<1.1.0', # py26 + 'pyrfc3339', + 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304) + 'pyasn1', # urllib3 InsecurePlatformWarning (#304) + 'PyOpenSSL', + 'pytz', + 'requests', + 'werkzeug', +] + +setup( + name='acme', + packages=find_packages(), + install_requires=install_requires, + entry_points={ + 'console_scripts': [ + 'jws = acme.jose.jws:CLI.run', + ], + }, +) diff --git a/docs/contributing.rst b/docs/contributing.rst index b415390cf..c2120f1e1 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -26,7 +26,7 @@ Install the development packages: .. code-block:: shell - pip install -r requirements.txt -e .[dev,docs,testing] + pip install -r requirements.txt -e acme -e .[dev,docs,testing] -e letsencrypt_apache -e letsencrypt_nginx .. note:: `-e` (short for `--editable`) turns on *editable mode* in which any source code changes in the current working diff --git a/docs/using.rst b/docs/using.rst index 026c34aa2..0d9ffcc73 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -108,7 +108,7 @@ Installation .. code-block:: shell virtualenv --no-site-packages -p python2 venv - ./venv/bin/pip install -r requirements.txt . + ./venv/bin/pip install -r requirements.txt acme . letsencrypt_apache letsencrypt_nginx .. warning:: Please do **not** use ``python setup.py install``. Please do **not** attempt the installation commands as diff --git a/letsencrypt/plugins/disco.py b/letsencrypt/plugins/disco.py index e2e2d4c54..51d251126 100644 --- a/letsencrypt/plugins/disco.py +++ b/letsencrypt/plugins/disco.py @@ -16,7 +16,11 @@ logger = logging.getLogger(__name__) class PluginEntryPoint(object): """Plugin entry point.""" - PREFIX_FREE_DISTRIBUTIONS = ["letsencrypt"] + PREFIX_FREE_DISTRIBUTIONS = [ + "letsencrypt", + "letsencrypt-apache", + "letsencrypt-nginx", + ] """Distributions for which prefix will be omitted.""" # this object is mutable, don't allow it to be hashed! diff --git a/letsencrypt/tests/test_util.py b/letsencrypt/tests/test_util.py index d46ad3bd4..80d26cbe8 120000 --- a/letsencrypt/tests/test_util.py +++ b/letsencrypt/tests/test_util.py @@ -1 +1 @@ -../../acme/test_util.py \ No newline at end of file +../../acme/acme/test_util.py \ No newline at end of file diff --git a/letsencrypt_apache/MANIFEST.in b/letsencrypt_apache/MANIFEST.in new file mode 100644 index 000000000..aac2bfb36 --- /dev/null +++ b/letsencrypt_apache/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include letsencrypt_apache/tests/testdata * +include letsencrypt_apache/options-ssl-apache.conf diff --git a/letsencrypt_apache/setup.py b/letsencrypt_apache/setup.py new file mode 100644 index 000000000..fac5b6b88 --- /dev/null +++ b/letsencrypt_apache/setup.py @@ -0,0 +1,23 @@ +from setuptools import setup +from setuptools import find_packages + + +install_requires = [ + 'acme', + 'letsencrypt', + 'mock<1.1.0', # py26 + 'python-augeas', + 'zope.component', + 'zope.interface', +] + +setup( + name='letsencrypt-apache', + packages=find_packages(), + install_requires=install_requires, + entry_points={ + 'letsencrypt.plugins': [ + 'apache = letsencrypt_apache.configurator:ApacheConfigurator', + ], + }, +) diff --git a/letsencrypt_nginx/MANIFEST.in b/letsencrypt_nginx/MANIFEST.in new file mode 100644 index 000000000..94f85e40f --- /dev/null +++ b/letsencrypt_nginx/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include letsencrypt_nginx/tests/testdata * +include letsencrypt_nginx/options-ssl-nginx.conf diff --git a/letsencrypt_nginx/setup.py b/letsencrypt_nginx/setup.py new file mode 100644 index 000000000..bd8e8976d --- /dev/null +++ b/letsencrypt_nginx/setup.py @@ -0,0 +1,22 @@ +from setuptools import setup +from setuptools import find_packages + + +install_requires = [ + 'acme', + 'letsencrypt', + 'pyparsing>=1.5.5', # Python3 support; perhaps unnecessary? + 'mock<1.1.0', # py26 + 'zope.interface', +] + +setup( + name='letsencrypt-nginx', + packages=find_packages(), + install_requires=install_requires, + entry_points={ + 'letsencrypt.plugins': [ + 'nginx = letsencrypt_nginx.configurator:NginxConfigurator', + ], + }, +) diff --git a/setup.py b/setup.py index 0c74b296c..1e0d58a70 100644 --- a/setup.py +++ b/setup.py @@ -28,88 +28,24 @@ meta = dict(re.findall(r"""__([a-z]+)__ = "([^"]+)""", read_file(init_fn))) readme = read_file(os.path.join(here, 'README.rst')) changes = read_file(os.path.join(here, 'CHANGES.rst')) -# #358: acme, letsencrypt, letsencrypt_apache, letsencrypt_nginx, etc. -# shall be distributed separately. Please make sure to keep the -# dependecy lists up to date: this is being somewhat checked below -# using an assert statement! Separate lists are helpful for OS package -# maintainers. and will make the future migration a lot easier. -acme_install_requires = [ - 'argparse', - # load_pem_private/public_key (>=0.6) - # rsa_recover_prime_factors (>=0.8) - 'cryptography>=0.8', - 'mock<1.1.0', # py26 - 'pyrfc3339', - 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304) - 'pyasn1', # urllib3 InsecurePlatformWarning (#304) - #'PyOpenSSL', # version pin would cause mismatch - 'pytz', - 'requests', - 'werkzeug', -] -letsencrypt_install_requires = [ - #'acme', - 'argparse', - 'ConfigArgParse', - 'configobj', - #'cryptography>=0.7', # load_pem_x509_certificate, version pin mismatch - 'mock<1.1.0', # py26 - 'parsedatetime', - 'psutil>=2.1.0', # net_connections introduced in 2.1.0 - # https://pyopenssl.readthedocs.org/en/latest/api/crypto.html#OpenSSL.crypto.X509Req.get_extensions - 'PyOpenSSL>=0.15', - 'pyrfc3339', - 'python2-pythondialog>=3.2.2rc1', # Debian squeeze support, cf. #280 - 'pytz', - 'zope.component', - 'zope.interface', -] -letsencrypt_apache_install_requires = [ - #'acme', - #'letsencrypt', - 'mock<1.1.0', # py26 - 'python-augeas', - 'zope.component', - 'zope.interface', -] -letsencrypt_nginx_install_requires = [ - #'acme', - #'letsencrypt', - 'pyparsing>=1.5.5', # Python3 support; perhaps unnecessary? - 'mock<1.1.0', # py26 - 'zope.interface', -] - install_requires = [ + 'acme', 'argparse', - 'cryptography>=0.8', 'ConfigArgParse', 'configobj', + 'cryptography>=0.7', # load_pem_x509_certificate 'mock<1.1.0', # py26 - 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304) 'parsedatetime', 'psutil>=2.1.0', # net_connections introduced in 2.1.0 - 'pyasn1', # urllib3 InsecurePlatformWarning (#304) # https://pyopenssl.readthedocs.org/en/latest/api/crypto.html#OpenSSL.crypto.X509Req.get_extensions 'PyOpenSSL>=0.15', - 'pyparsing>=1.5.5', # Python3 support; perhaps unnecessary? 'pyrfc3339', - 'python-augeas', 'python2-pythondialog>=3.2.2rc1', # Debian squeeze support, cf. #280 'pytz', - 'requests', - 'werkzeug', 'zope.component', 'zope.interface', ] -assert set(install_requires) == set.union(*(set(ireq) for ireq in ( - acme_install_requires, - letsencrypt_install_requires, - letsencrypt_apache_install_requires, - letsencrypt_nginx_install_requires -))), "*install_requires don't match up!" - dev_extras = [ # Pin astroid==1.3.5, pylint==1.4.2 as a workaround for #289 'astroid==1.3.5', @@ -172,7 +108,6 @@ setup( 'console_scripts': [ 'letsencrypt = letsencrypt.cli:main', 'letsencrypt-renewer = letsencrypt.renewer:main', - 'jws = letsencrypt.acme.jose.jws:CLI.run', ], 'letsencrypt.plugins': [ 'manual = letsencrypt.plugins.manual:ManualAuthenticator', @@ -180,10 +115,6 @@ setup( 'null = letsencrypt.plugins.null:Installer', 'standalone = letsencrypt.plugins.standalone.authenticator' ':StandaloneAuthenticator', - - # to be moved to separate pypi packages - 'apache = letsencrypt_apache.configurator:ApacheConfigurator', - 'nginx = letsencrypt_nginx.configurator:NginxConfigurator', ], }, diff --git a/tox.ini b/tox.ini index 2f20e5799..71eb950d1 100644 --- a/tox.ini +++ b/tox.ini @@ -3,11 +3,14 @@ # "tox" from this directory. [tox] +# acme and letsencrypt are not yet on pypi, so when Tox invokes +# "install *.zip", it will not find deps +skipsdist = true envlist = py26,py27,cover,lint [testenv] commands = - pip install -r requirements.txt -e .[testing] + pip install -r requirements.txt -e acme -e .[testing] -e letsencrypt_apache -e letsencrypt_nginx # -q does not suppress errors python setup.py test -q python setup.py test -q -s acme @@ -22,7 +25,7 @@ setenv = [testenv:cover] basepython = python2.7 commands = - pip install -r requirements.txt -e .[testing] + pip install -r requirements.txt -e acme -e .[testing] -e letsencrypt_apache -e letsencrypt_nginx ./tox.cover.sh [testenv:lint] @@ -32,8 +35,8 @@ basepython = python2.7 # duplicate code checking; if one of the commands fails, others will # continue, but tox return code will reflect previous error commands = - pip install -r requirements.txt -e .[dev] + pip install -r requirements.txt -e acme -e .[dev] -e letsencrypt_apache -e letsencrypt_nginx pylint --rcfile=.pylintrc letsencrypt - pylint --rcfile=.pylintrc acme - pylint --rcfile=.pylintrc letsencrypt_apache - pylint --rcfile=.pylintrc letsencrypt_nginx + pylint --rcfile=.pylintrc acme/acme + pylint --rcfile=.pylintrc letsencrypt_apache/letsencrypt_apache + pylint --rcfile=.pylintrc letsencrypt_nginx/letsencrypt_nginx