Skip to content
Snippets Groups Projects
  1. Mar 28, 2025
  2. Mar 24, 2025
  3. Mar 23, 2025
  4. Mar 20, 2025
  5. Mar 18, 2025
    • muxator's avatar
      blockmatcher: add type hints to four functions in BlockList. Fix a type error · cde4a42b
      muxator authored
      This commit adds type hints to the four functions that are involved in a Qt6
      crash detailed in #6023. In the process it becomes evident a type mismatch that
      always existed. The commit also fixes that one.
      
      This is the mismatch: scrollToPos() called setValue() with a float value.
      setValue() in turn emitted the pyqtSignal(int) valueChanged, but passing the
      float value instead.
      
      This was fine in Qt5, but would break in Qt6.
      
      This commit puts in place the type hints and rounds to int "value" as a
      preventive measure, that stays compatible with Qt5, and would not break under
      Qt6.
      
      The final fix for the crash will be put in place in the next commit.
      cde4a42b
  6. Mar 05, 2025
    • Matt Harbison's avatar
      packaging: adapt the macOS installer build to the core changes for PEP 517 · ae24d8b4
      Matt Harbison authored
      Mercurial no longer supports direct invocation of `setup.py`, and `make local`
      isn't equivalent to what was previously done.  The easiest workaround is to
      pip-install from source into the venv.
      
      I considered installing the wheel, but I'd rather not manually manage the
      version used via commits.  Additionally, rc wheels aren't installed from PyPI by
      default.  I also tried an editable install, but py2app wasn't able to find
      `hgext` or `mercurial`.
      ae24d8b4
  7. Feb 22, 2025
    • Matt Harbison's avatar
      packaging: adapt the Windows installer build to the core changes for PEP 517 · dabfd800
      Matt Harbison authored
      The one thing we're missing here is the generated index for the extensions help.
      That needs to be fixed in the hg build process, but there's also a bug since
      hg 843418dc0b1b (March 2020) that seems to cause the index to be ignored by
      py2exe altogether.  So let's not worry about that for now.
      
      There are also a few missing/added python packages by way of diffing `library.zip`
      against the 6.9 installation, but they seem harmless.
      
      The macOS installer still needs to be done.
      dabfd800
  8. Feb 21, 2025
  9. Mar 01, 2025
    • Matt Harbison's avatar
      packaging: bump py2exe to 0.11.1.1 · 91939ec9
      Matt Harbison authored
      This isn't the latest version, but the release notes for 0.12.0 talk about new
      APIs and deprecating `setup.py py2exe`.  That probably means overhauling both
      `setup.py` like was done for Mercurial this cycle, as well as the packaging
      code.  Let's kick that can down the road.
      
      In the meantime, this picks up important fixes like `sys.std{out,err}.write()`
      returning the number of bytes written (per python3) instead of None.
      91939ec9
  10. Dec 26, 2024
  11. Feb 28, 2025
    • Matt Harbison's avatar
      py3: drop redundant `u''` prefixes on string literals · abb35125
      Matt Harbison authored
      Strings are unicode on Python 3.  These were rewritten by `pyupgrade`.  See hg
      9db77d46de79.
      abb35125
    • Matt Harbison's avatar
      pyupgrade: drop `coding=UTF-8` comments · 92d0e180
      Matt Harbison authored
      PEP-3120[1] (Python 3.0 in 2007) says that UTF-8 is the default encoding.  That
      should be long enough ago that no reasonable editor would trip over this, and
      certainly any supported version of Python won't.  `msgfmt.py` was already UTF-8
      formatted.  See hg f19a3f1437f3.
      
      The comments were probably harmless, but as `pyupgrade` has no mechanism to
      disable this change, omitting this change makes it unusable as a code checking
      tool, and makes it a pain to use occasionally to upgrade the source (since these
      changes would need to be manually reverted).
      
      [1] https://peps.python.org/pep-3120/
      92d0e180
  12. Feb 27, 2025
  13. Jan 06, 2025
  14. Feb 28, 2025
  15. Feb 22, 2025
  16. Feb 21, 2025
    • Matt Harbison's avatar
      serve: refactor a function to help pytype · 1da8d88f
      Matt Harbison authored
      Somehow, upgrading to Python 3.11 to run pytype caused it to complain that:
      
          File "/home/mharbison/projects/mercurial/thg/tortoisehg/hgqt/serve.py", line 144,
              in _tempwebconf: No attribute 'write' on mercurial.config.config [attribute-error]
            In Union[mercurial.config.config, tortoisehg.util.wconfig._wconfig]
          Called from (traceback):
            line 130, in _cmdargs
      1da8d88f
  17. Dec 25, 2024
  18. Jan 26, 2025
  19. Jan 16, 2025
    • Matt Harbison's avatar
      packaging: conditionalize the macOS build script to support both Qt5 and Qt6 · a1332fdb
      Matt Harbison authored
      The version can be overridden by setting `QT_MAJOR` to 5 or 6 in the environment,
      but it tries to do the right thing by default.  I didn't check that all of the
      same libraries are in the app bundle and need to be removed that are in the Qt5
      app, but when skipping that section of post-build customizing, `codesign`
      reported that it wasn't signed properly.  It's just easier to run through it for
      now and re-sign at the end.
      
      Qt5 doesn't support arm64, and requires Rosetta to be installed to run it.
      Unfortunately, while python, py2app, and PyQt6 are all universal2 binaries, the
      libraries installed for Qt6 are thin binaries.  Maybe there's a way to download
      the wheels for both architectures and smash them together.  Perhaps with
      something like this:
      
        https://github.com/ronaldoussoren/py2app/issues/399#issuecomment-1709305758
      
      For now, we'll just have to build 2 things on two different machines.
      
      We might also have the opposite problem we had before with py2app being a
      universal binary, and defaulting to running the arm64 image on Apple Silicon- it
      will want to run the amd64 image on an Intel mac, and crash on startup if it was
      built for AS because the Qt6 libraries are the wrong architecture again.  But
      since I expect the Qt6 stuff to be less stable, let's not worry about removing
      the amd64 image when building on AS like we do the arm64 image with Qt5 builds.
      a1332fdb
    • Matt Harbison's avatar
      packaging: normalize the name of the requirements files for macOS builds · 8c082e3c
      Matt Harbison authored
      This will make it easier to switch the version of PyQt to use when building.
      The old file references in the generated file was manually updated.  There is a
      newer version of Qt5 on macOS, but it was crashing for me on launch when I tried
      it.
      8c082e3c
  20. Jan 15, 2025
  21. Jan 16, 2025
Loading