-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix: Remove unneeded directory "schema" #5753
Conversation
I was not sure whether to remove the directory here: aws-sam-cli/installer/pyinstaller/build-linux.sh Lines 51 to 56 in 6fd3389
or to exclude it here: Line 54 in 6fd3389
|
Thanks for raising this PR! We can remove this folder from our packages, however they shouldn't affect the PKG installers since those are isolated from the rest of the system, and thus from any other Python packages. We can exclude this folder anyways since the code that is in there is not used by the rest of the tool. We can remove the folder in the |
@lucashuy thank you for your response. Feel free to review/update this PR, or to close it and open a fix in a separate PR. |
We should be able to reuse this existing PR. We can add that |
@lucashuy , done. |
Reverted adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the changes in setup.py are needed. build-linux.sh
and build-mac.sh
are used to create our installers. If you install AWS SAM CLI using our installers, I don't think you will hit the issue you saw. My guess is that you used pip install
. But then if setup.py is not updated, using pip install
will still hit the same issue.
I think the easiest way is to change the "schema" directory name to another name that's more unlikely to conflict with existing packages on PyPI.
@hawflau , thank you for reviewing. Do we really want to deploy the |
After some offline discussion, we can still exclude the folder and it's contents like was previously done in This involves changing the follow line: aws-sam-cli/schema/make_schema.py Line 14 in 8bfda32
import exceptions and updating the two references to SchemaGenerationException in the same file, to exceptions.SchemaGenerationException . This should solve the issue of a missing parent module when excluding this folder from the setup file.
|
Fixed an issue with Windows build in eeb968b . I run CI tested in https://github.com/forzagreen/aws-sam-cli/actions/runs/5936100836 |
Thanks for checking this out, this looks to be a cleaner fix! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
Which issue(s) does this change fix?
It fixes a bug introduced in v1.95.0:
When installing
aws-sam-cli
, it creates 2 folders insite-packages
:samcli
andschema
.Why is this change necessary?
The folder
schema
should not be published. It pollutes the environment, and enters in conflict with third-party library schemaHow does it address the issue?
Remove the directory
schema
before publishing the package.Mandatory Checklist
make pr
passes