Skip to content

pdm.toml is not considered in pdm build if it is created on-the-fly in a pre_build hook #3615

@dualtob

Description

@dualtob

Describe the bug

If I automate the creation of the pdm.toml file for authentication in the pre_build hook via a script, it is not considered when calling pdm build for the first time (even though the creation was successful and the file exists). If I call pdm build again, it works fine as pdm.toml already exists. Is this intended?

To reproduce

  1. In the pyproject.toml, add:
[tool.pdm.scripts]
pre_build = "scripts/pre_build.py"
  1. Create scripts/pre_build.py where the pdm.toml is created
  2. Execute pdm build

Expected Behavior

pdm build should also consider pdm.toml files even if they are created on the fly during a pre hook.

Environment Information

PDM version: 2.25.6

Verbose Command Output

No response

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.

Metadata

Metadata

Assignees

Labels

🐛 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions