{"id":13509536,"url":"https://github.com/wxWidgets/Phoenix","last_synced_at":"2025-03-30T13:32:33.566Z","repository":{"id":3982281,"uuid":"5078061","full_name":"wxWidgets/Phoenix","owner":"wxWidgets","description":"wxPython's Project Phoenix.  A new implementation of wxPython, better, stronger, faster than he was before.","archived":false,"fork":false,"pushed_at":"2024-10-15T01:37:41.000Z","size":46384,"stargazers_count":2320,"open_issues_count":626,"forks_count":518,"subscribers_count":104,"default_branch":"master","last_synced_at":"2024-10-31T13:04:17.548Z","etag":null,"topics":["awesome","cross-platform","gui","gui-framework","gui-toolkit","linux","macosx","python","windows","wxpython","wxwidgets"],"latest_commit_sha":null,"homepage":"http://wxpython.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wxWidgets.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-07-17T06:22:25.000Z","updated_at":"2024-10-27T08:35:46.000Z","dependencies_parsed_at":"2024-05-18T02:32:05.276Z","dependency_job_id":"e0230fd3-1a0c-4e25-8c5f-8e6aaac6ccd0","html_url":"https://github.com/wxWidgets/Phoenix","commit_stats":{"total_commits":4652,"total_committers":135,"mean_commits":34.45925925925926,"dds":0.2637575236457438,"last_synced_commit":"37b420da5de86d71a7962338e75b7a5f234e8d90"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wxWidgets%2FPhoenix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wxWidgets%2FPhoenix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wxWidgets%2FPhoenix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wxWidgets%2FPhoenix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wxWidgets","download_url":"https://codeload.github.com/wxWidgets/Phoenix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222552913,"owners_count":17002160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awesome","cross-platform","gui","gui-framework","gui-toolkit","linux","macosx","python","windows","wxpython","wxwidgets"],"created_at":"2024-08-01T02:01:09.189Z","updated_at":"2025-03-30T13:32:26.302Z","avatar_url":"https://github.com/wxWidgets.png","language":"Python","readme":"=========================\nwxPython Project Phoenix\n=========================\n\n.. image:: demo/bitmaps/splash.png\n   :align: center\n\n\nIntroduction\n------------\n\nWelcome to wxPython's Project Phoenix! Phoenix is the improved next-generation\nwxPython, \"better, stronger, faster than he was before.\" This new\nimplementation is focused on improving speed, maintainability and\nextensibility. Just like \"Classic\" wxPython, Phoenix wraps the wxWidgets C++\ntoolkit and provides access to the user interface portions of the wxWidgets\nAPI, enabling Python applications to have a native GUI on Windows, Macs or\nUnix systems, with a native look and feel and requiring very little (if any)\nplatform specific code.\n\n.. note::\n    This document is primarily intended for those who will be working on\n    wxPython, or at least building with the source code fetched directly from\n    GitHub. If that's not you then please refer to the instructions at the\n    `wxPython website \u003chttps://wxpython.org/pages/downloads/\u003e`_ about how to get\n    the current release of wxPython for your platform and chosen Python\n    environment.\n\n.. contents:: **Contents**\n\n\nDevelopment at GitHub.com\n-----------------------------\n\nDevelopment of wxPython is done with git, using\nhttps://github.com/wxWidgets/Phoenix as the main development site.\n\nCurrently (September, 2024), only 2 developers (@swt2c, @RobinD42) can merge\npull requests, or assign others to review pull requests.\n\n\nHow to build wxPython Phoenix\n-----------------------------\n\nFirst of all, this README is intended primarily for those who want to build\nwxPython from a workspace checked out from the wxPython Phoenix repository. If\nyou are not making changes to wxPython, or needing to build it for some\nunsupported compiler or some other hardware architecture, then you probably do\nnot need to put yourself through the pain for building in this way. It's a\ncomplicated build, and can sometimes be confusing even for the experts.\nInstead, if the binaries available at PyPI are not what you need then you can\nuse pip to build from the released source archives, or from the source archives\ncreated in the pre-release snapshot builds. See the notes about it at:\n\n* https://wxpython.org/pages/downloads/\n* https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip\n\n\nNext, review the section below about prerequisites.\n\nAll aspects of the wxPython Phoenix build are managed through a series of\ncommands provided by the build.py script. There is also a setup.py script\navailable for builds using setuptools.  The setup.py script assumes that all of\nthe code generation steps have already been performed, and so it is suitable\nfor use when building from a source snapshot tarball or when using pip. The\nsetup.py script will delegate to build.py for the actual build, and build.py\nwill delegate to setup.py when using pip or building a wheel.\n\nUsing the build.py script allows for greater control over the build process\nthan setup.py does, including commands for performing the various\ncode-generation steps. So developers working on Phoenix itself or building\nfrom a Git checkout, instead of a source snapshot tarball, should be using\nthe build.py script. The build.py script provides a fairly simple\ncommand-line interface consisting of commands and options. To see the full\nlist run ``python build.py --help``. The most important commands are listed\nbelow.\n\n**Windows Users NOTE:** If you are building Phoenix on Windows and have a\nnon-English language installation of Microsoft Visual Studio then you may\nneed to set the code page in your console window in order to avoid Unicode\ndecoding errors. For example::\n\n    chcp 1252\n    python build.py \u003cbuild commands\u003e...\n\nIn addition, some tasks within the build currently expect to be able to use\nCygwin on Windows (https://www.cygwin.com/) to do its work. If you have\nCygwin installed in one of the default locations (c:\\\\cygwin or c:\\\\cygwin64)\nthen all is well. If you have it installed somewhere else then you can set\nCYGWIN_BASE in the environment and the build tool will use that for the base\ndir.\n\nOn the other hand, if you just want to do a standard setuptools-style build\nusing setup.py and are using a full source tarball, then you can stop reading\nat this point. If you want to build from a source repository checkout, or\nneed to make changes and/or to regenerate some of the generated source files,\nthen please continue reading.\n\n\nBuilding wxWidgets\n------------------\n\nSince build.py will, by default, build both wxWidgets and Phoenix you will\nneed the wxWidgets code as well. The source tarballs already include both\nwxWidgets and the Phoenix source code, so if you are getting your copy of the\nsource code that way then you are all set. If you are fetching it from GitHub\nyou will need to do an additional step. The git repository is set up to bring\nin the wxWidgets code as a git \"submodule\" so after cloning the Phoenix\nrepository, you can get the wxWidgets source with these commands::\n\n  $ git submodule update --init --recursive\n\nThis will clone the wxWidgets repo into: ``Phoenix/ext/wxWidgets``. Once the\nsubmodule is updated, the build script should be able to build wxWidgets.\n\nIf you would rather use an already built and installed wxWidgets then that is\npossible as well by changing some options, see ``python build.py --help`` for\ndetails. However be aware that doing so will require a wxWidgets that is\n**very** close to the same age as the Phoenix code, at least for the\nunreleased preview snapshots. In other words, the wxWidgets build should use\ncode from the wxWidgets source repository within a few days of when the\nPhoenix code was checked out. Currently the master branch of Phoenix is\ntracking the master branch of wxWidgets.\n\nOn the other hand, it is probably best to just let wxPython build and bundle\nwxWidgets. The build tools will by default build wxWidgets in a way that\nallows it to be bundled with the wxPython extension modules as part of the\nwxPython package, meaning it can peacefully coexist with any wxWidgets\nlibraries you may already have installed. This bundling of the wx shared\nlibraries works on Windows, OSX and Linux, and probably any other unix-like\nsystem using shared libraries based on the ELF standard. The libraries are\nbuilt in such a way that they are relocatable, meaning that they do not have\nto be in a fixed location on the filesystem in order to be found by the\nwxPython extension modules. This also means that you can do things like use\n``pip`` to install a wxPython wheel in one or more virtual environments, move\nthe wx package to a versioned folder, or even move it into your own project\nif desired, all without needing to rebuild the binaries. (Assuming that\ncompatible Pythons are being used in all cases of course.)\n\nThe build phase of the build.py script will copy the results of the wxWidgets\nand Phoenix builds into the wx folder in the Phoenix source tree. This will\nallow you to run and test Phoenix directly from the source tree without\ninstalling it, if desired. You just need to set ``PYTHONPATH`` appropriately,\nor you can use ``python setup.py develop`` or ``pip install -e .`` to install\nan .egg-link file in your current Python site-packages folder that will point\nto the folder where you built wxPython Phoenix. When you are finished testing\nyou can then use the install or one of the bdist commands like you normally\nwould for other Python packages.\n\n\n\nImportant build.py commands\n---------------------------\n\nThe following ``build.py`` commands are required to be able to build Phoenix\nfrom scratch. In other words, from a pristine source tree with none of the\ngenerated code present yet. They can be run individually or you can specify\nall of them on a single command line, in the order given. Once a command has\nsucceeded in one run of build.py there is no need to run that command again in\na later run, unless you've changed something which that command has the\nresponsibility to process. Many of the commands require the results of the\nearlier commands, so at least the first time you run the build you will need\nto use all 4 of the commands (or their equivalents for composite commands) in\nthe given order.\n\n* **dox**: Builds the XML files from the wxWidgets documentation source,\n  which will be used as input for the etg command.\n\n* **etg**: Extracts information from the dox XML files, runs hand-written\n  tweaker code on the extracted data structures, and runs various generators\n  on the result to produce code for the next steps. The code being run for\n  each item in this step is located in the etg folder in the Phoenix source\n  tree.\n\n* **sip**: This command processes the files generated in the etg command\n  and produces the C++ code that will become the Python extension modules for\n  wxPython Phoenix.\n\n* **build**: Build both wxWidgets and wxPython. There are additional\n  commands if you want to build just one or the other. The results will be\n  put in the Phoenix/wx folder, and can be used from there without\n  installation if desired, by setting PYTHONPATH so the Phoenix/wx package\n  dir is found by Python.\n\nSome other useful commands and options are:\n\n* **clean**: Clean up the build products produced by prior runs of\n  build.py. There are additional clean commands that will let you clean up\n  just portions of the build if needed.\n\n* **touch**: Updates the timestamp on all of the etg scripts, so they will\n  be forced to be run in the next build. This is useful when a change has\n  been made to the wxWidgets documentation that needs to be propagated\n  through the build since the etg command doesn't yet do full dependency\n  checking of the input.\n\n* **M.N**: This is the Major.Minor version number of the Python that the\n  extension modules will be built for, such as \"3.11\". This allows you to run\n  build.py with a different Python than what you are building for, which is\n  handy for things like buildbots running in a virtualenv for one Python\n  that need to be able to run builds for other versions too.\n\n  If build.py is not able to find the correct Python given the M.N on the\n  command line then you can specify the full path to the python executable you\n  want to use with the ``--python`` option.\n\n* **test**: Runs all of Phoenix's unittests.\n\n* **--nodoc**: This option turns off the sphinx generator when running the\n  etg scripts. If you don't plan on generating the documentation then this\n  will speed up the processing of the etg command.\n\nPlease see the output of ``python build.py --help`` for information about\ncommands and options not mentioned here. And, as always, if there is any\ndiscrepancy between this document and the source code in the build.py script,\nthen the source code is correct. ;-)\n\nThe build.py script will download doxygen, sip and waf for your platform as\nneeded if they are not already in your Phoenix/bin folder. If prebuilt\nversions of these tools are not available for your platform then build.py\nwill bail out with an error message. To continue with the build you will need\nto acquire copies of the tool that will work on your platform and can then\ntell build.py where to find it using an environment variable, as described in\nthe error message.\n\n\nExample build command-lines\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo do a complete build from a totally clean git workspace, you will\nneed to use several of the commands listed above.  For example::\n\n    python build.py dox etg --nodoc sip build\n\nSubsequent builds can leave out some of the commands if there were no\nchanges which would require those commands to be run again.  For\nexample, if you wanted to just rebuild the Phoenix extension modules\nyou could do this::\n\n    python build.py build_py\n\nIf you've changed one of the etg files and need to regenerate and\nrebuild the source affected by that change, then you can use a command\nlike this::\n\n    python build.py etg --nodoc sip build build_py\n\n\n\nProject directory structure\n---------------------------\n\nThere are a lot of subfolders in this directory, here is a brief\nexplanation to help a newbie find their way around.\n\n* **build**: Intermediate files produced by the build process are stored\n  here. This folder should not be committed to a source repository.\n\n* **buildtools**: This is a Python package containing modules that are used\n  from build.py and setup.py and which assist with configuring and running\n  the build.\n\n* **etg**: This is where the \"Extractor-Tweaker-Generator\" scripts are stored.\n  These scripts are invoked by the build and they will read the XML files\n  produced by Doxygen and will produce interface definition files for SIP.\n\n* **etgtools**: This Python package contains modules which assist with the\n  parsing of the XML files, tweaking the collection of objects produced by\n  the parser, and also the backend generation of code or documentation.\n\n* **ext**: This folder holds the source for external projects used by\n  Phoenix, (currently just wxWidgets) as git submodules. This allows Phoenix\n  to use a specific revision of the code in the other projects and not depend\n  on the developer fetching the correct version of the code on their own.\n\n  When you first checkout the Phoenix source using git you will need to tell\n  git to also fetch the submodules, like this::\n\n    cd Phoenix\n    git submodule init\n    git submodule update --recursive\n\n* **sip/gen**: The code (.sip files) produced by the ETG scripts is placed\n  in this folder.\n\n* **sip/cpp**: The code produced when running SIP is put in this folder. It\n  will be C++ source and header files, and also some extra files with\n  information about the source files produced, so the build knows what files\n  to compile.\n\n* **sip/siplib**: This is a copy of the SIP runtime library. We have our\n  own copy so it can be included with the wxPython build as an extension\n  module with a unique name (``wx.siplib``) and to not require a runtime\n  dependency on SIP being installed on the target system. 3rd party\n  extensions that want to integrate with wxPython should ensure that the\n  sip.h they ``#include`` is the one in this folder.\n\n* **src**: This folder is for any other source code (SIP, C++, Python, or\n  anything else) that is edited by hand instead of being generated by some\n  tool.\n\n* **wx**: This is the top of the wxPython package. For an in-place build the\n  extension modules and any associated files will be put into this folder.\n  Subfolders contain pure-python subpackages of the wx package, such as\n  wx.lib, etc.\n\n\n\nNaming of files\n---------------\n\nTo help keep things a little easier when looking for things that need to be\nworked on, the file names in the Phoenix project will mirror the names of the\nfiles in the wxWidgets interface headers folder. For example, if there is a\n``interface/wx/FOO.h`` and we are processing the XML produced for that file\nthen the ETG script for the classes and other items will be named\n``etg/FOO.py`` and it will produce ``sip/gen/FOO.sip``, unit tests will be in\n``unittests/test_FOO.py``, and so on.\n\nIn most cases more than one ETG/SIP file will be used to create a single\nPython extension module. In those cases there will be one ETG script used to\nbring all the others together into the single extension module (by using the\nback-end generator's include feature for example.) The names of those scripts\nwill have a leading underscore, such as ``etg/_core.py``, and all the scripts\nthat are intended to be included in that extension module should specify that\nname in their MODULE variable.\n\n\nPrerequisites\n-------------\n\nThe following are some tips about what is required to build Phoenix for\nyourself. There are likely some other things that may not have been mentioned\nhere, if you find something else that should be mentioned then please submit\na PR for updating this document.\n\n\n**Windows**\n\nAll the source code needed for wxWidgets and wxPython Phoenix are included in\nthe wxWidgets and Phoenix source trees. In addition to a stock Python\ninstallation you will also need a copy Visual Studio 2015. It may be possible\nto build using Mingw32, but there will need to be some changes made to the\nbuild scripts to support that.\n\nYou may also want to get a copy of the MS SDK in order to have newer\ndefinitions of the Windows API.\n\nIf you want to build Phoenix with debug info then you will need to first\nbuild a debug version of Python, and then use that Python (python_d.exe) to\nbuild Phoenix.\n\n\n**Linux**\n\nOn Ubuntu the following development packages and their dependencies should be\ninstalled in order to build Phoenix. Other debian-like distros will probably\nalso have these or similarly named packages available, or newer versions of\nUbuntu might have evolved somewhat and require changes from this list.\nExtrapolate other package names accordingly for other linux distributions or\nother unixes.\n\n* dpkg-dev\n* build-essential\n* python3-dev\n* freeglut3-dev\n* libgl1-mesa-dev\n* libglu1-mesa-dev\n* libgstreamer-plugins-base1.0-dev\n* libgtk-3-dev\n* libjpeg-dev\n* libnotify-dev\n* libpng-dev\n* libsdl2-dev\n* libsm-dev\n* libtiff-dev\n* libwebkit2gtk-4.0-dev\n* libxtst-dev\n\nIf you are building for GTK2 then you'll also need these packages and\ntheir dependencies:\n\n* libgtk2.0-dev\n* libwebkitgtk-dev\n\n\nIf you use a custom built python in a non standard location, You need to\ncompile python with the --enable-shared option.\n\n**Mac OSX**\n\nLike the Windows platform all the source and libs you need for building\nPhoenix on OSX are included in the wxWidgets and Phoenix source trees, or\nby default on the system. In addition you will need to get the Xcode\ncompiler and SDKs, if you don't already have it, from\nhttps://developer.apple.com/ (free registration required). You should\nalso install the command line tools for your version of Xcode and OSX.\nThis can usually be done from within Xcode or via a separate installer\npackage.\n\nAlso like on Windows, using the same or similar compiler that was used to\nbuild Python usually helps things to work better and have a better chance\nfor success.\n\nIf all else fails it is not too hard to build Python yourself using\nwhatever Xcode you have installed, and then use that Python when building\nPhoenix.\n\n\nHelp and Helping\n----------------\n\nPlease use  `GitHub issues \u003chttps://github.com/wxWidgets/Phoenix/issues\u003e`_\nto report bugs.  Discussions about Python usage happen at\n`Discuss wxPython \u003chttps://discuss.wxpython.org/\u003e`_.\n\n\nLatest Snapshot Builds\n----------------------\n\nYou can find snapshots of the latest wxPython Phoenix build files,\nincluding source snapshots, wheels files for Windows and Mac, and etc. at:\nhttps://wxpython.org/Phoenix/snapshot-builds/.  These files are built at most\nonce per day, on any day that has had a commit to the master branch.\n\n\n.. image:: docs/phoenix-fire-md.png\n   :width: 100%\n","funding_links":[],"categories":["GUI Development","Python","awesome"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FwxWidgets%2FPhoenix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FwxWidgets%2FPhoenix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FwxWidgets%2FPhoenix/lists"}