poetry icon indicating copy to clipboard operation
poetry copied to clipboard

When I run poetry build I receive this error: [AttributeError] '_Printer' object has no attribute 'id'

Open xheisenbugx opened this issue 8 years ago • 8 comments

Hi :)

I am trying to build a package using poetry and I am receiving and error, the steps to reproduce it are these:

poetry new example cd example poetry build

and it returns [AttributeError] '_Printer' object has no attribute 'id'

Do you know how to fix this error?

Is there any documentarion about the pyproject.toml and its options?

Could be great if the default pyproject.toml includes more default options

xheisenbugx avatar Apr 09 '18 22:04 xheisenbugx

I found the issue, seems like the license field is required I just added it to the pyproject.toml file and it worked

xheisenbugx avatar Apr 09 '18 22:04 xheisenbugx

Could you please either add this field as optional or add it by default to the pyproject.toml file?

xheisenbugx avatar Apr 09 '18 22:04 xheisenbugx

@oca159 That's strange. If it is indeed the case then it's a bug since the license field is not mandatory and you should be able to build a project without it.

I will investigate.

sdispater avatar Apr 09 '18 22:04 sdispater

Yeah, you can verify it using poetry build -vvv I was testing and it was the issue I really love poetry :) this is a better experience than pipenv, congratulations!

xheisenbugx avatar Apr 09 '18 22:04 xheisenbugx

+ 1

grabear avatar Apr 10 '18 22:04 grabear

This is fixed on master (c291fae) and in release 0.8.0a3 (prerelease)

sdispater avatar Apr 10 '18 22:04 sdispater

For me this had to do with my environment. For some reason my environment + pycharm doesn't put git.exe in my path.

>poetry build -vvv
Building qwatch (0.2.0)
 - Building sdist


  [FileNotFoundError]
  [WinError 2] The system cannot find the file specified


Exception trace:
 c:\users\rgilmore\python36\lib\site-packages\poetry\_vendor\cleo\application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 c:\users\rgilmore\python36\lib\site-packages\poetry\console\application.py in do_run() at line 71
   return super().do_run(i, o)
 c:\users\rgilmore\python36\lib\site-packages\poetry\_vendor\cleo\application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 c:\users\rgilmore\python36\lib\site-packages\poetry\console\commands\command.py in run() at line 22
   return super(BaseCommand, self).run(i, o)
 c:\users\rgilmore\python36\lib\site-packages\poetry\_vendor\cleo\commands\base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 c:\users\rgilmore\python36\lib\site-packages\poetry\_vendor\cleo\commands\command.py in execute() at line 107
   return self.handle()
 c:\users\rgilmore\python36\lib\site-packages\poetry\console\commands\build.py in handle() at line 26
   builder.build(fmt)
 c:\users\rgilmore\python36\lib\site-packages\poetry\masonry\builder.py in build() at line 25
   return builder.build()
 c:\users\rgilmore\python36\lib\site-packages\poetry\masonry\builders\complete.py in build() at line 21
   sdist_file = sdist_builder.build()
 c:\users\rgilmore\python36\lib\site-packages\poetry\masonry\builders\sdist.py in build() at line 74
   files_to_add = self.find_files_to_add(exclude_build=False)
 c:\users\rgilmore\python36\lib\site-packages\poetry\masonry\builders\builder.py in find_files_to_add() at line 67
   excluded = self.find_excluded_files()
 c:\users\rgilmore\python36\lib\site-packages\poetry\masonry\builders\builder.py in find_excluded_files() at line 44
   vcs = get_vcs(self._path)
 c:\users\rgilmore\python36\lib\site-packages\poetry\vcs\__init__.py in get_vcs() at line 11
   return Git(p)
 c:\users\rgilmore\python36\lib\site-packages\poetry\vcs\git.py in __init__() at line 30
   self._config = GitConfig()
 c:\users\rgilmore\python36\lib\site-packages\poetry\vcs\git.py in __init__() at line 10
   stderr=subprocess.STDOUT
 c:\users\rgilmore\python36\lib\subprocess.py in check_output() at line 336
   **kwargs).stdout
 c:\users\rgilmore\python36\lib\subprocess.py in run() at line 403
   with Popen(*popenargs, **kwargs) as process:
 c:\users\rgilmore\python36\lib\subprocess.py in __init__() at line 707
   restore_signals, start_new_session)
 c:\users\rgilmore\python36\lib\subprocess.py in _execute_child() at line 990
   startupinfo)

build [-f|--format FORMAT]

After following this guide: https://stackoverflow.com/a/26180050/7351746 ...And issuing the same command, I successfully built my project.

grabear avatar Apr 10 '18 22:04 grabear

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Mar 03 '24 19:03 github-actions[bot]