Skip to content

Commit

Permalink
Update to Atoti Python API 0.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tibdex committed Feb 13, 2024
1 parent a93757a commit 1357118
Show file tree
Hide file tree
Showing 11 changed files with 298 additions and 476 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Set up Python, install Poetry and the dependencies
runs:
using: "composite"
steps:
- run: pipx install poetry==1.7.0
- run: pipx install poetry==1.7.1
shell: bash
- uses: actions/setup-python@v5
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: poetry run app format --check
- run: poetry run app lint --check
- run: poetry run app typecheck
- run: poetry run app test
- run: poetry run ruff format --check
- run: poetry run ruff check
- run: poetry run mypy
- run: poetry run pytest
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnType": true
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"python.analysis.autoImportCompletions": true,
"python.languageServer": "Pylance",
"python.testing.pytestArgs": [
"--capture=no",
"--verbose"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.2
FROM python:3.9.12-slim AS builder

RUN --mount=type=cache,target=/root/.cache pip install poetry==1.7.0
RUN --mount=type=cache,target=/root/.cache pip install poetry==1.7.1
RUN poetry config virtualenvs.create false

COPY poetry.lock pyproject.toml ./
Expand All @@ -16,6 +16,6 @@ ENV PORT=80
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
COPY app app

ENTRYPOINT ["python", "-u", "-m", "app"]
ENTRYPOINT ["python", "-O", "-u", "-m", "app"]

EXPOSE $PORT
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ This template can be used to start Atoti projects where the goal is to [go into
On top of the `atoti` package, it comes with:

- Dependency management with [Poetry](https://python-poetry.org)
- Settings management with [Pydantic](https://docs.pydantic.dev/2.5/concepts/pydantic_settings)
- Config management with [Pydantic Settings](https://docs.pydantic.dev/2.6/concepts/pydantic_settings)
- Testing with [pytest](https://docs.pytest.org)
- Type checking with [mypy](http://mypy-lang.org)
- Formatting and linting with [Ruff](https://beta.ruff.rs)
- Formatting and linting with [Ruff](https://docs.astral.sh/ruff)
- Continuous testing with [GitHub Actions](https://github.com/features/actions)

## Usage
Expand All @@ -24,31 +24,13 @@ On top of the `atoti` package, it comes with:

### Commands

To get a list of the commands that can be executed to interact with the project, run:
To start the app:

```bash
poetry run app --help
poetry run python -m main
```

A few examples:

- Start the app:

```bash
poetry run app start
```

- Launch the tests:

```bash
poetry run app test
```

- Reformat the code:

```bash
poetry run app format
```
Other useful commands can be found in [`test.yml`](.github/workflows/test.yml).

## Variants

Expand Down
6 changes: 0 additions & 6 deletions cli/__init__.py

This file was deleted.

12 changes: 0 additions & 12 deletions cli/_get_executable_path.py

This file was deleted.

23 changes: 0 additions & 23 deletions cli/_run_command.py

This file was deleted.

58 changes: 0 additions & 58 deletions cli/app.py

This file was deleted.

Loading

0 comments on commit 1357118

Please sign in to comment.