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

Fix broken Python invoke local for 3.12 and 3.13 #20

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guides/credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To limit the Serverless Framework’s access your AWS account, follow these step

2. Click on **Users** and then **Add user**. Enter a name in the first field to remind you this User is related to the Service you are deploying with the Serverless Framework, like `serverless-servicename-agent`. Enable **Programmatic access** by clicking the checkbox. Click **Next** to go through to the Permissions page. Click on **Create policy**. Select the **JSON** tab, and add a JSON file. You can use [this gist](https://gist.github.com/ServerlessBot/7618156b8671840a539f405dea2704c8) as a guide.

When you are finished, select **Review policy**. You can assign this policy a **Name** and **Description**, then choose **Create Policy**. Check to make sure everything looks good and click **Create user**. Later, you can create different IAM Users for different apps and different stages of those apps. That is, if you don't use separate AWS accounts for stages/apps, which is most common.
When you are finished, select **Review policy**. You can assign this policy a **Name** and **Description**, then choose **Create Policy**. Check to make sure everything looks good and click **Create user**. Later, you can create different IAM Users for different apps and different stages of those apps. That is, if you don't use separate AWS accounts for stages/apps, which is most common.

3. View and copy the **API Key** & **Secret** to a temporary place. These are your AWS access keys.

Expand Down
6 changes: 1 addition & 5 deletions lib/cli/resolve-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ module.exports = memoizee((commandsSchema = require('./commands-schema')) => {
}
}

if (
options.help ||
options.version ||
command === 'help'
) {
if (options.help || options.version || command === 'help') {
result.isHelpRequest = true;
}

Expand Down
4 changes: 1 addition & 3 deletions lib/plugins/aws/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ class AwsDeploy {
log.notice(
`Deploying ${this.serverless.service.service} to stage ${this.serverless
.getProvider('aws')
.getStage()} ${style.aside(
`(${this.serverless.getProvider('aws').getRegion()})`
)}`
.getStage()} ${style.aside(`(${this.serverless.getProvider('aws').getRegion()})`)}`
);
log.info(); // Ensure gap between verbose logging

Expand Down
12 changes: 11 additions & 1 deletion lib/plugins/aws/invoke-local/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,17 @@ class AwsInvokeLocal {
);
}

if (['python3.7', 'python3.8', 'python3.9', 'python3.10', 'python3.11'].includes(runtime)) {
if (
[
'python3.7',
'python3.8',
'python3.9',
'python3.10',
'python3.11',
'python3.12',
'python3.13',
].includes(runtime)
) {
const handlerComponents = handler.split(/\./);
const handlerPath = handlerComponents.slice(0, -1).join('.');
const handlerName = handlerComponents.pop();
Expand Down
8 changes: 5 additions & 3 deletions lib/utils/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ const arch = (() => {
module.exports = {
resolveLatestTag: async () => {
const response = await fetch(
'https://api.github.com/repos/serverless/serverless/releases/latest'
'https://api.github.com/repos/serverless/serverless/releases/latest'
);
const data = await response.json();
return data.tag_name;
},
resolveUrl: (tagName) => {
return `https://github.com/serverless/serverless/releases/download/${tagName}/` +
`serverless-${platform}-${arch}`;
return (
`https://github.com/serverless/serverless/releases/download/${tagName}/` +
`serverless-${platform}-${arch}`
);
},
path: `${os.homedir()}/.serverless/bin/serverless`,
};
1 change: 0 additions & 1 deletion test/unit/lib/cli/handle-error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ describe('test/unit/lib/cli/handle-error.test.js', () => {
const output = await observeOutput(() => handleError(handleError('NON-ERROR')));
expect(output).to.have.string('NON-ERROR');
});

});
Loading