Skip to content
Snippets Groups Projects
  1. Nov 23, 2023
  2. Nov 20, 2023
  3. Dec 22, 2023
  4. Jan 11, 2024
  5. Jan 03, 2024
    • Georges Racinet's avatar
      pycompat: fix bytestr(bytes) in Python 3.11 · f0e7d51b
      Georges Racinet authored
      In Python 3.10, the `bytes` type itself does not have a `__bytes__`
      attribute, but it does in 3.11. Yet `bytes(bytes)` does not give
      the wished output, so we have to add an exceptional case.
      
      The added case in the doctest reproduces the problem with Python 3.11.
      
      Impact: error treatment in expressions such as `repo[b'invalid']` gets
      broken.
      f0e7d51b
  6. Jan 08, 2024
    • Anton Shestakov's avatar
      contrib: add a set of scripts to run pytype in Docker · 87bfd170
      Anton Shestakov authored
      Having a simple way to run pytype for developers can massively shorten
      development cycle. Using the same Docker image and scripts that we use on our
      CI guarantees that the result achieved locally will be very similar to (if not
      the same as) the output of our CI runners.
      
      Things to note: the Dockerfile needs to do a little dance around user
      permissions inside /home/ci-runner/ because:
      
      - on one hand, creating new files on the host (e.g. .pyi files inside .pytype/)
        should use host user's uid and gid
      
      - on the other hand, when we run the image as uid:gid of host user, it needs to
        be able to read/execute files inside the image that are owned by ci-runner
      
      Since local user's uid might be different from ci-runner's uid, we execute this
      very broad chmod command inside /home/ci-runner/, but then run the image as the
      host user's uid:gid.
      
      There might be a better way to do this.
      87bfd170
  7. Dec 18, 2023
  8. Jan 04, 2024
  9. Dec 19, 2023
  10. Dec 20, 2023
  11. Dec 19, 2023
  12. Dec 20, 2023
  13. Dec 19, 2023
  14. Dec 20, 2023
    • Pierre-Yves David's avatar
      lock: properly convert error to bytes · 81224afd
      Pierre-Yves David authored
      Flagged by pytype when a later changeset is applied moving typing comment to annotation.
      
      We fix this ahead of the annotation change to make sure pytype remains happy
      after the change.
      
      We have to do fairly crazy dance for pytype to be happy. This probably comes
      from the fact IOError.filename probably claims to be `str` while it is actually
      `bytes` if the filename raising that `IOError` is bytes.
      
      At the same time, `IOError.strerror` is consistently `str` and should be passed
      as `str` everywhere.
      81224afd
Loading