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

Python: Extend and/or override EXCLUDED_FILES #185

Closed
milesgranger opened this issue Jul 20, 2020 · 4 comments
Closed

Python: Extend and/or override EXCLUDED_FILES #185

milesgranger opened this issue Jul 20, 2020 · 4 comments

Comments

@milesgranger
Copy link

milesgranger commented Jul 20, 2020

Describe your idea/feature/enhancement

It appears the EXCLUDED_FILES is hardcoded.

It would be delightful if this could be extended/modified. I have many files and directories which are ignored by my own .gitignore but these continue to be included in the build directory by SAM. (build/, .eggs/, .ipython/, .ipynb_checkpoints/, dist/, package.json, package-lock.json, etc, etc)

Then there are files that shouldn't be ignored by git but should be ignored during the build such as a tests directory.

Furthermore, I don't actually want to ignore .git/ b/c I use setuptools-scm to control versioning with git, and during the build that fails because it has no git context.

Proposal

Add configuration ability to override or extend with existing .gitignore or with own list, ie a .samignore file

@carpnick
Copy link

This needs to be exposed in AWS SAM to support other tools like - the AWS cfn tool set. - IE - https://github.com/aws-cloudformation/cloudformation-cli-python-plugin

Directly related to this issue - aws-cloudformation/cloudformation-cli-python-plugin#247

@HWiese1980
Copy link

Has this feature been implemented? I'm running into the same problem with a python project that contains big virtual environments that I'd like to exclude.

@festusyuma
Copy link

festusyuma commented Apr 11, 2023

Has this feature been implemented? I'm running into the same problem with a python project that contains big virtual environments that I'd like to exclude.

Hi, Have you had any luck with this issue, I have some symlinks in my project node_modules/.bin and I am unable to run sam build --use-container cos it keeps trying to copy the symlinks and end up with errors like this

FileNotFoundError: [Errno 2] No such file or directory: '***/backend/node_modules/.bin/ts-node'

@mildaniel
Copy link
Contributor

Created a separate issue to consolidate the discussion for include/exclude functionality #516.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants