Basic dev/test setup for separate package subdirectories.

This commit is contained in:
Jakub Warmuz 2015-07-10 16:34:08 +00:00
parent 2f9cd68807
commit b9df69af9f
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA
15 changed files with 104 additions and 92 deletions

View file

@ -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);

View file

@ -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

2
Vagrantfile vendored
View file

@ -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

1
acme/MANIFEST.in Normal file
View file

@ -0,0 +1 @@
recursive-include acme/testdata *

29
acme/setup.py Normal file
View file

@ -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',
],
},
)

View file

@ -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

View file

@ -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

View file

@ -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!

View file

@ -1 +1 @@
../../acme/test_util.py
../../acme/acme/test_util.py

View file

@ -0,0 +1,2 @@
recursive-include letsencrypt_apache/tests/testdata *
include letsencrypt_apache/options-ssl-apache.conf

View file

@ -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',
],
},
)

View file

@ -0,0 +1,2 @@
recursive-include letsencrypt_nginx/tests/testdata *
include letsencrypt_nginx/options-ssl-nginx.conf

View file

@ -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',
],
},
)

View file

@ -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',
],
},

15
tox.ini
View file

@ -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