Skip to content
Snippets Groups Projects
  1. Nov 30, 2024
    • Matt Harbison's avatar
      tests: enforce the use of `from __future__ import annotations` · 662b08ac
      Matt Harbison authored
      A recent MR and a separate recently landed MR that extracted code to a new file
      overlooked this, so I think it's worth flagging to ensure consistency.  We don't
      enforce the import for empty files (like `__init__.py`).
      
      I'd rather this go into `import-checker.py`, but the import of interest only
      happens at the top of the file, and its `verify_modern_convention()` calls
      itself recursively as it transits the AST where the annotations might be.  After
      a few hours of hacking on trying to get it to enforce the import, but only if
      annotations are used in the module (we generally don't have or check annotations
      in test files, so don't need this import), I gave up and resorted to this.  It
      won't handle multi-line imports, but this isn't something I'd expect to change
      often, so this is good enough for now.
      662b08ac
    • Matt Harbison's avatar
      graft: trim an InputError message · 99615755
      Matt Harbison authored
      This goes all the way back to its introduction in 3c0d5016b2be.  There don't
      seem to be any i18n strings right now, nor any test coverage, but I suspect this
      was a mistake.  Smaller, more digestable files FTW.
      99615755
    • Matt Harbison's avatar
      graft: fix a few typos in doc comments · 0facc743
      Matt Harbison authored
      0facc743
    • Matt Harbison's avatar
      graft: fix interpolation in a ProgrammingError case · 1802d9af
      Matt Harbison authored
      The `action` is str, which can't be interpolated into bytes.  Fortunately,
      `ProgrammingError` allows a str to be passed.
      1802d9af
  2. Nov 27, 2024
  3. Nov 26, 2024
  4. Dec 02, 2024
    • Mitchell Kember's avatar
      rhg: avoid calculating copies for status --no-status · 53dc147b
      Mitchell Kember authored
      This changes how rhg status avoids printing copies with --no-status.
      Originally 668a871454e8 added a check right before printing copies.
      This changes it to match Python and check it earlier by defining
      `list_copies = ... && !no_status`. This makes no difference now, but
      when we implement --rev --rev --copies it will ensure we don't do
      wasteful copy tracing when it's not going to be printed.
      53dc147b
  5. Nov 25, 2024
  6. Nov 30, 2024
  7. Nov 28, 2024
  8. Nov 20, 2024
  9. Nov 19, 2024
    • Pierre-Yves David's avatar
      graft: split the argument processing from the grafting · 5ab77b93
      Pierre-Yves David authored
      This starts splitting the two logic more cleanly and avoid one spilling in the
      other. This will be useful to introduce more way to do the grafting, e.g. "in
      memory".
      
      For now, there is still a lot spilling from one to another, but this will get
      cleaned over time.
      5ab77b93
    • Pierre-Yves David's avatar
      commands: create a "mercurial.cmd_impls" module to host graft · f2fc0a91
      Pierre-Yves David authored
      The "mercurial.commands" have been overweight for a while. We create a namespace dedicated to host smaller modules containing code revelant to a specific command. This should result in more isolated snd manageable module.
      
      We start with moving the code for "hg graft" in "mercurial.cmd_impls.graft"
      before doing more work on it. Since that code was about 5% of "commands.py" this seems like a success.
      f2fc0a91
  10. Nov 28, 2024
  11. Nov 27, 2024
    • Matt Harbison's avatar
      run-tests: disable caching of the wheels when installing test Mercurial · a782fb58
      Matt Harbison authored
      It seems like this command doesn't currently cause the wheels to be cached, but
      since I already had to prevent `pip` from caching when building wheels in
      1a09563a615c, and also disable it in a test in 30b5dc517ec2, let's just be
      explicit that we don't want caching, in case the default behavior changes.
      a782fb58
    • Matt Harbison's avatar
      tests: use `--no-cache-dir` with `pip` · 519a997b
      Matt Harbison authored
      After 1a09563a615c, there's one more wheel that gets cached in the user's pip
      cache in the macOS CI runner.  The wheel corresponds to the version being used
      for the tests, but it doesn't get cached until the 3rd or 4th test shard is run,
      so it's not an issue with installing to run the tests.  This seems to eliminate
      that.
      
      This doesn't seem to be an issue on Windows or Linux in my setup.  Windows not
      being affected is likely because we set `$USERPROFILE` to redirect the home
      directory to `$TESTTMP` when running tests, since 08fd76a553c9.  (When checking
      with `"$PYTHON" -m pip cache dir`, it points to `$TESTTMP/pip/cache`.)  We do
      also set `$HOME` to this same location when running posix tests, but I can't
      tell what's going on locally in Linux, because running `pip` directly in the *.t
      explodes, and `"$PYTHON" -m pip --version` prints `pip 9.0.1 from /usr/lib/python3/dist-packages`,
      so that's likely before caching was enabled[1].  Running `python3.8 -m pip --version`
      locally outside of the *.t (the same version used to invoke the test runner), prints
      `pip 24.2 from /home/mharbison/.local/lib/python3.8/site-packages/pip (python 3.8)`.
      
      In CI, both macOS and Linux print a modern version of `pip`, and list the cache
      as being under `$TESTTMP`, but then it doesn't end up there on macOS.  No idea
      if it is a pip bug, or what.  But let's be explict and disable caching.
      
      [1] https://github.com/pypa/pip/blob/fe0925b3c00bf8956a0d33408df692ac364217d4/docs/html/topics/caching.md?plain=1#L37
      519a997b
  12. Oct 23, 2024
  13. Oct 24, 2024
  14. Nov 23, 2024
  15. Oct 24, 2024
  16. Nov 23, 2024
  17. Oct 24, 2024
  18. Nov 23, 2024
  19. Oct 23, 2024
  20. Nov 27, 2024
    • Matt Harbison's avatar
      ci: disable caching of the wheels that get built to save space · 1a09563a
      Matt Harbison authored
      I had a pile of these one-shot wheels cached on the mac, taking about 1.2G of
      space from the few weeks we've been building wheels to test, and with the few
      times the macOS tests were actually run.  There's not much point in caching
      these, since the tests run from a wheel file the tests are force fed.  There is
      still an issue with one wheel from the tests being cached (probably on install),
      but that's 1/6 of the original problem.
      
      I'm putting this in the `pyproject.toml` because I think that's where we should
      have all of the `cibuildwheel` config collected.  There's a concurrent effort to
      modernize `setup.py` and use this file more, so I'll hold off on pushing most of
      the config in here for now.  But this applies the setting to all OSes, as well
      as when run through either CI or the individual buid scripts, so I think this is
      clearly the right way to go.
      
      Note that the docs for `cibuildwheel` talks about the intention to move from
      `pip` to `build` some day.  This config only covers the former, so the other
      config example[1] with the latter may be needed at some point.  But I don't see
      an obvious option for that tool, so we'll cross that bridge when we come to it.
      
      [1] https://cibuildwheel.pypa.io/en/v2.22.0/options/#examples_6
      1a09563a
  21. Oct 21, 2024
  22. Nov 21, 2024
    • Matt Harbison's avatar
      setup: require TLS 1.2 support from the Python interpreter (BC) · a820a7a1
      Matt Harbison authored
      Before it was optional, and either 1.1 or 1.2 was sufficient.  Now that the
      default minimum is 1.2, it needs to be present to work out of the box.
      
      The code here is more convoluted than the corresponding checks in `sslutil.py`,
      but I'm leaving it alone because it can all be simplified when py38 is dropped.
      a820a7a1
    • Matt Harbison's avatar
      run-tests: refactor the HGPORT handling code to use a constant for the max val · d49144a1
      Matt Harbison authored
      Simple enough, and then we don't need comments to cross-reference other areas of
      code that need to be kept in sync.  Since the `_getreplacements()` list is now
      partially dynamically generated and needed to change anyway, also move the one
      line that was being appended separately to the list for some reason, for clarity.
      d49144a1
  23. Nov 18, 2024
  24. Nov 04, 2024
    • Raphaël Gomès's avatar
      rust: remove `atty` dependency · 56e8841a
      Raphaël Gomès authored
      It is fully replaced with the now stable `std::io::IsTerminal` trait.
      
      This was the last dependency flagged as a warning by `cargo audit`,
      aside from `cpython` which we know about all too well: the plan is to
      transition to PyO3 soon-ish.
      56e8841a
Loading