Skip to content

Add pyproject direct dependency lint#19857

Open
JacobSzwejbka wants to merge 1 commit into
mainfrom
lint-pyproject-direct-url-deps
Open

Add pyproject direct dependency lint#19857
JacobSzwejbka wants to merge 1 commit into
mainfrom
lint-pyproject-direct-url-deps

Conversation

@JacobSzwejbka
Copy link
Copy Markdown
Contributor

Summary

Add a lightweight lint job to the existing Lint workflow that rejects direct URL dependencies in pyproject.toml project metadata, such as pkg @ git+https://.... PyPI rejects these when uploading wheels, even behind optional extras.

Also remove the existing Cortex-M cmsis_nn @ git+... optional dependency from main pyproject metadata. The backend-specific source/dev requirement remains in backends/cortex_m/requirements-cortex-m.txt.

Test plan

  • python3.11 scripts/lint_pyproject_dependencies.py pyproject.toml
  • python3.11 .ci/scripts/tests/test_lint_pyproject_dependencies.py
  • python3.11 -m py_compile scripts/lint_pyproject_dependencies.py .ci/scripts/tests/test_lint_pyproject_dependencies.py
  • git diff --check
  • verified the lint exits nonzero and emits a GitHub error annotation for a temporary bad pyproject containing bad @ git+https://example.com/repo.git@abc

Note: committed with --no-verify because this local environment cannot initialize lintrunner due to missing lintrunner_adapters; the focused checks above passed.

Authored with Claude.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 28, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19857

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 3 New Failures, 3 Unrelated Failures, 1 Unclassified Failure

As of commit 8de66e0 with merge base c8c04e4 (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

  • Check Labels / Check labels (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    RuntimeError: GraphQL query

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 28, 2026
@JacobSzwejbka
Copy link
Copy Markdown
Contributor Author

cc @Erik-Lundell

@JacobSzwejbka JacobSzwejbka force-pushed the lint-pyproject-direct-url-deps branch from 9d8bf6f to 32f0571 Compare May 28, 2026 20:20
@mergennachin
Copy link
Copy Markdown
Contributor

For reference, this is a blocker for our pypi release

https://github.com/pytorch/test-infra/actions/runs/26598544666/job/78375864483

@JacobSzwejbka JacobSzwejbka force-pushed the lint-pyproject-direct-url-deps branch from 32f0571 to 8de66e0 Compare May 28, 2026 20:28
f"file={args.pyproject},line={violation.line},"
"title=Direct URL dependency in pyproject.toml::"
f"{violation.section} contains '{violation.dependency}'. "
"PyPI rejects direct URL dependencies in published package "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a dry-run publish? If yes, it might be catch-all for these issues.

Copy link
Copy Markdown
Contributor

@rascani rascani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @Erik-Lundell - we had to rollback the cmsis-nn package dep because direct git deps are blocked by pypi (even if they are optional). Is it possible to get a cmsis-nn pypi package published?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants