Skip to content

Commit 99c53d7

Browse files
authored
chore(python) - Add support for python 3.8/3.9 remove 3.6 (#219)
* Remove python 3.6 and in python 3.8/3.9
1 parent 3987ad3 commit 99c53d7

File tree

4 files changed

+14
-23
lines changed

4 files changed

+14
-23
lines changed

.github/workflows/pr-ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,20 @@ on:
1212
jobs:
1313
build:
1414
env:
15-
AWS_DEFAULT_REGION: us-east-1
15+
AWS_DEFAULT_REGION: "us-east-1"
16+
AWS_SDK_LOAD_CONFIG: 1
17+
GOPATH: ${{ github.workspace }}
1618
runs-on: ubuntu-latest
1719
strategy:
1820
matrix:
19-
python: [3.6, 3.7, 3.8]
21+
python: [3.7, 3.8, 3.9]
22+
defaults:
23+
run:
24+
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
2025
steps:
21-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
27+
with:
28+
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
2229
- uses: actions/setup-go@v3
2330
with:
2431
go-version: '>=1.17.0'
@@ -30,6 +37,7 @@ jobs:
3037
run: |
3138
pip install pre-commit
3239
pip install --upgrade mypy 'attrs==19.2.0' -r https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-rpdk/master/requirements.txt
40+
go get ./...
3341
go install github.com/go-critic/go-critic/cmd/gocritic@latest
3442
go install golang.org/x/tools/cmd/goimports@latest
3543
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest

cfn/cfn.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ package cfn
33
import (
44
"context"
55
"errors"
6-
"io/ioutil"
76
"log"
87
"os"
9-
"path"
108
"sync"
119
"time"
1210

@@ -103,10 +101,7 @@ func makeEventFunc(h Handler) eventFunc {
103101
logging.SetProviderLogOutput(l)
104102
})
105103
re := newReportErr(m)
106-
if err := scrubFiles("/tmp"); err != nil {
107-
log.Printf("Error: %v", err)
108-
m.PublishExceptionMetric(time.Now(), event.Action, err)
109-
}
104+
110105
handlerFn, cfnErr := router(event.Action, h)
111106
log.Printf("Handler received the %s action", event.Action)
112107
if cfnErr != nil {
@@ -145,17 +140,6 @@ func makeEventFunc(h Handler) eventFunc {
145140
}
146141
}
147142

148-
func scrubFiles(dir string) error {
149-
names, err := ioutil.ReadDir(dir)
150-
if err != nil {
151-
return err
152-
}
153-
for _, entery := range names {
154-
os.RemoveAll(path.Join([]string{dir, entery.Name()}...))
155-
}
156-
return nil
157-
}
158-
159143
// router decides which handler should be invoked based on the action
160144
// It will return a route or an error depending on the action passed in
161145
func router(a string, h Handler) (handlerFunc, cfnerr.Error) {

python/rpdk/go/codegen.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
from subprocess import PIPE, CalledProcessError, run as subprocess_run # nosec
1313
from tempfile import TemporaryFile
1414

15-
from . import __version__
1615
from .resolver import translate_type
1716
from .utils import safe_reserved, validate_path
18-
from .version import check_version
1917

2018
LOG = logging.getLogger(__name__)
2119

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ def find_version(*file_paths):
5151
"Topic :: Software Development :: Code Generators",
5252
"Operating System :: OS Independent",
5353
"Programming Language :: Python :: 3 :: Only",
54-
"Programming Language :: Python :: 3.6",
5554
"Programming Language :: Python :: 3.7",
55+
"Programming Language :: Python :: 3.8",
56+
"Programming Language :: Python :: 3.9",
5657
],
5758
keywords="Amazon Web Services AWS CloudFormation",
5859
)

0 commit comments

Comments
 (0)