Conversation
bf5d8e9 to
3a8fcb4
Compare
| 'foo' | ||
| """ | ||
| return self[key] if key in self else default | ||
| return getattr(self, key) if hasattr(self, key) else default |
There was a problem hiding this comment.
linter suggests self.get(k, default) but that'll call itself
| return parsed_docstring | ||
|
|
||
| key = hash(doc_string) | ||
| key = str(hash(doc_string)) |
There was a problem hiding this comment.
mypy complains about a type mismatch for key since hash(...) returns an int but may be set to a 'args', i.e. string, later
| messages: Optional[Sequence[Union[Mapping[str, Any], Message]]] = None, | ||
| *, | ||
| stream: Literal[True] = True, | ||
| stream: Literal[False] = False, |
There was a problem hiding this comment.
This overload was incorrect since stream=True is also overloaded below
| async def create_blob(self, path: Union[str, Path]) -> str: | ||
| sha256sum = sha256() | ||
| with open(path, 'rb') as r: | ||
| async with await anyio.open_file(path, 'rb') as r: |
There was a problem hiding this comment.
should not use a blocking open in an async function
| - run: pipx install poetry | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} |
There was a problem hiding this comment.
Any reason for removing the matrix tests?
There was a problem hiding this comment.
This is replaced by hatch test --all which tests all configured python versions. I'm still debating whether this is better than matrix tests
There was a problem hiding this comment.
Seems like we can setup a matrix if needed in the pyproject.toml if needed: https://hatch.pypa.io/latest/tutorials/testing/overview/#all-environments
I think it makes sense to just define the versions we want tested in the toml
There was a problem hiding this comment.
That's already implemented and runs with --all option to hatch test however it is slightly slower since the Python versions are sequential rather than parallel, ~1m vs. ~35s
There was a problem hiding this comment.
Would parallelizing the tests themselves help? https://hatch.pypa.io/1.13/tutorials/testing/overview/#parallelize-test-execution
There was a problem hiding this comment.
No that option, which is also set, parallelizes tests in a pytest run, not between python versions
this change decouples project management from virtualenv management such that developers can use their favorite tools instead of being forced into poetry.
poetry 2.0 adds pep 621 support so updating pyproject.toml to be pep 621 compliant requires many of the changes necessary to use hatch while also having to manually maintain separate dependency groups for dev tools such as pytest and ruff
fix some linting issues found by newly enabled linters
'://'.join(scheme, hostport)withf'{scheme}://{hostport}'passstartswidthwithstartswith(tuple)contextlib.suppressinstead oftryexceptpassisinstancewithisinstance(tuple)ifelse