diff --git a/certbot-apache/setup.py b/certbot-apache/setup.py index d780cb723..962211e5b 100644 --- a/certbot-apache/setup.py +++ b/certbot-apache/setup.py @@ -1,22 +1,39 @@ +import sys + from setuptools import find_packages from setuptools import setup version = '1.16.0.dev0' -# Remember to update local-oldest-requirements.txt when changing the minimum -# acme/certbot version. -install_requires = [ - 'acme>=1.8.0', - 'certbot>=1.10.1', - 'python-augeas', - 'setuptools>=39.0.1', - 'zope.component', - 'zope.interface', -] - -dev_extras = [ - 'apacheconfig>=0.3.2', -] +if sys.platform == 'win32': + # On Windows, makes certbot-apache essentially an empty project to avoid any + # problem at build time or run time with python-augeas + packages = [] + install_requires = [] + extra_require = {} + entry_points = {} +else: + packages = find_packages() + # Remember to update local-oldest-requirements.txt when changing the minimum + # acme/certbot version. + install_requires = [ + 'acme>=1.8.0', + 'certbot>=1.10.1', + 'python-augeas', + 'setuptools>=39.0.1', + 'zope.component', + 'zope.interface', + ] + extra_require = { + 'dev': [ + 'apacheconfig>=0.3.2', + ], + } + entry_points = { + 'certbot.plugins': [ + 'apache = certbot_apache._internal.entrypoint:ENTRYPOINT', + ], + } setup( name='certbot-apache', @@ -47,15 +64,9 @@ setup( 'Topic :: Utilities', ], - packages=find_packages(), + packages=packages, include_package_data=True, install_requires=install_requires, - extras_require={ - 'dev': dev_extras, - }, - entry_points={ - 'certbot.plugins': [ - 'apache = certbot_apache._internal.entrypoint:ENTRYPOINT', - ], - }, + extras_require=extra_require, + entry_points=entry_points, ) diff --git a/certbot-apache/tests/conftest.py b/certbot-apache/tests/conftest.py new file mode 100644 index 000000000..85bfe96f8 --- /dev/null +++ b/certbot-apache/tests/conftest.py @@ -0,0 +1,6 @@ +import sys + +def pytest_ignore_collect(path, config): + # Do not run any test for certbot-apache on Windows. + if sys.platform == 'win32': + return True diff --git a/tools/install_and_test.py b/tools/install_and_test.py index e7a34286c..ed09204af 100755 --- a/tools/install_and_test.py +++ b/tools/install_and_test.py @@ -10,8 +10,6 @@ import re import subprocess import sys -SKIP_PROJECTS_ON_WINDOWS = ['certbot-apache'] - def call_with_print(command): print(command) @@ -22,16 +20,7 @@ def main(args): script_dir = os.path.dirname(os.path.abspath(__file__)) command = [sys.executable, os.path.join(script_dir, 'pip_install_editable.py')] - new_args = [] - for arg in args: - if os.name == 'nt' and arg in SKIP_PROJECTS_ON_WINDOWS: - print(( - 'Info: currently {0} is not supported on Windows and will not be tested.' - .format(arg))) - else: - new_args.append(arg) - - for requirement in new_args: + for requirement in args: current_command = command[:] current_command.append(requirement) call_with_print(' '.join(current_command)) @@ -40,5 +29,6 @@ def main(args): call_with_print(' '.join([ sys.executable, '-m', 'pytest', pkg])) + if __name__ == '__main__': main(sys.argv[1:]) diff --git a/tools/pip_install_editable.py b/tools/pip_install_editable.py index dd1416e75..1a4667b49 100755 --- a/tools/pip_install_editable.py +++ b/tools/pip_install_editable.py @@ -18,5 +18,6 @@ def main(args): pip_install.main(new_args) + if __name__ == '__main__': main(sys.argv[1:]) diff --git a/tools/venv.py b/tools/venv.py index 892d3327f..f3f5781fa 100755 --- a/tools/venv.py +++ b/tools/venv.py @@ -48,7 +48,6 @@ REQUIREMENTS = [ ] if sys.platform == 'win32': - REQUIREMENTS.remove('-e certbot-apache') REQUIREMENTS.append('-e windows-installer') VERSION_PATTERN = re.compile(r'^(\d+)\.(\d+).*$')