Skip to content

Commit

Permalink
Merge branch 'main' into update-setup-python-action
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri authored Mar 11, 2024
2 parents 5bb594c + c3dc91e commit b40a70b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: setuptools/tests/config/downloads/*.cfg
Expand Down
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[mypy]
# CI should test for all versions, local development gets hints for oldest supported
# Some upstream typeshed distutils stubs fixes are necessary before we can start testing on Python 3.12
python_version = 3.8
strict = False
warn_unused_ignores = True
Expand All @@ -8,6 +9,7 @@ explicit_package_bases = True
exclude = (?x)(
^build/
| ^.tox/
| ^.egg/
| ^pkg_resources/tests/data/my-test-package-source/setup.py$ # Duplicate module name
| ^.+?/(_vendor|extern)/ # Vendored
| ^setuptools/_distutils/ # Vendored
Expand Down
2 changes: 1 addition & 1 deletion pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3193,7 +3193,7 @@ def _find_adapter(registry, ob):
for t in types:
if t in registry:
return registry[t]
# _find_adapter would previously return None, and immediatly be called.
# _find_adapter would previously return None, and immediately be called.
# So we're raising a TypeError to keep backward compatibility if anyone depended on that behaviour.
raise TypeError(f"Could not find adapter for {registry} and {ob}")

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ testing =
# for tools/finalize.py
jaraco.develop >= 7.21; python_version >= "3.9" and sys_platform != "cygwin"
pytest-home >= 0.5
mypy==1.9 # pin mypy version so a new version doesn't suddenly cause the CI to fail
# No Python 3.11 dependencies require tomli, but needed for type-checking since we import it directly
tomli
# No Python 3.12 dependencies require importlib_metadata, but needed for type-checking since we import it directly
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ def _restore_install_lib(self):

if __name__ == '__main__':
# allow setup.py to run from another directory
# TODO: Use a proper conditonal statement here
# TODO: Use a proper conditional statement here
here and os.chdir(here) # type: ignore[func-returns-value]
dist = setuptools.setup(**setup_params)
2 changes: 1 addition & 1 deletion setuptools/_core_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _read_list_from_msg(msg: Message, field: str) -> Optional[List[str]]:


def _read_payload_from_msg(msg: Message) -> Optional[str]:
value = msg.get_payload().strip()
value = str(msg.get_payload()).strip()
if value == 'UNKNOWN' or not value:
return None
return value
Expand Down
3 changes: 1 addition & 2 deletions setuptools/command/editable_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,7 @@ def _simple_layout(
layout = {pkg: find_package_path(pkg, package_dir, project_dir) for pkg in packages}
if not layout:
return set(package_dir) in ({}, {""})
# TODO: has been fixed upstream, waiting for new mypy release https://github.com/python/typeshed/pull/11310
parent = os.path.commonpath(starmap(_parent_path, layout.items())) # type: ignore[call-overload]
parent = os.path.commonpath(starmap(_parent_path, layout.items()))
return all(
_path.same_path(Path(parent, *key.split('.')), value)
for key, value in layout.items()
Expand Down

0 comments on commit b40a70b

Please sign in to comment.