def jar(ctx, jython_version='2.7.2', pyyaml_version='5.1', jar_name=None, remove_dist=False): """Create JAR distribution. Downloads Jython JAR and PyYAML if needed. Args: jython_version: Jython version to use as a base. Must match version in `jython-standalone-<version>.jar` found from Maven central. pyyaml_version: Version of PyYAML that will be included in the standalone jar. The version must be available from PyPI. remove_dist: Control is 'dist' directory initially removed or not. """ clean(ctx, remove_dist, create_dirs=True) jython_jar = get_jython_jar(jython_version) print(f"Using '{jython_jar}'.") compile_java_files(ctx, jython_jar) unzip_jar(jython_jar) remove_tests() copy_robot_files() pyaml_archive = get_pyyaml(pyyaml_version) extract_and_copy_pyyaml_files(pyyaml_version, pyaml_archive) compile_python_files(ctx, jython_jar) version = Version(path=VERSION_PATH, pattern=VERSION_PATTERN) create_robot_jar(ctx, str(version), jar_name)
def release_notes(ctx, version=None, username=None, password=None, write=False): """Generates release notes based on issues in the issue tracker. Args: version: Generate release notes for this version. If not given, generated them for the current version. username: GitHub username. password: GitHub password. write: When set to True, write release notes to a file overwriting possible existing file. Otherwise just print them to the terminal. Username and password can also be specified using ``GITHUB_USERNAME`` and ``GITHUB_PASSWORD`` environment variable, respectively. If they aren't specified at all, communication with GitHub is anonymous and typically pretty slow. """ version = Version(version, VERSION_PATH, VERSION_PATTERN) file = RELEASE_NOTES_PATH if write else sys.stdout generator = ReleaseNotesGenerator(REPOSITORY, RELEASE_NOTES_TITLE, RELEASE_NOTES_INTRO) generator.generate(version, username, password, file)
def set_version(ctx, version): """Set project version in `src/robotremoteserver.py`` file. Args: version: Project version to set or ``dev`` to set development version. Following PEP-440 compatible version numbers are supported: - Final version like 3.0 or 3.1.2. - Alpha, beta or release candidate with ``a``, ``b`` or ``rc`` postfix, respectively, and an incremented number like 3.0a1 or 3.0.1rc1. - Development version with ``.dev`` postix and an incremented number like 3.0.dev1 or 3.1a1.dev2. When the given version is ``dev``, the existing version number is updated to the next suitable development version. For example, 3.0 -> 3.0.1.dev1, 3.1.1 -> 3.1.2.dev1, 3.2a1 -> 3.2a2.dev1, 3.2.dev1 -> 3.2.dev2. """ version = Version(version, VERSION_PATH) version.write() print(version)
def set_version(ctx, version): """Set project version in `src/robot/version.py`, `setup.py` and `pom.xml`. Args: version: Project version to set or `dev` to set development version. Following PEP-440 compatible version numbers are supported: - Final version like 3.0 or 3.1.2. - Alpha, beta or release candidate with `a`, `b` or `rc` postfix, respectively, and an incremented number like 3.0a1 or 3.0.1rc1. - Development version with `.dev` postix and an incremented number like 3.0.dev1 or 3.1a1.dev2. When the given version is `dev`, the existing version number is updated to the next suitable development version. For example, 3.0 -> 3.0.1.dev1, 3.1.1 -> 3.1.2.dev1, 3.2a1 -> 3.2a2.dev1, 3.2.dev1 -> 3.2.dev2. """ version = Version(version, VERSION_PATH, VERSION_PATTERN) version.write() Version(str(version), SETUP_PATH, VERSION_PATTERN).write() print(version)
def print_version(ctx): """Print the current project version.""" print(Version(path=VERSION_PATH))