AWS SAM CLI - Looking for help

Björn Raupach raupach at icloud.com
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: https://github.com/awslabs/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 https://pypi.org <https://pypi.org/>, 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/__init__.py", line 3251, in <module>
    @_call_aside
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", 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/__init__.py", 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/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", 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/__init__.py", 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 https://github.com/raupachz/macports-ports/tree/aws-sam-cli <https://github.com/raupachz/macports-ports/tree/aws-sam-cli>

And here is just the Portfile for py-aws-sam-cli: https://github.com/raupachz/macports-ports/blob/aws-sam-cli/python/py-aws-sam-cli/Portfile <https://github.com/raupachz/macports-ports/blob/aws-sam-cli/python/py-aws-sam-cli/Portfile>


Thank you all for the time and effort that goes into MacPorts!
/Björn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20191216/98c138ea/attachment.html>


More information about the macports-dev mailing list