mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Cleanup test farm tests and add test_sdists (#4089)
* add get_certbot_version.sh * Use get_certbot_version.sh in build.py * make test_leauto_upgrades.sh more robust * auto upgrades break tests * OCSP experimental is not needed anymore * Add test_sdists.sh * Use LE_AUTO_VERSION, not repo version * install OS deps earlier * use readlink not realpath * undo changes to build.py * Factor out version code from build.py * Use version.py in test_sdists * Remove get_certbot_version * workaround setuptools breakage
This commit is contained in:
committed by
Peter Eckersley
parent
be5bcfe463
commit
7f3c732bbf
@@ -8,26 +8,13 @@ other, special definitions.
|
||||
"""
|
||||
from os.path import abspath, dirname, join
|
||||
import re
|
||||
from sys import argv
|
||||
|
||||
from version import certbot_version, file_contents
|
||||
|
||||
|
||||
DIR = dirname(abspath(__file__))
|
||||
|
||||
|
||||
def certbot_version(build_script_dir):
|
||||
"""Return the version number stamped in certbot/__init__.py."""
|
||||
return re.search('''^__version__ = ['"](.+)['"].*''',
|
||||
file_contents(join(dirname(build_script_dir),
|
||||
'certbot',
|
||||
'__init__.py')),
|
||||
re.M).group(1)
|
||||
|
||||
|
||||
def file_contents(path):
|
||||
with open(path) as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
def build(version=None, requirements=None):
|
||||
"""Return the built contents of the letsencrypt-auto script.
|
||||
|
||||
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
"""Get the current Certbot version number.
|
||||
|
||||
Provides simple utilities for determining the Certbot version number and
|
||||
building letsencrypt-auto.
|
||||
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from os.path import abspath, dirname, join
|
||||
import re
|
||||
|
||||
|
||||
def certbot_version(build_script_dir):
|
||||
"""Return the version number stamped in certbot/__init__.py."""
|
||||
return re.search('''^__version__ = ['"](.+)['"].*''',
|
||||
file_contents(join(dirname(build_script_dir),
|
||||
'certbot',
|
||||
'__init__.py')),
|
||||
re.M).group(1)
|
||||
|
||||
|
||||
def file_contents(path):
|
||||
with open(path) as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(certbot_version(dirname(abspath(__file__))))
|
||||
Reference in New Issue
Block a user