9th-January-2019: Beeware

Below are some notes that I took while attempting to follow Dan Yeaw's guide How to Rock Python Packaging with Poetry and Briefcase to bundle up an app written with Beeware's Toga for use by general consumers (without requiring them to install a bunch of additional development stuff). I ran into issues and overcame some of them with the steps mentioned below.

poetry init did not work after using the install command for Poetry $ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python

I had to use pip install poetry

However, I was at the library at the time, they might've been blocking a port required for that script


Got error cannot import name 'LegacyRepository' when attempting to search for and install briefcase or pytest [I did this after sawing that it's added later on]

Only worked after doing pip install --upgrade --pre toga and pip install --upgrade --pre poetry


It was unclear to me which Toga package to choose when searching. Looking ahead in the guide, I guessed that it was the toga option, so I chose that:

Search for a package: toga

Found 23 packages matching toga

Enter package # to add, or the complete package name if it is not listed: 
 [ 0] toga-iOS
 [ 1] toga-curses
 [ 2] toga-flask
 [ 3] toga-demo
 [ 4] toga-android
 [ 5] toga-django
 [ 6] toga-gtk
 [ 7] toga-qt
 [ 8] toga-dummy
 [ 9] toga-pyramid
 [10] toga-watchOS
 [11] toga-cocoa
 [12] toga-tvOS
 [13] toga-web
 [14] toga-win32
 [15] toga-dotnet
 [16] toga-winrt
 [17] toga-winforms
 [18] toga-mfc
 [19] toga-uwp
 [20] toga-cassowary
 [21] toga
 [22] toga-core
 > 21

The description that I provided included an apostrophe and apparently the build tool didn't handle this case, leading to an issue when I attempted to run the app for Linux:

File "setup.py", line 22
    description='An app that shows what Beeware's Toga is capable of.',

The config read:

description='An app that shows what Beeware's Toga is capable of.',


Upon attempting to generate the Linux file, I got an error for having an old install of pip (error below). I fixed this by using pip install --upgrade pip

Traceback (most recent call last):
  File "setup.py", line 79, in <module>
    'toga-django==0.3.0.dev11',
  File "/home/brandon/anaconda3/envs/BeeWare/lib/python3.6/distutils/core.py", line 134, in setup
    ok = dist.parse_command_line()
  File "/home/brandon/.cache/pypoetry/virtualenvs/bee-demo-py3.6/lib/python3.6/site-packages/setuptools/dist.py", line 347, in parse_command_line
    result = _Distribution.parse_command_line(self)
  File "/home/brandon/anaconda3/envs/BeeWare/lib/python3.6/distutils/dist.py", line 472, in parse_command_line
    args = self._parse_command_opts(parser, args)
  File "/home/brandon/.cache/pypoetry/virtualenvs/bee-demo-py3.6/lib/python3.6/site-packages/setuptools/dist.py", line 658, in _parse_command_opts
    nargs = _Distribution._parse_command_opts(self, parser, args)
  File "/home/brandon/anaconda3/envs/BeeWare/lib/python3.6/distutils/dist.py", line 528, in _parse_command_opts
    cmd_class = self.get_command_class(command)
  File "/home/brandon/.cache/pypoetry/virtualenvs/bee-demo-py3.6/lib/python3.6/site-packages/setuptools/dist.py", line 478, in get_command_class
    ep.require(installer=self.fetch_build_egg)
  File "/home/brandon/.cache/pypoetry/virtualenvs/bee-demo-py3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2307, in require
    items = working_set.resolve(reqs, env, installer)
  File "/home/brandon/.cache/pypoetry/virtualenvs/bee-demo-py3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 858, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 9.0.1 (/home/brandon/.cache/pypoetry/virtualenvs/bee-demo-py3.6/lib/python3.6/site-packages), Requirement.parse('pip>=18.0'))

Issue with outdated setuptools


I was using Python 3.6, apparently, and I put ^3 in my Python config file.