Conversation
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/6f544402-d9aa-4202-bf45-9f4847190fda Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
…rt setuptools 81+ Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/6f544402-d9aa-4202-bf45-9f4847190fda Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job for package installation
Fix editable install failure: migrate packaging metadata to PEP 621 (pyproject.toml)
Apr 27, 2026
There was a problem hiding this comment.
Pull request overview
Migrates FLAML’s packaging metadata to PEP 621 in pyproject.toml to fix pip install -e . failures caused by newer setuptools validating the presence of a compliant [project] table (including version via dynamic).
Changes:
- Add a full
[project]table inpyproject.toml, switch build backend tosetuptools.build_meta, and source version dynamically fromflaml/version.py. - Move package discovery and package-data configuration into
pyproject.toml(includingpy.typedand default JSON assets). - Simplify
setup.pyto a minimalsetuptools.setup()shim and addflaml/py.typedfor PEP 561.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pyproject.toml |
Adds PEP 621 metadata + dynamic version + setuptools package discovery/package-data to unblock editable installs. |
setup.py |
Reduces setup script to a stub now that metadata is in pyproject.toml. |
flaml/py.typed |
Adds PEP 561 marker file to ship typing information. |
jianglibigdata
approved these changes
Apr 27, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
thinkall
approved these changes
Apr 27, 2026
jianglibigdata
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setuptools 81.x (within the
<82pin) introduced a breaking validation: any[tool.setuptools.*]section inpyproject.tomlnow requires a valid[project]table with aversionfield. PR #1530 added[tool.setuptools.package-data]without a[project]table, causingpip install -e .to fail with:Changes
pyproject.toml— Full PEP 621 migration:setuptools.build_meta:__legacy__→setuptools.build_meta[project]table with all package metadata (name, description, readme, license, authors, classifiers, dependencies, optional-dependencies,requires-python)flaml/version.py— surfaced viadynamic = ["version"]+[tool.setuptools.dynamic][tool.setuptools.packages.find],[tool.setuptools.package-data](coverspy.typedandflaml.defaultJSON files)Programming Language :: Python :: 3.13classifierpandas>=1.1.4,<2.0.0; python_version<'3.10'condition (unreachable givenrequires-python = ">=3.10")setup.py— Reduced to a stub (setuptools.setup()) now that all metadata lives inpyproject.tomlflaml/py.typed— Added PEP 561 marker file (original intent of PR feat: add py.typed marker for PEP 561 compliance #1530)Original prompt
Fix the failing GitHub Actions job from https://github.com/microsoft/FLAML/actions/runs/24983041742/job/73149559247?pr=1530.
Failure details:
.github/workflows/python-package.yml)24983041742, job73149559247, PR1530Install packages and dependenciespip install -e .Relevant files observed at commit
cbd5e48ecf18834689836309ae8a44ee1274d235:.github/workflows/python-package.yml: install step upgradespip wheel "setuptools<82", then runspip install -e ., importsflaml, then runspip install -e .[test].pyproject.toml: contains[build-system]withrequires = ["setuptools>=64", "wheel"]andbuild-backend = "setuptools.build_meta:__legacy__", plus tool config. The CI error indicates the current PR/job state has a[project]table that is invalid because it lacks a requiredversionfield.Task:
pyproject.toml,setup.py, package version source such asflaml/__init__.py, and any recent PR changes if available).setup.py, use an appropriate PEP 621dynamic = ["version"]/[tool.setuptools.dynamic]configuration or otherwise ensure[project]includes a validversionmatching the existing package version strategy.pip install -e .andpip install -e .[test]can resolve/build under the workflow’s Python/setuptools constraints.Please open a pull request with the fix and include a concise explanation referencing the failing job and root cause.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The job is failing during
pip install -e .(editable install) because the build backend is trying to validate PEP 621 metadata and finds a[project]table without a requiredversionfield:This happens while pip is “Getting requirements to build editable”, i.e., before tests run. The workflow step that triggers it is in
.github/workflows/python-package.ymlat the “Install packages and dependencies” step (thepip install -e .line).Fix options (pick one)
Option A (recommended): Add
versionto[project]inpyproject.tomlIf your repo now contains a
[project]table (even implicitly via other changes), ensure it includes a valid version.Patch (example):
If you already manage the version in
setup.py, duplicate it here (or move fully to PEP 621 metadata to keep a single source of truth).Option B: Use setuptools “dynamic version” (if you don’t want to hardcode)
If your version is defined in Python (e.g.,
flaml/__init__.py), you can declare it dynamically:This satisfies the validator while keeping version in code.
Option C: Stop setuptools from trying to validate PEP 621 by using a non-legacy backend
Right now
pyproject.tomluses:If the repository has started relying on modern
pyprojectmetadata, switch to the modern backend:However, this doesn’t replace the need for valid metadata if you have a
[project]table—so typically you still need Option A or B.Why this fixes the CI
The workflow installs with editable mode (
pip install -e .). pip/setuptools validate thepyproject.tomlconfiguration early. Addingproject.version(or making it dynamic) satisfies the required field and allows installation to proceed, unblocking the rest of the job (dependency install + pytest).Minimal, safe change to unblock immediately
If you want the ...
This pull request was created from Copilot chat.