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

Is it possible to create wheel from actual master branch? #2534

Closed
decodeais opened this issue Feb 25, 2024 · 10 comments
Closed

Is it possible to create wheel from actual master branch? #2534

decodeais opened this issue Feb 25, 2024 · 10 comments

Comments

@decodeais
Copy link
Contributor

Distributor ID: Linuxmint
Description: Linux Mint 21
Python 3.11.5
wxPython-4.2.2a1-cp311-cp311-linux_x86_64.whl

I made a little pull request, you accepted and merged. I wanted to test it. I tried to build a wheel but I allways get this error message:

checking for GTK+ - version >= 3.0.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occurred. This usually means GTK+ is incorrectly installed.
configure: error: 
The development files for GTK+ were not found. For GTK+ 2, please
ensure that pkg-config is in the path and that gtk+-2.0.pc is
installed. For GTK+ 1.2 please check that gtk-config is in the path,
and that the version is 1.2.3 or above. Also check that the
libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
--libs' are in the LD_LIBRARY_PATH or equivalent.`

I used this script:

#!/bin/bash

# Update package lists
sudo apt-get update

# Install required packages
sudo apt install -y dpkg-dev build-essential python3-dev freeglut3-dev libgl1-mesa-dev \
libglu1-mesa-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libjpeg-dev libnotify-dev \
libpng-dev libsdl2-dev libsm-dev libtiff-dev libwebkit2gtk-4.0-dev libxtst-dev \
libgstreamer1.0-dev libjpeg-dev libtiff-dev libsm-dev

# Create directory for building
mkdir -p ~/WheelBuild

# Change directory to the build directory
cd ~/WheelBuild

# Create and activate virtual environment
python3 -m venv WheelBuilder_py
source WheelBuilder_py/bin/activate

# Upgrade pip and install required Python packages
pip install -U pip six wheel setuptools sip requests

# Clone wxPython repository
git clone https://github.com/wxWidgets/Phoenix.git --branch master
cd Phoenix
git submodule init
git submodule update
git submodule update --init --recursive

# Build wxPython wheel
python build.py build bdist_wheel

Can you give me a hint. I have searched everywhere. May be it is a stupid mistake
or its impossible now. In this case I would have to wait for your next release.

@swt2c
Copy link
Collaborator

swt2c commented Feb 26, 2024

What you're doing seems like it should work. The build process is looking for files that are installed by libgtk-3-dev and you seem to have that installed. You'll have to check config.log like the error message says, to see what might be going wrong.

@decodeais
Copy link
Contributor Author

I only get a 3 MB short form Wheel with the Python part. I have used this script on a raspberry too, with the same result.

@Metallicow
Copy link
Contributor

Answer: Technically you could create a wheel file(pre-built binary package format) for any branch any where, if you spent the time to do diagnostics on it(object). You just might have to do the work yourself....

@Metallicow
Copy link
Contributor

Metallicow commented Feb 26, 2024

For the record, The timed build of wxPy on RaspberryPi was like 11 hour-ish. Now you can build it yourself this way is preferred, but lets say I have 1million folks needing the wheel was like, umm ya I cannot do that. When I uploaded my rpy wheel to github it gave me some sort of bullshit that it could not do over 100MB upload 'If I Recall Correctly'(IIRC).

What I did was take the pre-built wheel and divide it with 7-zip into 2 separate files so I could bypass the GitHub upload limit. Besides this there is nothing different in the combined installed file, besides taking the time to recombine the two files.

@Metallicow
Copy link
Contributor

Metallicow commented Feb 26, 2024

I would +1 to Robin if he did this access for Qualified(NOT certified) OS Builds from select folks.

This is also a big problem why folks ask for Raspbian/etc any other linux distro. There are NO Dedicated builders. Point said.

@decodeais
Copy link
Contributor Author

In this moment I succeeded to build one wheel. Firrst I tried on Linux MInt, then on Raspian and than I tried with another Linux PC with Python3.10. Now I see the script is ok, a have only to upgrade python now.

@Metallicow
Copy link
Contributor

My best advice to you as a linux user is to record your build info/steps somewhere as I cannot do this myself(maybe a github repo), and it will help you more and others in the future if you do. Some folks are dumbasses and forget everything. These short notes should guide them thru that process again... hopefully :)

@decodeais
Copy link
Contributor Author

I am such a dumbasses, so I do everything by script. If it works I will give the script to the people i try to help now. I hope I get it working.

@Metallicow
Copy link
Contributor

My reply is that scripts help most people on the C/C++ to get thing working.
I've used Python for years, and don't recall any situation where a noob might have be called a "dumbass". Don't take this as an insult, It most times means the user is new and doesn't quite understand the logic or command.

You are tying well so far and haven't resulted in any weird failures yet.
Acually building the Wheel is sometimes the hardest part. Document your 'build commands'

By the way, Python isn't a scripting language completely, it is a COMMAND Language. See MicroPython differences,

A script is like me telling you a comedy, or an idiom.
A command is like me telling you to go to war.
You just do it. But the choice is yours.

@decodeais
Copy link
Contributor Author

This script worked for me. You are right, the interpreter has so much interaction with the OS that it could not be safe,but it may be a good starting point for pc and raspi:

#!/bin/bash
# export PATH="$HOME/.local/bin:$PATH"

export DOXYGEN=/usr/bin/doxygen # for Raspian we must use the internal dxygen
# Update package lists
sudo apt-get update
sudo apt install doxygen

sudo apt install -y dpkg-dev build-essential python3-dev freeglut3-dev libgl1-mesa-dev \
libglu1-mesa-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libjpeg-dev libnotify-dev \
libpng-dev libsdl2-dev libsm-dev libtiff-dev libwebkit2gtk-4.0-dev libxtst-dev \
libgstreamer1.0-dev libjpeg-dev libtiff-dev libsm-dev

# Create directory for building
mkdir -p ~/WheelBuild311

# Change directory to the build directory
cd ~/WheelBuild311

# Create and activate virtual environment
python3.11 -m venv WheelBuilder311_py
source ~/WheelBuild311/WheelBuilder311_py/bin/activate

#python3.11 -m venv myenv311

# Upgrade pip and install required Python packages
pip install -U pip six wheel setuptools sip requests

# Clone Phoenix repository
git clone https://github.com/wxWidgets/Phoenix.git --branch master
cd Phoenix
git submodule init
git submodule update
git submodule update --init --recursive

# Build Phoenix
python build.py dox etg --nodoc sip build bdist_wheel
#python build.py build bdist_wheel

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

3 participants