Skip to content

Make install-requires/tests-require pyproject.toml-aware (closes #38)#39

Merged
thorwhalen merged 1 commit into
masterfrom
fix-38-pyproject-deps
Jun 5, 2026
Merged

Make install-requires/tests-require pyproject.toml-aware (closes #38)#39
thorwhalen merged 1 commit into
masterfrom
fix-38-pyproject-deps

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Summary

isee install-requires / isee tests-require — and therefore the
install-packages action's dependency-files path — only understood
setup.cfg, hard-failing on pyproject.toml-only repos with
RuntimeError: No file with name "setup.cfg" exist .... This silently broke CI
for any pyproject-only repo whose ci.yml still passed a .cfg.

Fixes #38.

What changed

  • isee/pip_utils.py — new _metadata_source() resolver: prefer
    pyproject.toml when it has a [project] table, otherwise fall back to
    setup.cfg.
    • install_requires[project].dependencies (else [options] install_requires).
    • tests_require[project.optional-dependencies] (first present of
      testing/test/tests/dev, overridable via test_extras; else
      [options] tests_require).
    • Empty deps → logged no-op (No <kind> packages to install); only a total
      absence of metadata raises, now with an actionable message.
    • New side-effect-free resolve_install_requires / resolve_tests_require
      expose resolution without invoking pip (and back the tests).
    • Legacy read_setup_config / extras_require / install_extras kept.
  • actions/install-packages/action.yml — the Install Dependencies step now
    triggers on *.toml as well as *.cfg; input description updated.
  • pyproject.tomltomli fallback dependency for Python 3.10 (tomllib
    is 3.11+).
  • tests/test_pip_utils.py — covers pyproject resolution, custom extras,
    empty-deps no-op, pyproject-preferred-over-cfg, cfg fallback when pyproject
    carries only tool config, and the clear error when neither file exists.

Testing

pytest tests/test_pip_utils.py → 9 passed. Full suite: only the 3
pre-existing local_cli --bind failures remain (unrelated to this change;
they also fail on master).

isee install-requires / tests-require (and the install-packages action's
dependency-files path) only understood setup.cfg, hard-failing on
pyproject.toml-only repos with 'No file with name setup.cfg'.

- pip_utils now resolves dependency metadata, preferring pyproject.toml
  [project] (dependencies / optional-dependencies) and falling back to
  setup.cfg ([options] install_requires / tests_require).
- Empty deps are a logged no-op; only a total absence of metadata raises,
  now with an actionable message.
- New resolve_install_requires/resolve_tests_require expose the resolution
  without pip side effects (and back the tests).
- install-packages action accepts .toml in dependency-files.
- tomli fallback dep for Python 3.10 (tomllib is 3.11+).

Closes #38
@thorwhalen thorwhalen merged commit 9a2b643 into master Jun 5, 2026
6 checks passed
@thorwhalen thorwhalen deleted the fix-38-pyproject-deps branch June 5, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install-requires / tests-require (and install-packages action) only support setup.cfg, not pyproject.toml

1 participant