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

Dependencies + Development Environment Tweaks #80

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fund=false
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,16 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"python.analysis.extraPaths": [
"./lib/lambda_layers/helper_functions",
"./lib/lambda_layers/appsync_helpers"
],
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/cdk.out/**": true,
"**/.venv/**": true
}
}
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ pipeline.clean: ## Destroys the CDK pipeline
npx cdk destroy -c email=$(email) -c label=$(label) -c account=$(account_id) -c region=$(region) -c source_branch=$(source_branch) -c source_repo=$(source_repo)

drem.clean-infrastructure: ## Delete DREM application
aws cloudformation delete-stack --stack-name drem-backend-$(label)-infrastructure --region $(region) -c source_branch=$(source_branch) -c source_repo=$(source_repo)
aws cloudformation delete-stack --stack-name drem-backend-$(label)-infrastructure --region $(region)

drem.clean-base: ## Delete DREM application
aws cloudformation delete-stack --stack-name drem-backend-$(label)-base --region $(region) -c source_branch=$(source_branch) -c source_repo=$(source_repo)
aws cloudformation delete-stack --stack-name drem-backend-$(label)-base --region $(region)

manual.deploy: ## Deploy via cdk
npx cdk deploy --c manual_deploy=True -c email=$(email) -c label=$(label) -c account=$(account_id) -c region=$(region) -c source_branch=$(source_branch) -c source_repo=$(source_repo) --all
Expand Down Expand Up @@ -106,6 +106,11 @@ local.config.docker: ## Setup local config based on branch
cd $(overlaysSrcPath)/graphql/ && amplify codegen
cd $(current_dir)

local.config.python: ## Setup a Python .venv
python3 -m venv --prompt drem .venv
source .venv/bin/activate
pip install -e .[dev]

local.run: ## Run the frontend application locally for development
PORT=3000 npm start --prefix website

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ We recommend that you use the Makefile based commands to simplify the steps requ

If you plan to help develop DREM and contribute code, the initial deployment of DREM is the same as above. Once DREM has deployed, to make the deployed DREM stack available for local development, run the following commands, alternatively the stack can be run using docker compose to create containers for each of the three react applications that make up DREM:

In Visual Studio Code add the following extensions for the best experience:

- Prettier - `esbenp.prettier-vscode`
- Black Formatter - `ms-python.black-formatter`

### Local frontend development

Running all resources and installing all dependencies on the local machine
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"devDependencies": {
"@types/jest": "^29.5.4",
"@types/node": "20.5.6",
"@types/prettier": "3.0.0",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"aws-cdk": "2.122.0",
"@babel/plugin-proposal-private-property-in-object": "^7.16.7",
"aws-cdk": "2.166.0",
"eslint": "^8.48.0",
"eslint-config-node": "^4.1.0",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -49,14 +49,14 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.6.4",
"prettier": "^3.0.3",
"prettier": "^3.4.2",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "5.2.2"
},
"dependencies": {
"@aws-cdk/aws-lambda-python-alpha": "^2.122.0-alpha.0",
"aws-cdk-lib": "2.122.0",
"@aws-cdk/aws-lambda-python-alpha": "^2.166.0-alpha.0",
"aws-cdk-lib": "2.166.0",
"awscdk-appsync-utils": "^0.0.190",
"cdk-nag": "2.27.111",
"cdk-serverless-clamscan": "^2.5.64",
Expand Down
80 changes: 67 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,76 @@
[tool.pytest.ini_options]
addopts = "--cov --cov-report html --junitxml=reports/unittest-report.xml"
testpaths = [
"tests"
[project]
name = "guidance-for-aws-deepracer-event-management"
version = "1.0.0"
description = "AWS DeepRacer Event Management Solution"
readme = "README.md"
requires-python = ">=3.8"
license = { text = "Apache-2.0" }
authors = [
{ name = "AWS Solutions Library" }
]
pythonpath = [
".",
"./backend/lambdas/helper_functions_layer/http_response"
dependencies = [
"aws_lambda_powertools",
"boto3",
"requests_aws4auth",
"requests",
"http_response",
"simplejson",
"matplotlib",
"opencv-python",
"tqdm",
"psutil",
"pandas"
]

[project.optional-dependencies]
dev = [
"awscli",
"aws-cdk-lib>=2.0.0",
"constructs>=10.0.0",
"aws-cdk.aws-lambda-python-alpha",
"pytest",
"pytest-cov"
]

[tool.coverage.run]
source = ["backend/lambdas"]

[tool.setuptools]
packages = ["lib"]

[tool.isort]
profile = "black"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = "-ra -q"

[tool.black]
line-length = 88
target-version = ['py38']
include = '\.pyi?$'
experimental_string_processing = true
experimental_string_processing = true

[tool.isort]
profile = "black"
multi_line_output = 3
line_length = 88

[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
check_untyped_defs = true

[tool.coverage.run]
source = ["lib"]
omit = ["tests/*", "**/__init__.py"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"if TYPE_CHECKING:"
]

[project.urls]
Homepage = "https://github.com/aws-solutions-library-samples/guidance-for-aws-deepracer-event-management"
Documentation = "https://github.com/aws-solutions-library-samples/guidance-for-aws-deepracer-event-management/blob/main/README.md"
Repository = "https://github.com/aws-solutions-library-samples/guidance-for-aws-deepracer-event-management.git"
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"typeRoots": ["./node_modules/@types"]
"typeRoots": ["./node_modules/*","./node_modules/@types"]
},
"exclude": ["node_modules", "cdk.out"]
}
8 changes: 6 additions & 2 deletions website-leaderboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"react-dom": "^18.2.0",
"react-i18next": "^13.2.0",
"react-router-dom": "^6.15.0",
"react-scripts": "5.0.1",
"react-scripts": "^5.0.1",
"web-vitals": "^3.4.0"
},
"scripts": {
Expand Down Expand Up @@ -60,9 +60,13 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^3.0.3"
"prettier": "^3.4.2",
"typescript": "5.2.2"
},
"overrides": {
"react-scripts": {
"typescript": "^5"
},
"react-refresh": "^0.14.0"
}
}
3 changes: 2 additions & 1 deletion website-stream-overlays/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^3.0.3"
"prettier": "^3.4.2",
"typescript": "5.2.2"
}
}
6 changes: 5 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^3.0.3"
"prettier": "^3.4.2",
"typescript": "5.2.2"
},
"overrides": {
"@svgr/webpack": "$@svgr/webpack",
"react-scripts": {
"typescript": "^5"
},
"react-refresh": "^0.14.0"
}
}