Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClusterRunner should use hardcoded version string #348

Closed
shriganeshs-zz opened this issue May 24, 2017 · 3 comments
Closed

ClusterRunner should use hardcoded version string #348

shriganeshs-zz opened this issue May 24, 2017 · 3 comments
Assignees
Labels

Comments

@shriganeshs-zz
Copy link

The version should be hardcoded string. If ClusterRunner could not find version in cx_Freeze package, it assumes you're developing it locally and tries to calculate the version from git commits.

# clusterrunner -V
fatal: Not a git repository (or any of the parent directories): .git
ClusterRunner 0.5.???

Below is the code

def get_version():
    """
    Get the version of the application. This method should return the correct version in both the frozen and unfrozen
    (running from cloned source) cases.
    :return: The version of the application
    :rtype: str
    """
    if getattr(sys, 'frozen', False):
        return _get_frozen_package_version()  # frozen/packaged

    return _calculate_source_version()  # unfrozen/running from source```
@josephharrington
Copy link
Contributor

There are two tasks:

  1. Execute logic that hardcodes the version before building the rpm.
  2. Change the logic in get_version so that it doesn't rely on the sys.frozen attribute.

See setup.py for the logic that we'd need to execute before building the rpm:

version = autoversioning.get_version()
autoversioning.write_package_version_file(version)

This will create a file that essentially hardcodes the version number.

Just for background, the getattr(sys, 'frozen', False) pattern is not specific to cx_Freeze -- that is also used in other bundling/freezing tools.

But it sounds like bundling into an rpm does not set the frozen attribute, so we should decide on another way to detect it. Maybe it can switch on if it's running from a git repo or not. (If running in git repo then calculate the version, otherwise use hardcoded version.)

@josephharrington
Copy link
Contributor

In case it was not clear from my above comment, my vote is to keep auto-versioning (not switch to manually-updated, hardcoded version numbers).

shriganeshs-zz pushed a commit that referenced this issue May 31, 2017
This fixes issue #348
shriganeshs-zz pushed a commit that referenced this issue May 31, 2017
This fixes issue #348
shriganeshs-zz pushed a commit that referenced this issue May 31, 2017
This fixes issue #348
shriganeshs-zz pushed a commit that referenced this issue May 31, 2017
This fixes issue #348
shriganeshs-zz pushed a commit that referenced this issue May 31, 2017
This is an enhancement to enable rpm building with autogenerated
version.
This address #348.
shriganeshs-zz pushed a commit that referenced this issue May 31, 2017
This is an enhancement to enable rpm building with autogenerated
version.
This address #348.
shriganeshs-zz pushed a commit that referenced this issue May 31, 2017
This is an enhancement to enable rpm building with autogenerated
version.
This address #348.
@shriganeshs-zz
Copy link
Author

Fixed in #352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants