- Jan 30, 2025
-
-
Matt Harbison authored
This is the current pytype used in the v2.1 CI images, but CI uses some flavor of Python 3.11.
-
Pierre-Yves David authored
This is a proposal to formalise the way we do typing and do more of it. The initial motivation to make progress is to help break the 100+ module cycle that is slowing pytype a lot.
-
Matt Harbison authored
-
- Jan 29, 2025
-
-
Pierre-Yves David authored
This canno hurt.
-
Pierre-Yves David authored
This is a bit shooting in the dark, but this probably does not hurt to apply the same helper as the `test-run-tests.t` file.
-
- Jan 30, 2025
-
-
Pierre Augier authored
-
- Jan 27, 2025
-
-
Pierre Augier authored
-
- Jan 30, 2025
-
-
Pierre Augier authored
-
- Jan 27, 2025
-
-
Pierre Augier authored
-
- Jan 29, 2025
-
-
Pierre Augier authored
Now that setuptools-scm is used, it is better to have a static MANIFEST.in file. From https://setuptools-scm.readthedocs.io: > Additionally setuptools-scm provides setuptools with a list of files that > are managed by the SCM (i.e. it automatically adds all the SCM-managed files to the sdist).
-
Matt Harbison authored
This is the current pytype used in the v2.1 CI images, but CI uses some flavor of Python 3.11.
-
Matt Harbison authored
-
- Jan 28, 2025
-
-
Matt Harbison authored
This is the current pytype used in the v2.1 CI images, but CI uses some flavor of Python 3.11.
-
Matt Harbison authored
-
- Nov 30, 2024
-
-
Pierre-Yves David authored
This is closer to real life situation.
-
Pierre-Yves David authored
This avoid doing read access at the same time as write access and abstract the read time. It consume "quite some" memory for large repository through. Doing this speedup the command on a mozilla try clone by about 15%, helping us to focus on processing time instead.
-
- Nov 29, 2024
-
-
Pierre-Yves David authored
Progress can take a signifiant time and that is not what we are measuring it. This can impact the benchmark result when the command is run in a terminal. (looking at how much time is consume is now possible, but a quest for another day)
-
- Nov 28, 2024
-
-
Pierre-Yves David authored
See inline documentation and next commit for details.
-
Pierre-Yves David authored
Strictly speaking we could also do that for v1, but that is old enough that I don't want to bother.
-
Pierre-Yves David authored
Seems more logical. We also take this as an opportunity to explicitly track bytes count in "v2" as relying on progress internal start is error prone.
-
Pierre-Yves David authored
We do the same things in multiple place and it is starting to itch.
-
- Jan 07, 2025
-
-
Matt Harbison authored
`flushcommands()` and a few other generators got a slightly modified return type after the pyupgrade series ending with 70a75d379daf. This fixes those, and grabs some other low and mid hanging fruit here. Note that there are possibly two bugs detected here- in the `inputstream` and `outputstream` classes, the `flush()` and `finish()` methods respectively have surprising issues. pytype flagged the latter when the return value was typed, but it surprisingly doesn't see the lack of `flush()` on the `Decoder` class. I wonder if either of these are the cause of the occasional odd-length string error I see in the `hg serve` output from time to time. In any event, punt those changes down the road for now, and mark with a TODO.
-
- Jan 13, 2025
-
-
Matt Harbison authored
This was low hanging fruit, and will point out an apparent programming bug. The arguments are left untyped for now, because the internal compressors and decompressors generally take a `Buffer` object, and return bytes. I've had issues around using `typing_extensions.Buffer` with pytype in the past, but also the identity classes return the argument unmodified, so that will break the type annotation. We'd probably need an instance check, and a cast if it's not bytes. Having to roll up all of the encoder and decoder types into a union type is a bit annoying, but the protocol class can't be used in the map because it then assumes that type will be instantiated. I also couldn't get it to work with a `TypeVar` bound to indicate that it's actually a subclass either. Oh well.
-
Matt Harbison authored
The generated type annotations around `filemap()` and `files()` were slightly modified by the pyupgrade series culminating in 70a75d379daf. This module is way more complicated than the other changes, but these weren't too bad to figure out. The typing caught a trivial issue in `sparse`- it was passing an empty data list to `addfile()` for the `ACTION_REMOVE` case, instead of a tuple or None. `merge.manifestmerge()` calls this function with None for the data, so 1) it has to be typed as optional, and 2) is safe to pass None in the sparse code.
-
Matt Harbison authored
This avoids printing the error with a `b''` prefix in the case of `ValueError`. The custom `ProgrammingError` class is special in that it won't do that, and can take either bytes or str. But there's no point in passing bytes when it is just going to decode to str at runtime anyway.
-
Matt Harbison authored
These are the easy/obvious/documented ones. We'll leave the harder ones for later.
-
Matt Harbison authored
This avoids printing the error with a `b''` prefix. The `CBORDecodeError` class subclasses `Exception`, not one of the usual error classes in `mercurial.error`.
-
Matt Harbison authored
These are the easy/obvious/documented ones. We'll leave the harder ones for later.
-
Matt Harbison authored
For some reason, these reverted from a specific type to something less useful after the changes that culminated in 70a75d379daf. (e.g. the `remotefilectx` method went from `Generator[remotefilectx, Any, None]` to `Generator[nothing, Any, None]`.) The previous typing for `merge.filemap` was `Generator[Tuple[Any, Tuple[Any, Any, Any]], Any, None]`, and decayed to `Generator[nothing, Any, None]`. I don't feel like unravelling the specific types here, so restore the equivalent of that.
-
- Jan 07, 2025
-
-
Matt Harbison authored
After the changes culminating in 70a75d379daf, pytype was able to detect these types better (typically changing from something like `Generator[Any, Any, None]` to `Generator[bytes, Any, None]`). Let's make these explicit so they don't disappear because of other changes.
-
- Jan 15, 2025
-
-
Pierre Augier authored
-
Pierre Augier authored
-
- Jan 14, 2025
-
-
Pierre Augier authored
-
- Jan 23, 2025
-
-
Pierre Augier authored
Direct calls of setup.py should not be used. There is no equivalent to setup.py clean with PEP 517 frontends. We have to delete what we want ourself.
-
- Jan 14, 2025
-
-
Pierre Augier authored
-
- Jan 13, 2025
-
-
Pierre Augier authored
-
Pierre Augier authored
-
- Jan 14, 2025
-
-
Matt Harbison authored
PyCharm was complaining about that the previous code was a statement with no effect. This avoids that warning, and hopefully also appeases whatever linter was complaining about an unused import.
-
- Jan 13, 2025
-
-
Matt Harbison authored
Even fewer complaints from PyCharm now.
-
Matt Harbison authored
That's how PyCharm was seeing it because of the default param, so it was flagging the callers that passed an int. Fewer yellow ticks are better (26 remain).
-