Skip to content

Commit 50ec4c0

Browse files
authored
fix makefile and appconfig ids
1 parent 9c00239 commit 50ec4c0

File tree

7 files changed

+58
-54
lines changed

7 files changed

+58
-54
lines changed

Makefile_windows

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ dev:
88

99
lint:
1010
@echo "Running flake8"
11-
flake8 service/* cdk/* tests/* docs/examples/* --exclude patterns='build,cdk.json,cdk.context.json,.yaml'
11+
flake8 service\* cdk\* tests\* docs\examples\* --exclude patterns='build,cdk.json,cdk.context.json,.yaml'
1212

1313
complex:
1414
@echo "Running Radon"
15-
radon cc -e 'tests/*,cdk.out/*' .
15+
radon cc -e 'tests\*,cdk.out\*' .
1616
@echo "Running xenon"
17-
xenon --max-absolute B --max-modules A --max-average A -e 'tests/*,.venv/*,cdk.out/*' .
17+
xenon --max-absolute B --max-modules A --max-average A -e 'tests\*,.venv\*,cdk.out\*' .
1818

1919
sort:
20-
isort ${PWD}
20+
isort
2121

2222
pre-commit:
2323
pre-commit run -a --show-diff-on-failure
@@ -30,32 +30,33 @@ unit:
3030
pytest tests\unit --cov-config=.coveragerc --cov=service --cov-report xml
3131

3232
integration:
33-
pytest tests/integration --cov-config=.coveragerc --cov=service --cov-report xml
33+
pytest tests\integration --cov-config=.coveragerc --cov=service --cov-report xml
3434

3535
e2e:
36-
pytest tests/e2e --cov-config=.coveragerc --cov=service --cov-report xml
36+
pytest tests\e2e --cov-config=.coveragerc --cov=service --cov-report xml
3737

3838
pr: deps yapf sort pre-commit complex lint lint-docs unit integration e2e
3939

4040
yapf:
41-
yapf -i -vv --style=./.style --exclude=.venv --exclude=.build --exclude=cdk.out --exclude=.git -r .
41+
yapf -i -vv --style=.\.style --exclude=.venv --exclude=.build --exclude=cdk.out --exclude=.git -r .
4242

4343
pipeline-tests:
44-
pytest tests/unit tests/integration --cov-config=.coveragerc --cov=service --cov-report xml
44+
pytest tests\unit tests\integration --cov-config=.coveragerc --cov=service --cov-report xml
4545

4646
deploy:
4747
make deps
48-
if not exist ".build\lambdas" mkdir ".build\lambdas"
49-
xcopy /s /e /y service .build\lambdas
48+
if not exist ".build\lambdas\service" mkdir ".build\lambdas\service"
49+
rmdir /S /Q .build\lambdas\service
50+
echo D | xcopy /f /y service .build\lambdas\service /s
5051
if not exist ".build\common_layer" mkdir ".build\common_layer"
5152
pipenv requirements > .build\common_layer\requirements.txt
5253
cdk deploy --app="python cdk\my_service\app.py" --require-approval=never
5354

5455
destroy:
55-
cdk destroy --app="python ${PWD}\cdk\my_service\app.py" --force
56+
cdk destroy --app="python cdk\my_service\app.py" --force
5657

5758
docs:
5859
mkdocs serve
5960

6061
lint-docs:
61-
docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli --fix "docs"
62+
docker run -v \markdown 06kellyjac\markdownlint-cli --fix "docs"

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ isort = "*"
2222
boto3 = "*"
2323
mkdocs-material = "*"
2424
mkdocs-git-revision-date-plugin = "*"
25+
setuptools = ">=65.5.1"
2526

2627
[packages]
2728
aws-lambda-powertools= {extras = ["all"],version = "*"}

Pipfile.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdk/my_service/service_stack/configuration/configuration_construct.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ def __init__(self, scope: Construct, id_: str, environment: str, service_name: s
4141
)
4242
self.config_env = appconfig.CfnEnvironment(
4343
self,
44-
id='env',
44+
id=f'{id_}env',
4545
application_id=self.config_app.ref,
4646
name=environment,
4747
)
4848
self.config_profile = appconfig.CfnConfigurationProfile(
4949
self,
50-
id='profile',
50+
id=f'{id_}profile',
5151
application_id=self.config_app.ref,
5252
location_uri='hosted',
5353
name=configuration_name,
5454
)
5555
self.hosted_cfg_version = appconfig.CfnHostedConfigurationVersion(
5656
self,
57-
'version',
57+
f'{id_}version',
5858
application_id=self.config_app.ref,
5959
configuration_profile_id=self.config_profile.ref,
6060
content=configuration_str,
@@ -63,7 +63,7 @@ def __init__(self, scope: Construct, id_: str, environment: str, service_name: s
6363

6464
self.cfn_deployment_strategy = appconfig.CfnDeploymentStrategy(
6565
self,
66-
CUSTOM_ZERO_TIME_STRATEGY,
66+
f'{id_}{CUSTOM_ZERO_TIME_STRATEGY}',
6767
deployment_duration_in_minutes=0,
6868
growth_factor=100,
6969
name=CUSTOM_ZERO_TIME_STRATEGY,
@@ -74,7 +74,7 @@ def __init__(self, scope: Construct, id_: str, environment: str, service_name: s
7474

7575
self.app_config_deployment = appconfig.CfnDeployment(
7676
self,
77-
id='deploy',
77+
id=f'{id_}deploy',
7878
application_id=self.config_app.ref,
7979
configuration_profile_id=self.config_profile.ref,
8080
configuration_version=self.hosted_cfg_version.ref,

cdk/my_service/service_stack/service_stack.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import pwd
32
from pathlib import Path
43

54
from aws_cdk import Stack
@@ -12,7 +11,10 @@
1211

1312
def get_stack_name() -> str:
1413
repo = Repo(Path.cwd())
15-
username = pwd.getpwuid(os.getuid()).pw_name.replace('.', '-')
14+
try:
15+
username = os.getlogin().replace('.', '-')
16+
except Exception:
17+
username = 'main'
1618
print(f'username={username}')
1719
try:
1820
return f'{username}-{repo.active_branch}-{SERVICE_NAME}'

dev_requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
-i https://pypi.org/simple
22
attrs==22.1.0 ; python_version >= '3.5'
33
aws-cdk-lib==2.53.0 ; python_version ~= '3.7'
4-
aws-cdk.asset-awscli-v1==2.2.22 ; python_version ~= '3.7'
4+
aws-cdk.asset-awscli-v1==2.2.23 ; python_version ~= '3.7'
55
aws-cdk.asset-kubectl-v20==2.1.1 ; python_version ~= '3.7'
6-
aws-cdk.asset-node-proxy-agent-v5==2.0.28 ; python_version ~= '3.7'
6+
aws-cdk.asset-node-proxy-agent-v5==2.0.29 ; python_version ~= '3.7'
77
aws-cdk.aws-lambda-python-alpha==2.50.0a0 ; python_version ~= '3.7'
88
-e ./cdk
9-
boto3==1.26.18
10-
botocore==1.29.18 ; python_version >= '3.7'
9+
boto3==1.26.19
10+
botocore==1.29.19 ; python_version >= '3.7'
1111
cattrs==22.2.0 ; python_version >= '3.7'
12-
cdk-nag==2.21.16 ; python_version ~= '3.7'
12+
cdk-nag==2.21.17 ; python_version ~= '3.7'
1313
certifi==2022.9.24 ; python_version >= '3.6'
1414
cfgv==3.3.1 ; python_full_version >= '3.6.1'
1515
charset-normalizer==2.1.1 ; python_full_version >= '3.6.0'
1616
click==8.1.3 ; python_version >= '3.7'
1717
colorama==0.4.6 ; python_version >= '3.5'
18-
constructs==10.1.174 ; python_version ~= '3.7'
18+
constructs==10.1.175 ; python_version ~= '3.7'
1919
coverage[toml]==6.5.0 ; python_version >= '3.7'
2020
distlib==0.3.6
2121
exceptiongroup==1.0.4 ; python_version < '3.11'
@@ -40,7 +40,7 @@ mccabe==0.7.0 ; python_version >= '3.6'
4040
mergedeep==1.3.4 ; python_version >= '3.6'
4141
mkdocs==1.4.2 ; python_version >= '3.7'
4242
mkdocs-git-revision-date-plugin==0.3.2
43-
mkdocs-material==8.5.10
43+
mkdocs-material==8.5.11
4444
mkdocs-material-extensions==1.1.1 ; python_version >= '3.7'
4545
nodeenv==1.7.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'
4646
packaging==21.3 ; python_version >= '3.6'
@@ -66,7 +66,7 @@ pyyaml-env-tag==0.1 ; python_version >= '3.6'
6666
radon==5.1.0
6767
requests==2.28.1 ; python_version >= '3.7' and python_version < '4'
6868
s3transfer==0.6.0 ; python_version >= '3.7'
69-
setuptools==65.6.3 ; python_version >= '3.7'
69+
setuptools==65.6.3
7070
six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
7171
smmap==5.0.0 ; python_version >= '3.6'
7272
toml==0.10.2 ; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'

lambda_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-i https://pypi.org/simple
22
aws-lambda-powertools[all]==2.4.0
33
aws-xray-sdk==2.11.0
4-
botocore==1.29.18 ; python_version >= '3.7'
4+
botocore==1.29.19 ; python_version >= '3.7'
55
fastjsonschema==2.16.2
66
jmespath==1.0.1 ; python_version >= '3.7'
77
pydantic==1.10.2

0 commit comments

Comments
 (0)