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

cx_Freeze should be installable from git revision #2660

Open
hbielenia opened this issue Nov 4, 2024 · 5 comments
Open

cx_Freeze should be installable from git revision #2660

hbielenia opened this issue Nov 4, 2024 · 5 comments
Milestone

Comments

@hbielenia
Copy link

Describe the bug
It appears that cx_Freeze cannot be correctly installed on Windows from git revision. The installation works correctly when using wheel from PyPI, but this cannot be guaranteed to be immutable. Also, it appears that all necessary files are already pre-built in the repository, so using a wheel doesn't have to be a hard requirement.

This issue is similar to #2392, but that's a bit convoluted thread with no clear answers. Eventually, it seems the OP there managed to resolve the issue, but also wasn't attempting an installation from git revision, so their issues were likely different.

To Reproduce
On a Windows system, clone the repository or download and unpack the ZIP archive that GitHub automatically creates for every commit. Mine was https://codeload.github.com/marcelotduarte/cx_Freeze/zip/a2474eab285634ff59f3768a506e6b13ae77715b.zip
Navigate to cloned/unpacked directory and execute python install -m . or python install -m .[dev]. Then, check the site-packages/cx_Freeze/bases (the exact location differs based on Python installation settings) - at most, it should contain __pycache__ and __init__.py, whereas some .exe files should also be present.

Expected behavior
site-packages/cx_Freeze/bases should have at least the same set of .exe files as when installing from pre-built wheel package.

Desktop:
Windows 10 x86_64, cx_Freeze version 7.2.4, Python 3.12

@marcelotduarte
Copy link
Owner

marcelotduarte commented Nov 4, 2024

The pre-built files work if you do not have the MS VC C compiler and use pip install -e. for development, debugging, etc.
To build your wheels, you should read this. For Windows, use of build or pip wheel also works.

@hbielenia
Copy link
Author

Thanks for prompt response :)

The prebuild files work if you do not have the MS VC C compiler and use pip install—e. for development, debugging, etc.

Ok, so I gather that editable install is the only way to use these prebuild binaries.

To build your wheels, you should read this. For Windows, use of build or pip wheel also works.

Yes, I believe this is what pip install (without -e) uses under the hood. Though it's worth mentioning that without compiler in place, this will not error out and happily produce a wheel that is installable, but broken.

@marcelotduarte
Copy link
Owner

execute python install -m . or python install -m .[dev]. Then, check the

Do you mean pip install -e .?

I believe this is what pip install (without -e) uses under the hood.

pip install, buids and install the package, bypassing the creation of a wheel.

But, back to the issue, I made a patch, can you test it? You can test with cloning it and also, can use:
pip install git+https://github.com/marcelotduarte/cx_Freeze.git@refs/pull/2681/head

@marcelotduarte marcelotduarte added this to the 7.3.0 milestone Nov 13, 2024
@hbielenia
Copy link
Author

execute python install -m . or python install -m .[dev]. Then, check the

Do you mean pip install -e .?

Oh gee, I was meant to write python -m pip install . but it looks like commands have coalesced in my mind... pip install -e . works, to be clear - it's the non-editable installation that doesn't.

pip install, buids and install the package, bypassing the creation of a wheel.

I'm not an expert on Python packaging (worked as a developer for several years but rarely had to package something) but my python -m pip install output has this:

Building wheels for collected packages: cx_Freeze
  Building wheel for cx_Freeze (pyproject.toml) ... done
  Created wheel for cx_Freeze: filename=cx_Freeze-7.3.0.dev0-cp312-cp312-win_amd64.whl size=2146017 sha256=e0cf855f11b6c30608963d637b5f355a1dbea5795fe2f9d507263c699bb52c93
  Stored in directory: C:\Users\Hubert\AppData\Local\Temp\pip-ephem-wheel-cache-4mzeresk\wheels\e7\30\21\ec28bdec843c7888ab855d3d7b043c7c598b7bc3a4f31957f8

Of course I admit the possibility that this is totally misleading.

But, back to the issue, I made a patch, can you test it? You can test with cloning it and also, can use: pip install git+https://github.com/marcelotduarte/cx_Freeze.git@refs/pull/2681/head

Tested it and it appears to solve the issue - python -m pip install . installs the package into site-packages complete with the prebuilt files, and -e flag doesn't seem required anymore 👍

@marcelotduarte
Copy link
Owner

I'm not an expert on Python packaging (worked as a developer for several years but rarely had to package something) but my python -m pip install output has this:

I forgot the PEP517, so the wheel has been in the intermediate phase for about 2 or 3 years.

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

No branches or pull requests

2 participants