AWS SAM CLI - Looking for help

Björn Raupach raupach at
Mon Dec 16 13:50:59 UTC 2019

Hi there,

would anyone mind helping me? I am not very experienced with Portfile development and I know little about Python, which makes this all very cumbersome (but fun). 

I am trying to setup a Portfile for AWS SAM CLI:  

My problem is dealing with Python dependencies. I know Python people have pip, conda and virtualenv - probably more. In MacPorts I can work with Port dependencies: depends_build-append, depends_lib-append and so on. I just don’t know how to put all of them together.

There is a Port for the AWS CLI (py-awscli). I went ahead and did a lot of copy & paste, trying to figure things out. 

I created 2 ports: py-aws-sam-cli and was-sam-cli_select. So far I managed to download aws-sam-cli from <>, but I end up with a runtime exception.

$ sam
Traceback (most recent call last):
  File "/opt/local/bin/sam", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/", line 3251, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/", line 583, in _build_master
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'tomlkit==0.5.8' distribution was not found and is required by aws-sam-cli

How to deal with missing dependencies in Python? Do I need py-tomlkit and create a MacPorts dependency on that port? 

My current work is here <>

And here is just the Portfile for py-aws-sam-cli: <>

Thank you all for the time and effort that goes into MacPorts!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-dev mailing list