Skip to content

Commit dc39523

Browse files
committed
Restore some files from master
1 parent 8042578 commit dc39523

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

.github/copilot-instructions.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# GitHub Copilot Instructions
2+
3+
This document provides guidelines and best practices for using GitHub Copilot in the `osparc-simcore` repository and other Python and Node.js projects.
4+
5+
## General Guidelines
6+
7+
1. **Use Python 3.11**: Ensure that all Python-related suggestions align with Python 3.11 features and syntax.
8+
2. **Node.js Compatibility**: For Node.js projects, ensure compatibility with the version specified in the project (e.g., Node.js 14 or later).
9+
3. **Follow Coding Conventions**: Adhere to the coding conventions outlined in the `docs/coding-conventions.md` file.
10+
4. **Test-Driven Development**: Write unit tests for all new functions and features. Use `pytest` for Python and appropriate testing frameworks for Node.js.
11+
5. **Environment Variables**: Use environment variables as specified in `docs/env-vars.md` for configuration. Avoid hardcoding sensitive information.
12+
6. **Documentation**: Prefer self-explanatory code; add documentation only if explicitly requested by the developer.
13+
14+
## Python-Specific Instructions
15+
16+
- Always use type hints and annotations to improve code clarity and compatibility with tools like `mypy`.
17+
- An exception to that rule is in `test_*` functions return type hint must not be added
18+
- Follow the dependency management practices outlined in `requirements/`.
19+
- Use `ruff` for code formatting and for linting.
20+
- Use `black` for code formatting and `pylint` for linting.
21+
- ensure we use `sqlalchemy` >2 compatible code.
22+
- ensure we use `pydantic` >2 compatible code.
23+
- ensure we use `fastapi` >0.100 compatible code
24+
- use f-string formatting
25+
- Only add comments in function if strictly necessary
26+
27+
28+
### Json serialization
29+
30+
- Generally use `json_dumps`/`json_loads` from `common_library.json_serialization` to built-in `json.dumps` / `json.loads`.
31+
- Prefer Pydantic model methods (e.g., `model.model_dump_json()`) for serialization.
32+
33+
34+
## Node.js-Specific Instructions
35+
36+
- Use ES6+ syntax and features.
37+
- Follow the `package.json` configuration for dependencies and scripts.
38+
- Use `eslint` for linting and `prettier` for code formatting.
39+
- Write modular and reusable code, adhering to the project's structure.
40+
41+
## Copilot Usage Tips
42+
43+
1. **Be Specific**: Provide clear and detailed prompts to Copilot for better suggestions.
44+
2. **Iterate**: Review and refine Copilot's suggestions to ensure they meet project standards.
45+
3. **Split Tasks**: Break down complex tasks into smaller, manageable parts for better suggestions.
46+
4. **Test Suggestions**: Always test Copilot-generated code to ensure it works as expected.
47+
48+
## Additional Resources
49+
50+
- [Python Coding Conventions](../docs/coding-conventions.md)
51+
- [Environment Variables Guide](../docs/env-vars.md)
52+
- [Steps to Upgrade Python](../docs/steps-to-upgrade-python.md)
53+
- [Node.js Installation Script](../scripts/install_nodejs_14.bash)

scripts/common-service.Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ info: ## displays service info
137137

138138
.PHONY: _run-test-dev _run-test-ci
139139

140-
# TEST_TARGET := $(if $(target),$(target),$(CURDIR)/tests/unit)
140+
TEST_TARGET := $(if $(target),$(target),$(CURDIR)/tests/unit)
141141
PYTEST_ADDITIONAL_PARAMETERS := $(if $(pytest-parameters),$(pytest-parameters),)
142142
_run-test-dev: _check_venv_active
143143
# runs tests for development (e.g w/ pdb)
@@ -153,6 +153,7 @@ _run-test-dev: _check_venv_active
153153
--failed-first \
154154
--junitxml=junit.xml -o junit_family=legacy \
155155
--keep-docker-up \
156+
--pdb \
156157
-vv \
157158
$(PYTEST_ADDITIONAL_PARAMETERS) \
158159
$(TEST_TARGET)

services/api-server/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ APP_URL:=http://$(get_my_ip).nip.io:8006
8989

9090

9191
test-api: ## Runs schemathesis against development server (NOTE: make up-devel first)
92-
@docker run schemathesis/schemathesis:stable run --experimental=openapi-3.1 \
92+
@docker run schemathesis/schemathesis:stable run \
9393
"$(APP_URL)/api/v0/openapi.json"
9494

9595

0 commit comments

Comments
 (0)