Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development guide out of date #1675

Closed
rts-rob opened this issue Aug 3, 2020 · 4 comments
Closed

Development guide out of date #1675

rts-rob opened this issue Aug 3, 2020 · 4 comments
Labels
contributors/good-first-issue Good first issue for a contributor

Comments

@rts-rob
Copy link

rts-rob commented Aug 3, 2020

Description:

The development guide is out of date. This makes it difficult for the community to contribute to the project.

Specific examples include, but are not limited to:

  1. make setup - setup is not a target in the Makefile. Believe this should be make init?
  2. To get this to work I had to modify to init target in the Makefile to include the flag --user.
  3. make init does not install pytest

Steps to reproduce the issue:

  1. make setup

Observed result:

➜  serverless-application-model git:(develop) make setup
make: *** No rule to make target `setup'.  Stop.

Expected result:
dependencies are installed

  1. make init

Observed result:

➜  serverless-application-model git:(develop) make init
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'RECORD'
Consider using the `--user` option or check the permissions.

Expected result:
dependencies are installed

  1. make pr

Observed result:

➜  serverless-application-model git:(develop) make pr
make: pytest: No such file or directory
make: *** [test] Error 1

Expected result:
tests are run

Suggest a review of the development guide and aligning the commands/semantics with the aws-sam-cli development guide.

@jfuss
Copy link
Contributor

jfuss commented Aug 7, 2020

@rts-rob Thanks for bringing this to our attention. Would you be willing to update this? SAM now matches the development guide of SAM CLI. We should be able to just update SAM's with the relevant parts of SAM CLI's guide: https://github.com/awslabs/aws-sam-cli/blob/develop/DEVELOPMENT_GUIDE.md

@jfuss jfuss added area/docs contributors/good-first-issue Good first issue for a contributor labels Aug 7, 2020
@rts-rob
Copy link
Author

rts-rob commented Aug 10, 2020

Thanks @jfuss - I took a look but given that my Python skill level is "copy/paste without understanding" I don't think I'm the right contributor to take this one.

@wong-a
Copy link
Contributor

wong-a commented Nov 5, 2020

After a couple of hours of frustration following the development guide (a lot longer than I'm happy admitting), I finally got my local dev environment set up.

Besides make setup not existing, I ran into the following problems on MacOS. Maybe these are obvious things, but I'm a total noob when it comes to setting up Python environments and stuff.

1. Installing PyEnv

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash didn't work due to some openssl problem.

I ran brew install pyenv instead of the installer as recommended here: pyenv/pyenv#993

2. None of the make targets worked correctly

I kept getting the following error saying option --user not recognized when running make init. The Makefile was using my system's version of Python (which was 2.7) instead of my pyenv's version which I had set to 3.7.2 (the latest in the SAM CLI setup guide).

Installing collected packages: aws-sam-translator
  Attempting uninstall: aws-sam-translator
    Found existing installation: aws-sam-translator 1.28.1
    Uninstalling aws-sam-translator-1.28.1:
      Successfully uninstalled aws-sam-translator-1.28.1
  Running setup.py develop for aws-sam-translator
    ERROR: Command errored out with exit status 1:
     command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/wongada/workplace/serverless-application-model/setup.py'"'"'; __file__='"'"'/Users/wongada/workplace/serverless-application-model/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
         cwd: /Users/wongada/workplace/serverless-application-model/
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --user not recognized

I had to add this to my ~/.bash_profile then source ~/.bash_profile, which wasn't in the instructions:

eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

@hawflau
Copy link
Contributor

hawflau commented Nov 10, 2020

Closing as PR is merged

@hawflau hawflau closed this as completed Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributors/good-first-issue Good first issue for a contributor
Projects
None yet
Development

No branches or pull requests

4 participants