question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use of pbr breaks cx_freeze applications

See original GitHub issue

The given code:

_v = VersionInfo('mock').semantic_version()
__version__ = _v.release_string()
version_info = _v.version_tuple()

is not really friendly to frozen applications… also, I’d say, it adds a lot of logic under the hood to just to the version (besides adding having a runtime requirement to setuptools, which is usually just a setup time requirement), so, I’d like to check how feasible it’d be to revert it to just coding the __version__ and version_info directly into the source code – also, I’d say it makes it easier to know the current version by looking at the source code and makes the code clearer 😉

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:25 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, Dec 7, 2016

I’m generally in favor (+1). I don’t use the file-writing feature of setuptools_scm, but if that works for you, I think that approach alleviates a number of my concerns.

I see, thanks. Using setuptools_scm was my initial attempt to contribute to mock to solve this problem, but unfortunately I hit the problem of the version_info public variable and CHANGELOG generation mentioned at the beginning of the issue.

It must be resolved to something, which could perhaps fallback to a constant value like ‘unknown’ in cases where get_version() fails.

Sorry, I meant to use the current methods in a function, like this:

def get_version():
    import pkg_resources
    try:
        return pkg_resources.get_distribution('setuptools').version
    except Exception:
        return 'unknown'

And then users can get the version by calling setuptools.get_version() instead of setuptools.__version__.

0reactions
rbtcollinscommented, Mar 4, 2017

I’m closing this now, since we seem to all be of the understanding that cx_freeze is incompatible with some base packaging PEPs, and the onus is on that project to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions — cx_Freeze 6.13.0 documentation
cx_Freeze works on Windows, Mac and Linux, but on each platform it only makes an executable that runs on that platform. So if...
Read more >
cx_Freeze Documentation - Read the Docs
On Windows, you can build a simple installer containing all the files cx_Freeze includes for your application, by running the setup script as:....
Read more >
Qt for Python & cx_Freeze
cx_Freeze lets you freeze your Python application into executables. The supported platforms are Linux, macOS, Windows, FreeBSD, among others.
Read more >
Faq - PBR Brakes
Why would my mechanic advise me that my brake rotors should be turned or replaced? Should I replace my rotors instead? Should I...
Read more >
Packaging and Optimizing Complex Python Application with ...
cx_Freeze helps us to create a standalone application for your python scripts without any performance degradation and it works on all the platforms...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found