When I run poetry build I receive this error: [AttributeError] '_Printer' object has no attribute 'id'
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
I found the issue, seems like the license field is required I just added it to the pyproject.toml file and it worked
Could you please either add this field as optional or add it by default to the pyproject.toml file?
@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.
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!
+ 1
This is fixed on master (c291fae) and in release 0.8.0a3 (prerelease)
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.
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.