Hey Pants Team, `update-build-files` goal shows er...
# general
r
Hey Pants Team,
update-build-files
goal shows errors to add
name
to
poetry_requirements
but that's not a supported option. Since the
pyproject.toml
lives at the root of the project I believe this error is related:
Copy code
njgrisafi@Nicks-MacBook-Pro ~/workspace/pants-example (build-file-defaults)$ ./pants lint ::
14:28:42.68 [INFO] Initializing scheduler...
14:28:42.88 [INFO] Scheduler initialized.
14:28:42.93 [ERROR] 1 Exception encountered:

  MappingError: Failed to parse ./BUILD:
Targets in root-level BUILD files must be named explicitly.
example branch: https://github.com/njgrisafi/pants-example/tree/build-file-defaults
👀 1
this was the output from `update-build-files`:
Copy code
njgrisafi@Nicks-MacBook-Pro ~/workspace/pants-example (build-file-defaults)$ ./pants update-build-files --fix-python-macros
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
14:22:38.03 [ERROR] You must manually add the `name=` field to the following targets. This is not done automatically by the `update-build-files` goal.

  * `poetry_requirements` in BUILD: add `name="poetry"
h
What happens if you add those names?
h
Hi Nick! The deprecation for using the new macros is very particular. At the same time that you add the name field, you must also change the global option for use deprecated python macros
There is a very awkward and unfortunate in between where things do not work in a partial state
r
after adding name to
poetry_requirements
it fails to parse the BUILD file:
Copy code
njgrisafi@Nicks-MacBook-Pro ~/workspace/pants-example (build-file-defaults)$ ./pants update-build-files --fix-python-macros
14:20:38.53 [INFO] Initializing scheduler...
14:20:38.70 [INFO] Scheduler initialized.
14:20:44.74 [ERROR] 1 Exception encountered:

  MappingError: Failed to parse ./BUILD:
__call__() got an unexpected keyword argument 'name'
h
Did you set the global option?
r
is that for
use_deprecated_python_macros
?
h
Yes
Set it to false
r
that seems to have did the trick thank you @hundreds-father-404!
❤️ 1
h
Great! I wish so badly that the deprecation could have been less intricate