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

Update devcontainer to read version from aries-cloudagent package #2483

Merged
merged 4 commits into from
Sep 14, 2023
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
4 changes: 1 addition & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ RUN curl -sSL https://install.python-poetry.org | python3 - \
&& echo "fpath+=~/.zfunc\nautoload -Uz compinit && compinit" >> /home/vscode/.zshrc

COPY pyproject.toml poetry.lock ./
# we do not want the packages defined for this install, comment out the line.
RUN sed -i 's/^[^#]*packages/#&/' pyproject.toml
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --all-extras \
&& poetry install --no-root --no-interaction --all-extras \
&& rm -rf /root/.cache/pypoetry
5 changes: 4 additions & 1 deletion .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ python -m pip install --upgrade pip
pip3 install -r demo/requirements.txt -r demo/requirements.behave.txt

# install black for formatting
pip3 install black
pip3 install black

# install a version of aries-cloudagent so the pytests can pick up a version
pip3 install aries-cloudagent
37 changes: 20 additions & 17 deletions .vscode-sample/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,37 @@
]
},
{
"name": "flake8 - aries_cloudagent",
"name": "ruff - aries_cloudagent",
"type": "python",
"request": "launch",
"module": "flake8",
"module": "ruff",
"console": "integratedTerminal",
"sudo": true,
"justMyCode": true,
"cwd": "${workspaceFolder}/aries_cloudagent",
"args": [
"--max-line-length=90",
"--exclude=*/tests/**",
"--extend-ignore=D202,W503",
"--per-file-ignores=*/__init__.py:D104"
],
"args": ["check", "."],
},
{
"name": "flake8 - current file",
"name": "ruff fix - aries_cloudagent",
"type": "python",
"request": "launch",
"module": "flake8",
"module": "ruff",
"console": "integratedTerminal",
"sudo": true,
"justMyCode": true,
"args": [
"--max-line-length=90",
"--exclude=*/tests/**",
"--extend-ignore=D202,W503",
"--per-file-ignores=*/__init__.py:D104",
"${file}"
],
"cwd": "${workspaceFolder}/aries_cloudagent",
"args": ["check", ".", "--fix"],
},
{
"name": "ruff - current file",
"type": "python",
"request": "launch",
"module": "ruff",
"console": "integratedTerminal",
"sudo": true,
"justMyCode": true,
"cwd": "${workspaceFolder}/aries_cloudagent",
"args": ["check", ".", "${file}"],
},
{
"name": "black (check) - aries_cloudagent",
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Contributions are made pursuant to the Developer's Certificate of Origin, availa

A configuration for [pre-commit](https://pre-commit.com/) is included in this repository. This is an optional tool to help contributors commit code that follows the formatting requirements enforced by the CI pipeline. Additionally, it can be used to help contributors write descriptive commit messages that can be parsed by changelog generators.

On each commit, pre-commit hooks will run that verify the committed code complies with flake8 and is formatted with black. To install the flake8 and black checks:
On each commit, pre-commit hooks will run that verify the committed code complies with ruff and is formatted with black. To install the ruff and black checks:

```
$ pre-commit install
Expand Down
2 changes: 1 addition & 1 deletion DevReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ The `manage` script is described in detail [here](https://github.com/hyperledger

## Development Workflow

We use [Flake8](http://flake8.pycqa.org/en/latest/) to enforce a coding style guide.
We use [Ruff](https://github.com/astral-sh/ruff) to enforce a coding style guide.

We use [Black](https://black.readthedocs.io/en/stable/) to automatically format code.

Expand Down
2 changes: 1 addition & 1 deletion devcontainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ In VS Code, open a Terminal, you should be able to run the following commands:
```
python -m aries_cloudagent -v
cd aries_cloudagent
flake8 --max-line-length=90 --exclude=*/tests/** --extend-ignore=D202,W503 --per-file-ignores=*/__init__.py:D104
ruff check .
black . --check
```

Expand Down